public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Anand Kumar Shaw <anandkrshawheritage@gmail.com>
To: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	hawk@kernel.org, john.fastabend@gmail.com, kuba@kernel.org,
	davem@davemloft.net, sdf@fomichev.me, andrii@kernel.org,
	martin.lau@linux.dev,
	Anand Kumar Shaw <anandkrshawheritage@gmail.com>
Subject: [PATCH] bpf: cpumap: add missing XDP_ABORTED handling in xdp prog runner
Date: Mon, 16 Feb 2026 20:36:01 +0530	[thread overview]
Message-ID: <20260216150601.9454-1-anandkrshawheritage@gmail.com> (raw)

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)


             reply	other threads:[~2026-02-16 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 15:06 Anand Kumar Shaw [this message]
2026-02-17 22:37 ` [PATCH] bpf: cpumap: add missing XDP_ABORTED handling in xdp prog runner Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2026-02-18  4:16 Anand Kumar Shaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260216150601.9454-1-anandkrshawheritage@gmail.com \
    --to=anandkrshawheritage@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox