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

7f0a838254bd ("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: 7f0a838254bd ("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