From: Cosmin Ratiu <cratiu@nvidia.com>
To: "daniel.zahka@gmail.com" <daniel.zahka@gmail.com>,
"willemdebruijn.kernel@gmail.com"
<willemdebruijn.kernel@gmail.com>,
"kuba@kernel.org" <kuba@kernel.org>
Cc: "edumazet@google.com" <edumazet@google.com>,
Boris Pismenny <borisp@nvidia.com>,
"kuniyu@google.com" <kuniyu@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC net-next 0/6] psp: use virt cookie as Rx steering hint
Date: Mon, 24 Aug 2026 15:05:06 +0000 [thread overview]
Message-ID: <9d75871db36b1801eb381f5445c10fd29e2ad8a8.camel@nvidia.com> (raw)
In-Reply-To: <willemdebruijn.kernel.1157fb673940e@gmail.com>
On Sun, 2026-08-23 at 13:48 -0400, Willem de Bruijn wrote:
> Jakub Kicinski wrote:
> > Hi!
> >
> > This PoC series uses a field of the PSP header intended for tunnels
> > to auto-steer Rx traffic. Various attempts have been made at trying
> > to get Rx traffic to land close to the core where the application
> > runs.
> > By default RSS picks the Rx queue based on the flow hash.
> > I'm not going to cover all previous solutions in detail but broadly
> > - we have RFS in SW which looks on which CPU Tx happens and
> > backlogs
> > Rx packets there, it is quite efficient. aRFS is built on top
> > of RFS but tries to program flows into the NIC. Some NICs have
> > a "cache" and try to automatically remember the flow to queue
> > association.
> >
> > All those solutions are entirely local to the receiver.
> > Ideally we would want the solution to look something like
> > TCP timestamp option - we send an opaque cookie to the peer,
> > and the peer echoes it back to us. Our NIC can steer based
> > on that echoed cookie.
>
> Another option is to reverse RSS entropy. This requires knowledge of
> the RSS secret.
>
> Especially with PSP, the outer UDP source port is defined as flow
> hash, so can be used for this.
>
> Have the receiver compute a 4-tuple hash such that it knows the RSS
> block will select the intended queue. The only free variable here in
> general is the source port. Then communicate this preferred source
> port to the sender.
I was thinking of something along these lines as an alternative.
When initializing PSP for a connection, look at what the device uses
with .get_rxfh(), and find a value sport (either by linear algebra or
linear probing) such that the 4-tuple hash results in the desired
queue. This might require some non-trivial code changes to reimplement
the hashes in SW though, but it's local to this sport selection only.
psp_dev_encapsulate() and psp_write_headers() both conveniently already
have a sport argument, which is currently ignored, so plumbing this is
easy.
This would result in zero RX changes for driver implementors.
An easier alternative to avoid reverse engineering RSS hash
implementations would be to vary the desired sport across multiple
packets and until packets start coming to the desired queue. Presumably
this could converge to the desired queue in O(num_queues) TX packets +
acks. Maybe could be done with TCP keep alives at connection setup?
Cosmin.
next prev parent reply other threads:[~2026-08-24 15:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 22:55 [RFC net-next 0/6] psp: use virt cookie as Rx steering hint Jakub Kicinski
2026-08-22 22:55 ` [RFC net-next 1/6] psp: steer Rx queues with the virtualization cookie Jakub Kicinski
2026-08-23 15:31 ` Daniel Zahka
2026-08-24 15:01 ` Jakub Kicinski
2026-08-24 15:09 ` Cosmin Ratiu
2026-08-24 15:19 ` Jakub Kicinski
2026-08-23 18:18 ` Willem de Bruijn
2026-08-22 22:55 ` [RFC net-next 2/6] netdevsim: support PSP VC based queue steering Jakub Kicinski
2026-08-22 22:55 ` [RFC net-next 3/6] selftests: drv-net: psp: move the PSP test plumbing into psp_lib.py Jakub Kicinski
2026-08-22 22:55 ` [RFC net-next 4/6] selftests: drv-net: psp_steer: test PSP VC based queue steering Jakub Kicinski
2026-08-22 22:55 ` [RFC net-next 5/6] selftests: drv-net: psp_steer: test where PSP steering sits in the Rx pipeline Jakub Kicinski
2026-08-22 22:55 ` [RFC net-next 6/6] selftests: drv-net: psp_steer: cover corner cases and races Jakub Kicinski
2026-08-23 17:48 ` [RFC net-next 0/6] psp: use virt cookie as Rx steering hint Willem de Bruijn
2026-08-24 15:05 ` Cosmin Ratiu [this message]
2026-08-25 9:52 ` Cosmin Ratiu
2026-08-25 18:55 ` Jakub Kicinski
2026-08-24 15:11 ` Jakub Kicinski
2026-08-24 18:04 ` Willem de Bruijn
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=9d75871db36b1801eb381f5445c10fd29e2ad8a8.camel@nvidia.com \
--to=cratiu@nvidia.com \
--cc=borisp@nvidia.com \
--cc=daniel.zahka@gmail.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.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