staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / test_xdp_meta.sh
blob637fcf4fe4e30ae94a0db979eda3b447f983abbd
1 #!/bin/sh
3 cleanup()
5 if [ "$?" = "0" ]; then
6 echo "selftests: test_xdp_meta [PASS]";
7 else
8 echo "selftests: test_xdp_meta [FAILED]";
9 fi
11 set +e
12 ip link del veth1 2> /dev/null
13 ip netns del ns1 2> /dev/null
14 ip netns del ns2 2> /dev/null
17 ip link set dev lo xdp off 2>/dev/null > /dev/null
18 if [ $? -ne 0 ];then
19 echo "selftests: [SKIP] Could not run test without the ip xdp support"
20 exit 0
22 set -e
24 ip netns add ns1
25 ip netns add ns2
27 trap cleanup 0 2 3 6 9
29 ip link add veth1 type veth peer name veth2
31 ip link set veth1 netns ns1
32 ip link set veth2 netns ns2
34 ip netns exec ns1 ip addr add 10.1.1.11/24 dev veth1
35 ip netns exec ns2 ip addr add 10.1.1.22/24 dev veth2
37 ip netns exec ns1 tc qdisc add dev veth1 clsact
38 ip netns exec ns2 tc qdisc add dev veth2 clsact
40 ip netns exec ns1 tc filter add dev veth1 ingress bpf da obj test_xdp_meta.o sec t
41 ip netns exec ns2 tc filter add dev veth2 ingress bpf da obj test_xdp_meta.o sec t
43 ip netns exec ns1 ip link set dev veth1 xdp obj test_xdp_meta.o sec x
44 ip netns exec ns2 ip link set dev veth2 xdp obj test_xdp_meta.o sec x
46 ip netns exec ns1 ip link set dev veth1 up
47 ip netns exec ns2 ip link set dev veth2 up
49 ip netns exec ns1 ping -c 1 10.1.1.22
50 ip netns exec ns2 ping -c 1 10.1.1.11
52 exit 0