From: Jakub Sitnicki <jakub@cloudflare.com>
To: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, donald.hunter@gmail.com,
andrew+netdev@lunn.ch, ast@kernel.org, daniel@iogearbox.net,
hawk@kernel.org, john.fastabend@gmail.com, matttbe@kernel.org,
chuck.lever@oracle.com, jdamato@fastly.com,
skhawaja@google.com, dw@davidwei.uk, mkarsten@uwaterloo.ca,
yoong.siang.song@intel.com, david.hunter.linux@gmail.com,
skhan@linuxfoundation.org, horms@kernel.org, sdf@fomichev.me,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH RFC 0/4] Add XDP RX queue index metadata via kfuncs
Date: Thu, 25 Sep 2025 12:47:03 +0200 [thread overview]
Message-ID: <87y0q23j2w.fsf@cloudflare.com> (raw)
In-Reply-To: <e85e7bb2-6229-4b04-9c2a-7a7b79497c6c@gmail.com> (Mehdi Ben Hadj Khelifa's message of "Thu, 25 Sep 2025 12:28:07 +0100")
On Thu, Sep 25, 2025 at 12:28 PM +01, Mehdi Ben Hadj Khelifa wrote:
> On 9/25/25 11:18 AM, Jakub Sitnicki wrote:
>> On Thu, Sep 25, 2025 at 11:54 AM +01, Mehdi Ben Hadj Khelifa wrote:
>>> On 9/25/25 10:43 AM, Jakub Sitnicki wrote:
>>>> On Tue, Sep 23, 2025 at 10:00 PM +01, Mehdi Ben Hadj Khelifa wrote:
>>>>> This patch series is intended to make a base for setting
>>>>> queue_index in the xdp_rxq_info struct in bpf/cpumap.c to
>>>>> the right index. Although that part I still didn't figure
>>>>> out yet,I m searching for my guidance to do that as well
>>>>> as for the correctness of the patches in this series.
>>>> What is the use case/movtivation behind this work?
>>>
>>> The goal of the work is to have xdp programs have the correct packet RX queue
>>> index after being redirected through cpumap because currently the queue_index
>>> gets unset or more accurately set to 0 as a default in xdp_rxq_info. This is my
>>> current understanding.I still have to know how I can propogate that HW hint from
>>> the NICs to the function where I need it.
>> This explains what this series does, the desired end state of
>> information passing, but not why is does it - how that information is
>> going to be consumed? To what end?
>
> In my vision,The queue index propagated correctly through cpumap can help xdp
> programs use it for things such as per queue load balancing,Adaptive RSS tuning
> and even maybe for DDoS mitigation where they can drop traffic per queue.I mean
> if these aren't correct intents or if they don't justify the added code, I can
> abort working on it. Even if they weren't I need more guidance on how I can have
> that metadata from HW hints...
Both filtering or load balancing you'd want to do early on - in the XDP
program invoked on receive from NIC, which as Stanislav pointed out
already has access to the RX queue index in its context. Not on the
remote CPU after spending cycles on a redirect.
And even if you wanted to pass that information to the remote XDP
program, to do something with it, you can already store it in custom XDP
metadata [1].
So while perhaps there is something that you can't do today but would be
useful, I don't know what it is. Hence my question about the use case.
[1] https://docs.ebpf.io/linux/helper-function/bpf_xdp_adjust_meta/
next prev parent reply other threads:[~2025-09-25 10:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 21:00 [PATCH RFC 0/4] Add XDP RX queue index metadata via kfuncs Mehdi Ben Hadj Khelifa
2025-09-23 20:45 ` Stanislav Fomichev
2025-09-24 10:40 ` Mehdi Ben Hadj Khelifa
2025-09-24 22:31 ` Stanislav Fomichev
2025-09-25 9:57 ` Mehdi Ben Hadj Khelifa
2025-09-26 6:42 ` Lorenzo Bianconi
2025-09-23 21:00 ` [PATCH RFC 1/4] netlink: specs: Add XDP RX queue index to XDP metadata Mehdi Ben Hadj Khelifa
2025-09-23 21:00 ` [PATCH RFC 2/4] net: xdp: Add xmo_rx_queue_index callback Mehdi Ben Hadj Khelifa
2025-09-23 21:00 ` [PATCH RFC 3/4] uapi: netdev: Add XDP RX queue index metadata flags Mehdi Ben Hadj Khelifa
2025-09-23 21:00 ` [PATCH RFC 4/4] net: veth: Implement RX queue index XDP hint Mehdi Ben Hadj Khelifa
2025-09-25 9:43 ` [PATCH RFC 0/4] Add XDP RX queue index metadata via kfuncs Jakub Sitnicki
2025-09-25 10:54 ` Mehdi Ben Hadj Khelifa
2025-09-25 10:18 ` Jakub Sitnicki
2025-09-25 11:28 ` Mehdi Ben Hadj Khelifa
2025-09-25 10:47 ` Jakub Sitnicki [this message]
2025-09-25 12:03 ` Mehdi Ben Hadj Khelifa
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=87y0q23j2w.fsf@cloudflare.com \
--to=jakub@cloudflare.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chuck.lever@oracle.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=david.hunter.linux@gmail.com \
--cc=donald.hunter@gmail.com \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=jdamato@fastly.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matttbe@kernel.org \
--cc=mehdi.benhadjkhelifa@gmail.com \
--cc=mkarsten@uwaterloo.ca \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=skhan@linuxfoundation.org \
--cc=skhawaja@google.com \
--cc=yoong.siang.song@intel.com \
/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