Re: [PATCH net] bpf: xdp: fallback to SKB mode if DRV flag is absent.

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-10-15 15:51:23
Also in
bpf, lkml
Reply to
Hangbin Liu, 2024-10-15
On Tue, 15 Oct 2024 03:36:32 +0000 Hangbin Liu wrote:
After commit c8a36f1945b2 ("bpf: xdp: Fix XDP mode when no mode flags
specified"), the mode is automatically set to XDP_MODE_DRV if the driver
implements the .ndo_bpf function. However, for drivers like bonding, which
only support native XDP for specific modes, this may result in an
"unsupported" response.

In such cases, let's fall back to SKB mode if the user did not explicitly
request DRV mode.
Looks like the issue is reported by QA rather than a real user.
A weak -1 from me on building such unreliable heuristics into
the kernel. As BPF CI's failure points out the ops can return
EOPNOTSUPP for multiple reasons while dev_xdp_mode() only checks 
if the driver *has* ndo_bpf, not if it fails.
Thread (8 messages) 8 messages, 4 authors, last reply 2024-10-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help