summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_tc_tunnel.sh
diff options
context:
space:
mode:
authorWillem de Bruijn2019-03-22 19:32:50 +0100
committerAlexei Starovoitov2019-03-22 21:52:44 +0100
commitccd34cd3577dd6e244269bb8ccfab228360aa53d (patch)
treeb83252e12af5d65d0db6d6ab727f8ae84459f593 /tools/testing/selftests/bpf/test_tc_tunnel.sh
parentselftests/bpf: bpf tunnel encap test (diff)
downloadkernel-qcow2-linux-ccd34cd3577dd6e244269bb8ccfab228360aa53d.tar.gz
kernel-qcow2-linux-ccd34cd3577dd6e244269bb8ccfab228360aa53d.tar.xz
kernel-qcow2-linux-ccd34cd3577dd6e244269bb8ccfab228360aa53d.zip
selftests/bpf: expand bpf tunnel test with decap
The bpf tunnel test encapsulates using bpf, then decapsulates using a standard tunnel device to verify correctness. Once encap is verified, also test decap, by replacing the tunnel device on decap with another bpf program. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_tc_tunnel.sh')
-rwxr-xr-xtools/testing/selftests/bpf/test_tc_tunnel.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_tc_tunnel.sh b/tools/testing/selftests/bpf/test_tc_tunnel.sh
index 6ebb288a3afc..91151d91e5a1 100755
--- a/tools/testing/selftests/bpf/test_tc_tunnel.sh
+++ b/tools/testing/selftests/bpf/test_tc_tunnel.sh
@@ -72,4 +72,13 @@ ip netns exec "${ns2}" ip link set dev testtun0 up
echo "test bpf encap with tunnel device decap"
client_connect
+# serverside, use BPF for decap
+ip netns exec "${ns2}" ip link del dev testtun0
+ip netns exec "${ns2}" tc qdisc add dev veth2 clsact
+ip netns exec "${ns2}" tc filter add dev veth2 ingress \
+ bpf direct-action object-file ./test_tc_tunnel.o section decap
+server_listen
+echo "test bpf encap with bpf decap"
+client_connect
+
echo OK