samples/bpf: Add tunnel set/get tests.
authorWilliam Tu <u9012063@gmail.com>
Fri, 19 Aug 2016 18:55:44 +0000 (11:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 20 Aug 2016 05:42:44 +0000 (22:42 -0700)
commit6afb1e28b8596443d72f82e085b4b2e8f410eae0
tree5a29556ab856c6b7773b7387d5205cf7537f8556
parentc0b558e5a393b77d2fe53335b5e07ca0e77178f8
samples/bpf: Add tunnel set/get tests.

The patch creates sample code exercising bpf_skb_{set,get}_tunnel_key,
and bpf_skb_{set,get}_tunnel_opt for GRE, VXLAN, and GENEVE.  A native
tunnel device is created in a namespace to interact with a lwtunnel
device out of the namespace, with metadata enabled.  The bpf_skb_set_*
program is attached to tc egress and bpf_skb_get_* is attached to egress
qdisc.  A ping between two tunnels is used to verify correctness and
the result of bpf_skb_get_* printed by bpf_trace_printk.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/Makefile
samples/bpf/bpf_helpers.h
samples/bpf/tcbpf2_kern.c [new file with mode: 0644]
samples/bpf/test_tunnel_bpf.sh [new file with mode: 0755]