public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Anand Kumar Shaw <anandkrshawheritage@gmail.com>
To: bpf@vger.kernel.org, netdev@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
	john.fastabend@gmail.com, davem@davemloft.net, kuba@kernel.org,
	sdf@fomichev.me, edumazet@google.com, pabeni@redhat.com,
	horms@kernel.org, andrii@kernel.org, martin.lau@linux.dev,
	eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev,
	kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org,
	linux-kernel@vger.kernel.org,
	Anand Kumar Shaw <anandkrshawheritage@gmail.com>
Subject: [PATCH 0/2] xdp: propagate rx queue_index through xdp_frame
Date: Tue, 17 Feb 2026 20:02:40 +0530	[thread overview]
Message-ID: <20260217143242.4404-1-anandkrshawheritage@gmail.com> (raw)

When an XDP frame is redirected via cpumap or devmap, the original RX
queue index is lost. BPF programs running on the second-stage
(SEC("xdp/cpumap") or SEC("xdp/devmap")) always see ctx->rx_queue_index
as 0, and SKBs built from xdp_frame lack proper RX queue metadata.

This series adds a queue_index field to struct xdp_frame, populates it
during the xdp_buff to xdp_frame conversion (both normal and zero-copy
paths), and consumes it in cpumap and devmap when reconstructing
xdp_rxq_info. It also calls skb_record_rx_queue() in
__xdp_build_skb_from_frame(), resolving a documented gap.

Patch 1 adds the field and populates it in the conversion paths.
Patch 2 sets rxq.queue_index in cpumap and devmap, resolving a TODO
left since the original cpumap implementation.

struct xdp_frame grows by 4 bytes (40 -> 44 bytes), still within a
single 64-byte cacheline.

Anand Kumar Shaw (2):
  xdp: propagate queue_index through xdp_frame
  bpf: report queue_index to xdp_rxq_info in cpumap and devmap

 include/net/xdp.h   | 2 ++
 kernel/bpf/cpumap.c | 2 +-
 kernel/bpf/devmap.c | 1 +
 net/core/xdp.c      | 3 ++-
 4 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.39.5 (Apple Git-154)


                 reply	other threads:[~2026-02-17 14:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260217143242.4404-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=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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