OSDN Git Service

net, core: Add support for XDP redirection to slave device
authorJussi Maki <joamaki@gmail.com>
Sat, 31 Jul 2021 05:57:33 +0000 (05:57 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 9 Aug 2021 21:15:35 +0000 (23:15 +0200)
commit879af96ffd72706c6e3278ea6b45b0b0e37ec5d7
tree85a0f38f47d91d2f4a8232e58ed384c6f7634a59
parenta815bde56b15ce626caaacc952ab12501671e45d
net, core: Add support for XDP redirection to slave device

This adds the ndo_xdp_get_xmit_slave hook for transforming XDP_TX
into XDP_REDIRECT after BPF program run when the ingress device
is a bond slave.

The dev_xdp_prog_count is exposed so that slave devices can be checked
for loaded XDP programs in order to avoid the situation where both
bond master and slave have programs loaded according to xdp_state.

Signed-off-by: Jussi Maki <joamaki@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Link: https://lore.kernel.org/bpf/20210731055738.16820-3-joamaki@gmail.com
include/linux/filter.h
include/linux/netdevice.h
net/core/dev.c
net/core/filter.c