]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
bpf, xdp: allow to pass flags to dev_change_xdp_fd
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 28 Nov 2016 22:16:54 +0000 (23:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 15:27:20 +0000 (10:27 -0500)
commit85de8576a0b14aecc99136cfbf90e367fa2142cb
tree30b716ce4c318a241ef2456bf2ed1be29991bcab
parent0f29f05bd7064bdf0c9629511bcba7650ce364d5
bpf, xdp: allow to pass flags to dev_change_xdp_fd

Add an IFLA_XDP_FLAGS attribute that can be passed for setting up
XDP along with IFLA_XDP_FD, which eventually allows user space to
implement typical add/replace/delete logic for programs. Right now,
calling into dev_change_xdp_fd() will always replace previous programs.

When passed XDP_FLAGS_UPDATE_IF_NOEXIST, we can handle this more
graceful when requested by returning -EBUSY in case we try to
attach a new program, but we find that another one is already
attached. This will be used by upcoming front-end for iproute2 as
well.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
include/uapi/linux/if_link.h
net/core/dev.c
net/core/rtnetlink.c