Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Add missing XDP_ABORTED handling in cpumap

cpu_map_bpf_prog_run_xdp() handles XDP_PASS, XDP_REDIRECT, and
XDP_DROP but is missing an XDP_ABORTED case. Without it, XDP_ABORTED
falls into the default case which logs a misleading "invalid XDP
action" warning instead of tracing the abort via trace_xdp_exception().

Add the missing XDP_ABORTED case with trace_xdp_exception(), matching
the handling already present in the skb path (cpu_map_bpf_prog_run_skb),
devmap (dev_map_bpf_prog_run), and the generic XDP path (do_xdp_generic).

Also pass xdpf->dev_rx instead of NULL to bpf_warn_invalid_xdp_action()
in the default case, so the warning includes the actual device name.
This aligns with the generic XDP path in net/core/dev.c which already
passes the real device.

Signed-off-by: Anand Kumar Shaw <anandkrshawheritage@gmail.com>
Link: https://lore.kernel.org/r/20260218042924.42931-1-anandkrshawheritage@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Anand Kumar Shaw and committed by
Alexei Starovoitov
39948c2d 2ca7f635

+4 -1
+4 -1
kernel/bpf/cpumap.c
··· 223 223 } 224 224 break; 225 225 default: 226 - bpf_warn_invalid_xdp_action(NULL, rcpu->prog, act); 226 + bpf_warn_invalid_xdp_action(xdpf->dev_rx, rcpu->prog, act); 227 + fallthrough; 228 + case XDP_ABORTED: 229 + trace_xdp_exception(xdpf->dev_rx, rcpu->prog, act); 227 230 fallthrough; 228 231 case XDP_DROP: 229 232 xdp_return_frame(xdpf);