netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <hawk@kernel.org>
To: Ujwal Kundur <ujwal.kundur@gmail.com>,
	ast@kernel.org, daniel@iogearbox.net, davem@davemloft.net,
	kuba@kernel.org, john.fastabend@gmail.com, andrii@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me,
	aoluo@google.com, jolsa@kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bpf: cpumap: report Rx queue index to xdp_rxq_info
Date: Tue, 10 Jun 2025 13:29:52 +0200	[thread overview]
Message-ID: <2d7c6d00-692b-442c-931f-ace85f8b1477@kernel.org> (raw)
In-Reply-To: <20250609173851.778-1-ujwal.kundur@gmail.com>



On 09/06/2025 19.38, Ujwal Kundur wrote:
> 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);

This looks wrong...
I think this will always return index 0

--Jesper

  reply	other threads:[~2025-06-10 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=2d7c6d00-692b-442c-931f-ace85f8b1477@kernel.org \
    --to=hawk@kernel.org \
    --cc=andrii@kernel.org \
    --cc=aoluo@google.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --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=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=ujwal.kundur@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).