netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bpf: cpumap: report Rx queue index to xdp_rxq_info
@ 2025-06-09 17:38 Ujwal Kundur
  2025-06-10 11:29 ` Jesper Dangaard Brouer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ujwal Kundur @ 2025-06-09 17:38 UTC (permalink / raw)
  To: ast, daniel, davem, kuba, hawk, john.fastabend, andrii,
	martin.lau, eddyz87, song, yonghong.song, kpsingh, sdf, aoluo,
	jolsa
  Cc: netdev, bpf, linux-kernel, Ujwal Kundur

Refer to the Rx queue using a XDP frame's attached netdev and ascertain
the queue index from it.

Signed-off-by: Ujwal Kundur <ujwal.kundur@gmail.com>
---
 kernel/bpf/cpumap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index 67e8a2fc1a99..8230292deac1 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -34,6 +34,7 @@
 #include <linux/btf_ids.h>
 
 #include <linux/netdevice.h>
+#include <net/netdev_rx_queue.h>
 #include <net/gro.h>
 
 /* General idea: XDP packets getting XDP redirected to another CPU,
@@ -196,7 +197,7 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
 
 		rxq.dev = xdpf->dev_rx;
 		rxq.mem.type = xdpf->mem_type;
-		/* TODO: report queue_index to xdp_rxq_info */
+		rxq.queue_index = get_netdev_rx_queue_index(xdpf->dev_rx->_rx);
 
 		xdp_convert_frame_to_buff(xdpf, &xdp);
 
-- 
2.20.1


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

end of thread, other threads:[~2025-06-10 20:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-09 17:38 [PATCH] bpf: cpumap: report Rx queue index to xdp_rxq_info Ujwal Kundur
2025-06-10 11:29 ` Jesper Dangaard Brouer
2025-06-10 12:01 ` Toke Høiland-Jørgensen
2025-06-10 13:15 ` Alexander Lobakin
2025-06-10 14:02   ` Ujwal Kundur
2025-06-10 20:24     ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).