public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf: cpumap: add missing XDP_ABORTED handling in xdp prog runner
@ 2026-02-16 15:06 Anand Kumar Shaw
  2026-02-17 22:37 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Kumar Shaw @ 2026-02-16 15:06 UTC (permalink / raw)
  To: bpf
  Cc: netdev, ast, daniel, hawk, john.fastabend, kuba, davem, sdf,
	andrii, martin.lau, Anand Kumar Shaw

cpu_map_bpf_prog_run_xdp() does not handle XDP_ABORTED, causing it
to fall through to the default case which calls
bpf_warn_invalid_xdp_action(). XDP_ABORTED is a valid action that
signals an exception in the BPF program — it should fire
trace_xdp_exception() and drop the frame without a spurious warning.

The SKB path in the same file (cpu_map_bpf_prog_run_skb) and devmap's
dev_map_bpf_prog_run() both handle XDP_ABORTED correctly. Add the
missing case to match.

Signed-off-by: Anand Kumar Shaw <anandkrshawheritage@gmail.com>
---
 kernel/bpf/cpumap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index 04171fbc3..b1fe83eeb 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -223,6 +223,9 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
 		default:
 			bpf_warn_invalid_xdp_action(NULL, rcpu->prog, act);
 			fallthrough;
+		case XDP_ABORTED:
+			trace_xdp_exception(xdpf->dev_rx, rcpu->prog, act);
+			fallthrough;
 		case XDP_DROP:
 			xdp_return_frame(xdpf);
 			stats->drop++;
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [PATCH] bpf: cpumap: add missing XDP_ABORTED handling in xdp prog runner
@ 2026-02-18  4:16 Anand Kumar Shaw
  0 siblings, 0 replies; 3+ messages in thread
From: Anand Kumar Shaw @ 2026-02-18  4:16 UTC (permalink / raw)
  To: kuba, bpf, netdev
  Cc: ast, hawk, john.fastabend, davem, sdf, daniel, andrii, martin.lau

On Mon, Feb 16, 2026 Jakub Kicinski <kuba@kernel.org> wrote:
> Why are you populating netdev with xdpf->dev_rx when the
> bpf_warn_invalid_xdp_action() above did not? Either both or neither should?

Good catch -- the NULL is a pre-existing inconsistency.
Will fix it to use xdpf->dev_rx in v2.

Thanks,
Anand

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-18  4:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 15:06 [PATCH] bpf: cpumap: add missing XDP_ABORTED handling in xdp prog runner Anand Kumar Shaw
2026-02-17 22:37 ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2026-02-18  4:16 Anand Kumar Shaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox