]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: xdp: Fix XDP mode when no mode flags specified
authorAndrii Nakryiko <andriin@fb.com>
Thu, 20 Aug 2020 05:28:41 +0000 (22:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 20 Aug 2020 21:27:12 +0000 (14:27 -0700)
commit2bb686474816f83fe087d75a07ab57094091afb2
treed58459c8ddf651a7125a9e809ca4036aa841814f
parent91c79a1bf3a94a1c34db8acac8c38721f18a40a0
bpf: xdp: Fix XDP mode when no mode flags specified

10dc71d50bb8 ("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")
inadvertently changed which XDP mode is assumed when no mode flags are
specified explicitly. Previously, driver mode was preferred, if driver
supported it. If not, generic SKB mode was chosen. That commit changed default
to SKB mode always. This patch fixes the issue and restores the original
logic.

Fixes: 10dc71d50bb8 ("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")
Reported-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/bpf/20200820052841.1559757-1-andriin@fb.com
net/core/dev.c