samples/bpf: Add xdp_sample_pkts example
authorToke Høiland-Jørgensen <toke@toke.dk>
Mon, 25 Jun 2018 12:25:02 +0000 (14:25 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 27 Jun 2018 09:01:03 +0000 (11:01 +0200)
commit1e54ad251a93a524f1a2950b1d65bc7437c57a53
tree603c318ae2766a28976e694cf7a966002375777e
parent22adedd304668f0a2001284ddf225b49e9c05c64
samples/bpf: Add xdp_sample_pkts example

Add an example program showing how to sample packets from XDP using the
perf event buffer. The example userspace program just prints the ethernet
header for every packet sampled.

Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/Makefile
samples/bpf/xdp_sample_pkts_kern.c [new file with mode: 0644]
samples/bpf/xdp_sample_pkts_user.c [new file with mode: 0644]