Open myl7 opened 2 years ago
As I understand it (which is not in any depth), BPF is a useful thing to have in and of itself. There may be ways to use it with XDP, but XDP is not a requirement.
Looking at your search of the config settings, almost all of them are BPF matches (and quite a few are not enabled). Breaking down the search into categories you get:
Enabled BPF:
CONFIG_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_BPF_SYSCALL=y
CONFIG_CGROUP_BPF=y
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_LWTUNNEL_BPF=y
CONFIG_BPF_LIRC_MODE2=y
CONFIG_BPF_EVENTS=y
Disabled BPF:
# CONFIG_BPF_JIT is not set
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
# CONFIG_BPF_PRELOAD is not set
# CONFIG_BPFILTER is not set
# CONFIG_NET_CLS_BPF is not set
# CONFIG_NET_ACT_BPF is not set
# CONFIG_BPF_STREAM_PARSER is not set
# CONFIG_NBPFAXI_DMA is not set
# CONFIG_TEST_BPF is not set
Enabled XDP:
< This space intentionally left blank >
Disabled XDP:
# CONFIG_XDP_SOCKETS is not set
Out of 493 drivers in the 5.15 kernel (counting .ndo_open
methods), only 34 have .ndo_bpf
methods, and only 25 also have .ndo_xdp_xmit
methods. This leads me to conclude that XDP is currently only sparsely supported, and nothing in the Raspberry Pi kernel configurations should suggest that it ought to work.
Unless you know otherwise.
Describe the bug
Calling
bpf_xdp_adjust_tail
in XDP always fails with-EINVAL
, even when shrinking the frame, becausexdp->frame_sz > PAGE_SIZE
returns false sincexdp->frame_sz
is over 30000 butPAGE_SIZE
is 4096.Steps to reproduce the behaviour
bpf_xdp_adjust_tail
in it, log the return valueprintk
inbpf_xdp_adjust_tail
to track which check failscat /sys/kernel/debug/tracing/trace_pipe
to get log from XDP program, which tellsbpf_xdp_adjust_tail
failed with-22
=-EINVAL
dmesg
to get log from kernel, which tellsxdp->frame_sz > PAGE_SIZE
returns false and causes the failureDevice (s)
Raspberry Pi 3 Mod. B+
System
cat /etc/rpi-issue
)?Raspberry Pi OS (64-bit)
vcgencmd version
)?uname -a
)?Self built on recent latest commit
Logs
No response
Additional context
According to the description from the author:
So it should be the problem of the NIC card driver
I am not sure whether XDP is considered supported in Raspberry Pi, but since the feature is enabled:
and other simple things just work, the failure of
bpf_xdp_adjust_tail
should be unexpected