]> git.baikalelectronics.ru Git - kernel.git/commit
net: xdp: make the stack take care of the tear down
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 1 Dec 2017 23:08:57 +0000 (15:08 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 2 Dec 2017 23:27:57 +0000 (00:27 +0100)
commitbcf0b31b9b03c772c5fd210b23c3495ed7a8f933
treeb9e54041e4a7bc4e924f814e4c340ac65b0ff739
parenta3faa1f6ad6b6ee5a2cef7e26fc97d794fb8dfc4
net: xdp: make the stack take care of the tear down

Since day one of XDP drivers had to remember to free the program
on the remove path.  This leads to code duplication and is error
prone.  Make the stack query the installed programs on unregister
and if something is installed, remove the program.  Freeing of
program attached to XDP generic is moved from free_netdev() as well.

Because the remove will now be called before notifiers are
invoked, BPF offload state of the program will not get destroyed
before uninstall.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/nfp_net_common.c
drivers/net/ethernet/qlogic/qede/qede_main.c
drivers/net/tun.c
net/core/dev.c