diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-20 18:13:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-20 18:13:42 -0400 |
commit | d8894a08d91e230c5af9eed3de80114c5aaa3ccf (patch) | |
tree | d7cf7cb1bc5bc85a5c0f00dcae0f624c1212d67d /tools | |
parent | 81e97f01371f4e1701feeafe484665112cd9ddc2 (diff) | |
parent | 9887cba19978a5f288100ef90a37684cc8d5e0a6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
1) Fix crash on bpf_prog_load() errors, from Daniel Borkmann.
2) Fix ATM VCC memory accounting, from David Woodhouse.
3) fib6_info objects need RCU freeing, from Eric Dumazet.
4) Fix SO_BINDTODEVICE handling for TCP sockets, from David Ahern.
5) Fix clobbered error code in enic_open() failure path, from
Govindarajulu Varadarajan.
6) Propagate dev_get_valid_name() error returns properly, from Li
RongQing.
7) Fix suspend/resume in davinci_emac driver, from Bartosz Golaszewski.
8) Various act_ife fixes (recursive locking, IDR leaks, etc.) from
Davide Caratti.
9) Fix buggy checksum handling in sungem driver, from Eric Dumazet.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (40 commits)
ip: limit use of gso_size to udp
stmmac: fix DMA channel hang in half-duplex mode
net: stmmac: socfpga: add additional ocp reset line for Stratix10
net: sungem: fix rx checksum support
bpfilter: ignore binary files
bpfilter: fix build error
net/usb/drivers: Remove useless hrtimer_active check
net/sched: act_ife: preserve the action control in case of error
net/sched: act_ife: fix recursive lock and idr leak
net: ethernet: fix suspend/resume in davinci_emac
net: propagate dev_get_valid_name return code
enic: do not overwrite error code
net/tcp: Fix socket lookups with SO_BINDTODEVICE
ptp: replace getnstimeofday64() with ktime_get_real_ts64()
net/ipv6: respect rcu grace period before freeing fib6_info
net: net_failover: fix typo in net_failover_slave_register()
ipvlan: use ETH_MAX_MTU as max mtu
net: hamradio: use eth_broadcast_addr
enic: initialize enic->rfs_h.lock in enic_probe
MAINTAINERS: Add Sam as the maintainer for NCSI
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bpf/bpftool/perf.c | 5 | ||||
-rw-r--r-- | tools/bpf/bpftool/prog.c | 4 | ||||
-rw-r--r-- | tools/testing/selftests/bpf/config | 10 | ||||
-rwxr-xr-x | tools/testing/selftests/bpf/test_offload.py | 12 | ||||
-rwxr-xr-x | tools/testing/selftests/bpf/test_tunnel.sh | 26 |
5 files changed, 40 insertions, 17 deletions
diff --git a/tools/bpf/bpftool/perf.c b/tools/bpf/bpftool/perf.c index ac6b1a12c9b7..b76b77dcfd1f 100644 --- a/tools/bpf/bpftool/perf.c +++ b/tools/bpf/bpftool/perf.c | |||
@@ -29,9 +29,10 @@ static bool has_perf_query_support(void) | |||
29 | if (perf_query_supported) | 29 | if (perf_query_supported) |
30 | goto out; | 30 | goto out; |
31 | 31 | ||
32 | fd = open(bin_name, O_RDONLY); | 32 | fd = open("/", O_RDONLY); |
33 | if (fd < 0) { | 33 | if (fd < 0) { |
34 | p_err("perf_query_support: %s", strerror(errno)); | 34 | p_err("perf_query_support: cannot open directory \"/\" (%s)", |
35 | strerror(errno)); | ||
35 | goto out; | 36 | goto out; |
36 | } | 37 | } |
37 | 38 | ||
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index a4f435203fef..05f42a46d6ed 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c | |||
@@ -90,7 +90,9 @@ static void print_boot_time(__u64 nsecs, char *buf, unsigned int size) | |||
90 | } | 90 | } |
91 | 91 | ||
92 | wallclock_secs = (real_time_ts.tv_sec - boot_time_ts.tv_sec) + | 92 | wallclock_secs = (real_time_ts.tv_sec - boot_time_ts.tv_sec) + |
93 | nsecs / 1000000000; | 93 | (real_time_ts.tv_nsec - boot_time_ts.tv_nsec + nsecs) / |
94 | 1000000000; | ||
95 | |||
94 | 96 | ||
95 | if (!localtime_r(&wallclock_secs, &load_tm)) { | 97 | if (!localtime_r(&wallclock_secs, &load_tm)) { |
96 | snprintf(buf, size, "%llu", nsecs / 1000000000); | 98 | snprintf(buf, size, "%llu", nsecs / 1000000000); |
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config index 1eefe211a4a8..7eb613ffef55 100644 --- a/tools/testing/selftests/bpf/config +++ b/tools/testing/selftests/bpf/config | |||
@@ -7,3 +7,13 @@ CONFIG_CGROUP_BPF=y | |||
7 | CONFIG_NETDEVSIM=m | 7 | CONFIG_NETDEVSIM=m |
8 | CONFIG_NET_CLS_ACT=y | 8 | CONFIG_NET_CLS_ACT=y |
9 | CONFIG_NET_SCH_INGRESS=y | 9 | CONFIG_NET_SCH_INGRESS=y |
10 | CONFIG_NET_IPIP=y | ||
11 | CONFIG_IPV6=y | ||
12 | CONFIG_NET_IPGRE_DEMUX=y | ||
13 | CONFIG_NET_IPGRE=y | ||
14 | CONFIG_IPV6_GRE=y | ||
15 | CONFIG_CRYPTO_USER_API_HASH=m | ||
16 | CONFIG_CRYPTO_HMAC=m | ||
17 | CONFIG_CRYPTO_SHA256=m | ||
18 | CONFIG_VXLAN=y | ||
19 | CONFIG_GENEVE=y | ||
diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py index e78aad0a68bb..be800d0e7a84 100755 --- a/tools/testing/selftests/bpf/test_offload.py +++ b/tools/testing/selftests/bpf/test_offload.py | |||
@@ -163,6 +163,10 @@ def bpftool(args, JSON=True, ns="", fail=True): | |||
163 | 163 | ||
164 | def bpftool_prog_list(expected=None, ns=""): | 164 | def bpftool_prog_list(expected=None, ns=""): |
165 | _, progs = bpftool("prog show", JSON=True, ns=ns, fail=True) | 165 | _, progs = bpftool("prog show", JSON=True, ns=ns, fail=True) |
166 | # Remove the base progs | ||
167 | for p in base_progs: | ||
168 | if p in progs: | ||
169 | progs.remove(p) | ||
166 | if expected is not None: | 170 | if expected is not None: |
167 | if len(progs) != expected: | 171 | if len(progs) != expected: |
168 | fail(True, "%d BPF programs loaded, expected %d" % | 172 | fail(True, "%d BPF programs loaded, expected %d" % |
@@ -171,6 +175,10 @@ def bpftool_prog_list(expected=None, ns=""): | |||
171 | 175 | ||
172 | def bpftool_map_list(expected=None, ns=""): | 176 | def bpftool_map_list(expected=None, ns=""): |
173 | _, maps = bpftool("map show", JSON=True, ns=ns, fail=True) | 177 | _, maps = bpftool("map show", JSON=True, ns=ns, fail=True) |
178 | # Remove the base maps | ||
179 | for m in base_maps: | ||
180 | if m in maps: | ||
181 | maps.remove(m) | ||
174 | if expected is not None: | 182 | if expected is not None: |
175 | if len(maps) != expected: | 183 | if len(maps) != expected: |
176 | fail(True, "%d BPF maps loaded, expected %d" % | 184 | fail(True, "%d BPF maps loaded, expected %d" % |
@@ -585,8 +593,8 @@ skip(os.getuid() != 0, "test must be run as root") | |||
585 | # Check tools | 593 | # Check tools |
586 | ret, progs = bpftool("prog", fail=False) | 594 | ret, progs = bpftool("prog", fail=False) |
587 | skip(ret != 0, "bpftool not installed") | 595 | skip(ret != 0, "bpftool not installed") |
588 | # Check no BPF programs are loaded | 596 | base_progs = progs |
589 | skip(len(progs) != 0, "BPF programs already loaded on the system") | 597 | _, base_maps = bpftool("map") |
590 | 598 | ||
591 | # Check netdevsim | 599 | # Check netdevsim |
592 | ret, out = cmd("modprobe netdevsim", fail=False) | 600 | ret, out = cmd("modprobe netdevsim", fail=False) |
diff --git a/tools/testing/selftests/bpf/test_tunnel.sh b/tools/testing/selftests/bpf/test_tunnel.sh index aeb2901f21f4..546aee3e9fb4 100755 --- a/tools/testing/selftests/bpf/test_tunnel.sh +++ b/tools/testing/selftests/bpf/test_tunnel.sh | |||
@@ -608,28 +608,26 @@ setup_xfrm_tunnel() | |||
608 | test_xfrm_tunnel() | 608 | test_xfrm_tunnel() |
609 | { | 609 | { |
610 | config_device | 610 | config_device |
611 | #tcpdump -nei veth1 ip & | 611 | > /sys/kernel/debug/tracing/trace |
612 | output=$(mktemp) | 612 | setup_xfrm_tunnel |
613 | cat /sys/kernel/debug/tracing/trace_pipe | tee $output & | ||
614 | setup_xfrm_tunnel | ||
615 | tc qdisc add dev veth1 clsact | 613 | tc qdisc add dev veth1 clsact |
616 | tc filter add dev veth1 proto ip ingress bpf da obj test_tunnel_kern.o \ | 614 | tc filter add dev veth1 proto ip ingress bpf da obj test_tunnel_kern.o \ |
617 | sec xfrm_get_state | 615 | sec xfrm_get_state |
618 | ip netns exec at_ns0 ping $PING_ARG 10.1.1.200 | 616 | ip netns exec at_ns0 ping $PING_ARG 10.1.1.200 |
619 | sleep 1 | 617 | sleep 1 |
620 | grep "reqid 1" $output | 618 | grep "reqid 1" /sys/kernel/debug/tracing/trace |
621 | check_err $? | 619 | check_err $? |
622 | grep "spi 0x1" $output | 620 | grep "spi 0x1" /sys/kernel/debug/tracing/trace |
623 | check_err $? | 621 | check_err $? |
624 | grep "remote ip 0xac100164" $output | 622 | grep "remote ip 0xac100164" /sys/kernel/debug/tracing/trace |
625 | check_err $? | 623 | check_err $? |
626 | cleanup | 624 | cleanup |
627 | 625 | ||
628 | if [ $ret -ne 0 ]; then | 626 | if [ $ret -ne 0 ]; then |
629 | echo -e ${RED}"FAIL: xfrm tunnel"${NC} | 627 | echo -e ${RED}"FAIL: xfrm tunnel"${NC} |
630 | return 1 | 628 | return 1 |
631 | fi | 629 | fi |
632 | echo -e ${GREEN}"PASS: xfrm tunnel"${NC} | 630 | echo -e ${GREEN}"PASS: xfrm tunnel"${NC} |
633 | } | 631 | } |
634 | 632 | ||
635 | attach_bpf() | 633 | attach_bpf() |
@@ -657,6 +655,10 @@ cleanup() | |||
657 | ip link del ip6geneve11 2> /dev/null | 655 | ip link del ip6geneve11 2> /dev/null |
658 | ip link del erspan11 2> /dev/null | 656 | ip link del erspan11 2> /dev/null |
659 | ip link del ip6erspan11 2> /dev/null | 657 | ip link del ip6erspan11 2> /dev/null |
658 | ip xfrm policy delete dir out src 10.1.1.200/32 dst 10.1.1.100/32 2> /dev/null | ||
659 | ip xfrm policy delete dir in src 10.1.1.100/32 dst 10.1.1.200/32 2> /dev/null | ||
660 | ip xfrm state delete src 172.16.1.100 dst 172.16.1.200 proto esp spi 0x1 2> /dev/null | ||
661 | ip xfrm state delete src 172.16.1.200 dst 172.16.1.100 proto esp spi 0x2 2> /dev/null | ||
660 | } | 662 | } |
661 | 663 | ||
662 | cleanup_exit() | 664 | cleanup_exit() |
@@ -668,7 +670,7 @@ cleanup_exit() | |||
668 | 670 | ||
669 | check() | 671 | check() |
670 | { | 672 | { |
671 | ip link help $1 2>&1 | grep -q "^Usage:" | 673 | ip link help 2>&1 | grep -q "\s$1\s" |
672 | if [ $? -ne 0 ];then | 674 | if [ $? -ne 0 ];then |
673 | echo "SKIP $1: iproute2 not support" | 675 | echo "SKIP $1: iproute2 not support" |
674 | cleanup | 676 | cleanup |