public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xdp: propagate rx queue_index through xdp_frame
@ 2026-02-17 14:32 Anand Kumar Shaw
  0 siblings, 0 replies; only message in thread
From: Anand Kumar Shaw @ 2026-02-17 14:32 UTC (permalink / raw)
  To: bpf, netdev
  Cc: ast, daniel, hawk, john.fastabend, davem, kuba, sdf, edumazet,
	pabeni, horms, andrii, martin.lau, eddyz87, song, yonghong.song,
	kpsingh, haoluo, jolsa, linux-kernel, Anand Kumar Shaw

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-17 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 14:32 [PATCH 0/2] xdp: propagate rx queue_index through xdp_frame 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