bpf: xdp: Add XDP example for head adjustment
authorMartin KaFai Lau <kafai@fb.com>
Wed, 7 Dec 2016 23:53:14 +0000 (15:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2016 19:25:13 +0000 (14:25 -0500)
commit12d8bb64e3f65f5287ff17c084d076a28daa8096
treee772f55d041956a3e07a487b48b42df8a0b830bf
parentea3349a03519dcd4f32d949cd80ab995623dc5ac
bpf: xdp: Add XDP example for head adjustment

The XDP prog checks if the incoming packet matches any VIP:PORT
combination in the BPF hashmap.  If it is, it will encapsulate
the packet with a IPv4/v6 header as instructed by the value of
the BPF hashmap and then XDP_TX it out.

The VIP:PORT -> IP-Encap-Info can be specified by the cmd args
of the user prog.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/Makefile
samples/bpf/bpf_helpers.h
samples/bpf/bpf_load.c
samples/bpf/bpf_load.h
samples/bpf/xdp1_user.c
samples/bpf/xdp_tx_iptunnel_common.h [new file with mode: 0644]
samples/bpf/xdp_tx_iptunnel_kern.c [new file with mode: 0644]
samples/bpf/xdp_tx_iptunnel_user.c [new file with mode: 0644]