selftests/bpf: bpf tunnel test.
authorWilliam Tu <u9012063@gmail.com>
Thu, 26 Apr 2018 21:01:39 +0000 (14:01 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 26 Apr 2018 22:11:14 +0000 (00:11 +0200)
commit933a741e3b8295b9192a07367ebc15cbb4bdf957
treec418de16bb6bbeefa7956319038cf6476c79cb79
parentf761312023a1f0d625e34daadd54c3f9cb2a4ac2
selftests/bpf: bpf tunnel test.

The patch migrates the original tests at samples/bpf/tcbpf2_kern.c
and samples/bpf/test_tunnel_bpf.sh to selftests.  There are a couple
changes from the original:
    1) add ipv6 vxlan, ipv6 geneve, ipv6 ipip tests
    2) simplify the original ipip tests (remove iperf tests)
    3) improve documentation
    4) use bpf_ntoh* and bpf_hton* api

In summary, 'test_tunnel_kern.o' contains the following bpf program:
  GRE: gre_set_tunnel, gre_get_tunnel
  IP6GRE: ip6gretap_set_tunnel, ip6gretap_get_tunnel
  ERSPAN: erspan_set_tunnel, erspan_get_tunnel
  IP6ERSPAN: ip4ip6erspan_set_tunnel, ip4ip6erspan_get_tunnel
  VXLAN: vxlan_set_tunnel, vxlan_get_tunnel
  IP6VXLAN: ip6vxlan_set_tunnel, ip6vxlan_get_tunnel
  GENEVE: geneve_set_tunnel, geneve_get_tunnel
  IP6GENEVE: ip6geneve_set_tunnel, ip6geneve_get_tunnel
  IPIP: ipip_set_tunnel, ipip_get_tunnel
  IP6IP: ipip6_set_tunnel, ipip6_get_tunnel,
         ip6ip6_set_tunnel, ip6ip6_get_tunnel
  XFRM: xfrm_get_state

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_tunnel.sh [new file with mode: 0755]
tools/testing/selftests/bpf/test_tunnel_kern.c [new file with mode: 0644]