]> 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)
commit768e673434c39831892ab9942b816aa152a98209
treed58459c8ddf651a7125a9e809ca4036aa841814f
parentf5902cf06dd96242f176100580a74a9f43c30d41
bpf: xdp: Fix XDP mode when no mode flags specified

29d3f0c0214f ("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: 29d3f0c0214f ("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