Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Several conflicts here. NFP driver bug fix adding nfp_netdev_is_nfp_repr() check to nfp_fl_output() needed some adjustments because the code block is in an else block now. Parallel additions to net/pkt_cls.h and net/sch_generic.h A bug fix in __tcp_retransmit_skb() conflicted with some of the rbtree changes in net-next. The tc action RCU callback fixes in 'net' had some overlap with some of the recent tcf_block reworking. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -887,8 +887,8 @@ struct xdp_md {
|
||||
};
|
||||
|
||||
enum sk_action {
|
||||
SK_ABORTED = 0,
|
||||
SK_DROP,
|
||||
SK_DROP = 0,
|
||||
SK_PASS,
|
||||
SK_REDIRECT,
|
||||
};
|
||||
|
||||
|
||||
@@ -267,12 +267,13 @@ static int decode_instructions(struct objtool_file *file)
|
||||
&insn->immediate,
|
||||
&insn->stack_op);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err;
|
||||
|
||||
if (!insn->type || insn->type > INSN_LAST) {
|
||||
WARN_FUNC("invalid instruction type %d",
|
||||
insn->sec, insn->offset, insn->type);
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
hash_add(file->insn_hash, &insn->hash, insn->offset);
|
||||
@@ -296,6 +297,10 @@ static int decode_instructions(struct objtool_file *file)
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
free(insn);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,8 +8,8 @@ perf-record - Run a command and record its profile into perf.data
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] <command>
|
||||
'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>]
|
||||
'perf record' [-e <EVENT> | --event=EVENT] [-a] <command>
|
||||
'perf record' [-e <EVENT> | --event=EVENT] [-a] -- <command> [<options>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
. $(dirname $0)/lib/probe.sh
|
||||
|
||||
ld=$(realpath /lib64/ld*.so.* | uniq)
|
||||
libc=$(echo $ld | sed 's/ld/libc/g')
|
||||
|
||||
trace_libc_inet_pton_backtrace() {
|
||||
idx=0
|
||||
expected[0]="PING.*bytes"
|
||||
@@ -18,8 +21,8 @@ trace_libc_inet_pton_backtrace() {
|
||||
expected[3]=".*packets transmitted.*"
|
||||
expected[4]="rtt min.*"
|
||||
expected[5]="[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit:]]+\)"
|
||||
expected[6]=".*inet_pton[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$"
|
||||
expected[7]="getaddrinfo[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$"
|
||||
expected[6]=".*inet_pton[[:space:]]\($libc\)$"
|
||||
expected[7]="getaddrinfo[[:space:]]\($libc\)$"
|
||||
expected[8]=".*\(.*/bin/ping.*\)$"
|
||||
|
||||
perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do
|
||||
@@ -35,7 +38,7 @@ trace_libc_inet_pton_backtrace() {
|
||||
}
|
||||
|
||||
skip_if_no_perf_probe && \
|
||||
perf probe -q /lib64/libc-*.so inet_pton && \
|
||||
perf probe -q $libc inet_pton && \
|
||||
trace_libc_inet_pton_backtrace
|
||||
err=$?
|
||||
rm -f ${file}
|
||||
|
||||
@@ -532,7 +532,7 @@ void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list,
|
||||
|
||||
void perf_hpp__column_unregister(struct perf_hpp_fmt *format)
|
||||
{
|
||||
list_del(&format->list);
|
||||
list_del_init(&format->list);
|
||||
}
|
||||
|
||||
void perf_hpp__cancel_cumulate(void)
|
||||
@@ -606,6 +606,13 @@ next:
|
||||
|
||||
static void fmt_free(struct perf_hpp_fmt *fmt)
|
||||
{
|
||||
/*
|
||||
* At this point fmt should be completely
|
||||
* unhooked, if not it's a bug.
|
||||
*/
|
||||
BUG_ON(!list_empty(&fmt->list));
|
||||
BUG_ON(!list_empty(&fmt->sort_list));
|
||||
|
||||
if (fmt->free)
|
||||
fmt->free(fmt);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
%{
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include "../perf.h"
|
||||
#include "parse-events.h"
|
||||
#include "parse-events-bison.h"
|
||||
@@ -53,9 +56,8 @@ static int str(yyscan_t scanner, int token)
|
||||
return token;
|
||||
}
|
||||
|
||||
static bool isbpf(yyscan_t scanner)
|
||||
static bool isbpf_suffix(char *text)
|
||||
{
|
||||
char *text = parse_events_get_text(scanner);
|
||||
int len = strlen(text);
|
||||
|
||||
if (len < 2)
|
||||
@@ -68,6 +70,17 @@ static bool isbpf(yyscan_t scanner)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isbpf(yyscan_t scanner)
|
||||
{
|
||||
char *text = parse_events_get_text(scanner);
|
||||
struct stat st;
|
||||
|
||||
if (!isbpf_suffix(text))
|
||||
return false;
|
||||
|
||||
return stat(text, &st) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called when the parser gets two kind of input:
|
||||
*
|
||||
|
||||
@@ -374,6 +374,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
|
||||
tool->mmap2 = process_event_stub;
|
||||
if (tool->comm == NULL)
|
||||
tool->comm = process_event_stub;
|
||||
if (tool->namespaces == NULL)
|
||||
tool->namespaces = process_event_stub;
|
||||
if (tool->fork == NULL)
|
||||
tool->fork = process_event_stub;
|
||||
if (tool->exit == NULL)
|
||||
|
||||
@@ -23,12 +23,12 @@ static inline void *xyarray__entry(struct xyarray *xy, int x, int y)
|
||||
|
||||
static inline int xyarray__max_y(struct xyarray *xy)
|
||||
{
|
||||
return xy->max_x;
|
||||
return xy->max_y;
|
||||
}
|
||||
|
||||
static inline int xyarray__max_x(struct xyarray *xy)
|
||||
{
|
||||
return xy->max_y;
|
||||
return xy->max_x;
|
||||
}
|
||||
|
||||
#endif /* _PERF_XYARRAY_H_ */
|
||||
|
||||
@@ -26,7 +26,7 @@ endif
|
||||
|
||||
ifneq ($(OUTPUT),)
|
||||
# check that the output directory actually exists
|
||||
OUTDIR := $(realpath $(OUTPUT))
|
||||
OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
|
||||
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ifneq ($(O),)
|
||||
ifeq ($(origin O), command line)
|
||||
ABSOLUTE_O := $(realpath $(O))
|
||||
dummy := $(if $(ABSOLUTE_O),,$(error O=$(O) does not exist))
|
||||
dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
|
||||
ABSOLUTE_O := $(shell cd $(O) ; pwd)
|
||||
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
|
||||
COMMAND_O := O=$(ABSOLUTE_O)
|
||||
ifeq ($(objtree),)
|
||||
@@ -12,7 +12,7 @@ endif
|
||||
|
||||
# check that the output directory actually exists
|
||||
ifneq ($(OUTPUT),)
|
||||
OUTDIR := $(realpath $(OUTPUT))
|
||||
OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
|
||||
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
|
||||
endif
|
||||
|
||||
|
||||
@@ -17,5 +17,26 @@
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DEV1 ingress"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "d052",
|
||||
"name": "Add 1M filters with the same action",
|
||||
"category": [
|
||||
"filter",
|
||||
"flower"
|
||||
],
|
||||
"setup": [
|
||||
"$TC qdisc add dev $DEV2 ingress",
|
||||
"./tdc_batch.py $DEV2 $BATCH_FILE --share_action -n 1000000"
|
||||
],
|
||||
"cmdUnderTest": "$TC -b $BATCH_FILE",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC actions list action gact",
|
||||
"matchPattern": "action order 0: gact action drop.*index 1 ref 1000000 bind 1000000",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DEV2 ingress",
|
||||
"/bin/rm $BATCH_FILE"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -88,7 +88,7 @@ def prepare_env(cmdlist):
|
||||
exit(1)
|
||||
|
||||
|
||||
def test_runner(filtered_tests):
|
||||
def test_runner(filtered_tests, args):
|
||||
"""
|
||||
Driver function for the unit tests.
|
||||
|
||||
@@ -105,6 +105,8 @@ def test_runner(filtered_tests):
|
||||
for tidx in testlist:
|
||||
result = True
|
||||
tresult = ""
|
||||
if "flower" in tidx["category"] and args.device == None:
|
||||
continue
|
||||
print("Test " + tidx["id"] + ": " + tidx["name"])
|
||||
prepare_env(tidx["setup"])
|
||||
(p, procout) = exec_cmd(tidx["cmdUnderTest"])
|
||||
@@ -152,6 +154,10 @@ def ns_create():
|
||||
exec_cmd(cmd, False)
|
||||
cmd = 'ip -s $NS link set $DEV1 up'
|
||||
exec_cmd(cmd, False)
|
||||
cmd = 'ip link set $DEV2 netns $NS'
|
||||
exec_cmd(cmd, False)
|
||||
cmd = 'ip -s $NS link set $DEV2 up'
|
||||
exec_cmd(cmd, False)
|
||||
|
||||
|
||||
def ns_destroy():
|
||||
@@ -211,7 +217,8 @@ def set_args(parser):
|
||||
help='Execute the single test case with specified ID')
|
||||
parser.add_argument('-i', '--id', action='store_true', dest='gen_id',
|
||||
help='Generate ID numbers for new test cases')
|
||||
return parser
|
||||
parser.add_argument('-d', '--device',
|
||||
help='Execute the test case in flower category')
|
||||
return parser
|
||||
|
||||
|
||||
@@ -225,6 +232,8 @@ def check_default_settings(args):
|
||||
|
||||
if args.path != None:
|
||||
NAMES['TC'] = args.path
|
||||
if args.device != None:
|
||||
NAMES['DEV2'] = args.device
|
||||
if not os.path.isfile(NAMES['TC']):
|
||||
print("The specified tc path " + NAMES['TC'] + " does not exist.")
|
||||
exit(1)
|
||||
@@ -381,14 +390,17 @@ def set_operation_mode(args):
|
||||
if (len(alltests) == 0):
|
||||
print("Cannot find a test case with ID matching " + target_id)
|
||||
exit(1)
|
||||
catresults = test_runner(alltests)
|
||||
catresults = test_runner(alltests, args)
|
||||
print("All test results: " + "\n\n" + catresults)
|
||||
elif (len(target_category) > 0):
|
||||
if (target_category == "flower") and args.device == None:
|
||||
print("Please specify a NIC device (-d) to run category flower")
|
||||
exit(1)
|
||||
if (target_category not in ucat):
|
||||
print("Specified category is not present in this file.")
|
||||
exit(1)
|
||||
else:
|
||||
catresults = test_runner(testcases[target_category])
|
||||
catresults = test_runner(testcases[target_category], args)
|
||||
print("Category " + target_category + "\n\n" + catresults)
|
||||
|
||||
ns_destroy()
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
"""
|
||||
tdc_batch.py - a script to generate TC batch file
|
||||
|
||||
Copyright (C) 2017 Chris Mi <chrism@mellanox.com>
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(description='TC batch file generator')
|
||||
parser.add_argument("device", help="device name")
|
||||
parser.add_argument("file", help="batch file name")
|
||||
parser.add_argument("-n", "--number", type=int,
|
||||
help="how many lines in batch file")
|
||||
parser.add_argument("-o", "--skip_sw",
|
||||
help="skip_sw (offload), by default skip_hw",
|
||||
action="store_true")
|
||||
parser.add_argument("-s", "--share_action",
|
||||
help="all filters share the same action",
|
||||
action="store_true")
|
||||
parser.add_argument("-p", "--prio",
|
||||
help="all filters have different prio",
|
||||
action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
device = args.device
|
||||
file = open(args.file, 'w')
|
||||
|
||||
number = 1
|
||||
if args.number:
|
||||
number = args.number
|
||||
|
||||
skip = "skip_hw"
|
||||
if args.skip_sw:
|
||||
skip = "skip_sw"
|
||||
|
||||
share_action = ""
|
||||
if args.share_action:
|
||||
share_action = "index 1"
|
||||
|
||||
prio = "prio 1"
|
||||
if args.prio:
|
||||
prio = ""
|
||||
if number > 0x4000:
|
||||
number = 0x4000
|
||||
|
||||
index = 0
|
||||
for i in range(0x100):
|
||||
for j in range(0x100):
|
||||
for k in range(0x100):
|
||||
mac = ("%02x:%02x:%02x" % (i, j, k))
|
||||
src_mac = "e4:11:00:" + mac
|
||||
dst_mac = "e4:12:00:" + mac
|
||||
cmd = ("filter add dev %s %s protocol ip parent ffff: flower %s "
|
||||
"src_mac %s dst_mac %s action drop %s" %
|
||||
(device, prio, skip, src_mac, dst_mac, share_action))
|
||||
file.write("%s\n" % cmd)
|
||||
index += 1
|
||||
if index >= number:
|
||||
file.close()
|
||||
exit(0)
|
||||
@@ -12,6 +12,8 @@ NAMES = {
|
||||
# Name of veth devices to be created for the namespace
|
||||
'DEV0': 'v0p0',
|
||||
'DEV1': 'v0p1',
|
||||
'DEV2': '',
|
||||
'BATCH_FILE': './batch.txt',
|
||||
# Name of the namespace to use
|
||||
'NS': 'tcut'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user