From: Jakub Kicinski <kuba@kernel.org>
To: daniel.zahka@gmail.com, willemdebruijn.kernel@gmail.com
Cc: edumazet@google.com, cratiu@nvidia.com, borisp@nvidia.com,
kuniyu@google.com, netdev@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>
Subject: [RFC net-next 0/6] psp: use virt cookie as Rx steering hint
Date: Sat, 22 Aug 2026 15:55:18 -0700 [thread overview]
Message-ID: <20260822225524.2328465-1-kuba@kernel.org> (raw)
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.
This patch set implements exactly that using the optional PSP
Virtualization Cookie field. The PSP standard doesn't have much
to say about this field:
Virtualization Cookie - 64b
An optional field, present if and only if V is set.
It may contain a Virtual Network Identifier (VNI) or other data,
as defined by the implementation.
IOW it's a field in the header which can be used as VNI, so presumably
most PSP-capable NICs will be able to feed it into some TCAM lookup.
The main use of this field is when PSP is used for tunneling.
Nothing in the standard precludes it's use in transport mode.
This patchset splits this field as follows:
63 48 47 32 31 16 15 0
+---------------+---------------+---------------+---------------+
| reserved | req qid | reserved | dst qid |
+---------------+---------------+---------------+---------------+
"req" is the value we want sender to put in "dst" when they respond.
When the feature is enabled we expect the NIC to create low-priority
steering rules matching on "dst" (bottom 16b of the Virt Cookie).
The mapping is direct today so dst=2 means queue=2 within the receiving
interface (see doc in patch 1 for more info). Any explicit steering
rules (ethtool, TC etc) still take precedence over PSP steering,
we are only overriding the RSS queue assignment.
I'm sharing this as an RFC because I _think_ it's a good idea
(feedback most welcome). We need some vendor cooperation to get this
implemented - specifically IDK how to make mlx5 (the only PSP-capable
NIC I have access to) to do the steering :(
Jakub Kicinski (6):
psp: steer Rx queues with the virtualization cookie
netdevsim: support PSP VC based queue steering
selftests: drv-net: psp: move the PSP test plumbing into psp_lib.py
selftests: drv-net: psp_steer: test PSP VC based queue steering
selftests: drv-net: psp_steer: test where PSP steering sits in the Rx
pipeline
selftests: drv-net: psp_steer: cover corner cases and races
MAINTAINERS | 1 +
Documentation/netlink/specs/psp.yaml | 42 ++
Documentation/networking/psp.rst | 75 +++
tools/testing/selftests/drivers/net/Makefile | 5 +
include/net/psp/types.h | 93 +++-
drivers/net/netdevsim/netdevsim.h | 4 +-
include/net/psp/functions.h | 54 +-
include/uapi/linux/psp.h | 17 +
.../mellanox/mlx5/core/en_accel/psp_rxtx.c | 2 +-
drivers/net/netdevsim/netdev.c | 5 +-
drivers/net/netdevsim/psp.c | 26 +-
net/psp/psp-nl-gen.c | 5 +-
net/psp/psp_main.c | 53 +-
net/psp/psp_nl.c | 21 +-
net/psp/psp_sock.c | 35 ++
.../selftests/drivers/net/psp_responder.c | 42 ++
tools/testing/selftests/drivers/net/psp.py | 287 +++--------
.../testing/selftests/drivers/net/psp_lib.py | 184 +++++++
.../selftests/drivers/net/psp_steer.py | 473 ++++++++++++++++++
19 files changed, 1187 insertions(+), 237 deletions(-)
create mode 100644 tools/testing/selftests/drivers/net/psp_lib.py
create mode 100644 tools/testing/selftests/drivers/net/psp_steer.py
--
2.55.0
next reply other threads:[~2026-08-22 22:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 22:55 Jakub Kicinski [this message]
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
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=20260822225524.2328465-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=borisp@nvidia.com \
--cc=cratiu@nvidia.com \
--cc=daniel.zahka@gmail.com \
--cc=edumazet@google.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.