Skip to content

Commit 67637b2

Browse files
anandheritageKernel Patches Daemon
authored andcommitted
bpf: cpumap: add missing XDP_ABORTED handling in xdp prog runner
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>
1 parent 44a817a commit 67637b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/bpf/cpumap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
221221
}
222222
break;
223223
default:
224-
bpf_warn_invalid_xdp_action(NULL, rcpu->prog, act);
224+
bpf_warn_invalid_xdp_action(xdpf->dev_rx, rcpu->prog, act);
225+
fallthrough;
226+
case XDP_ABORTED:
227+
trace_xdp_exception(xdpf->dev_rx, rcpu->prog, act);
225228
fallthrough;
226229
case XDP_DROP:
227230
xdp_return_frame(xdpf);

0 commit comments

Comments
 (0)