samples/bpf: Add XDP_SHARED_UMEM support to xdpsock
authorMagnus Karlsson <magnus.karlsson@intel.com>
Thu, 7 Nov 2019 17:47:37 +0000 (18:47 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Nov 2019 03:30:45 +0000 (19:30 -0800)
commit2e5d72c15f0dc713c203464c5c76eb4ec285f598
treef094baeb232a60c362d051de71b827a7d2309bdb
parentcbf07409d0c2afad7bb54be039490bffad8bc737
samples/bpf: Add XDP_SHARED_UMEM support to xdpsock

Add support for the XDP_SHARED_UMEM mode to the xdpsock sample
application. As libbpf does not have a built in XDP program for this
mode, we use an explicitly loaded XDP program. This also serves as an
example on how to write your own XDP program that can route to an
AF_XDP socket.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: William Tu <u9012063@gmail.com>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Link: https://lore.kernel.org/bpf/1573148860-30254-3-git-send-email-magnus.karlsson@intel.com
samples/bpf/Makefile
samples/bpf/xdpsock.h [new file with mode: 0644]
samples/bpf/xdpsock_kern.c [new file with mode: 0644]
samples/bpf/xdpsock_user.c