Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org,  eric.dumazet@gmail.com,
	Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 0/5] net: ethtool: make netdev_rss_key_fill() spread flows over all queues
Date: Mon, 21 Sep 2026 18:37:53 +0000	[thread overview]
Message-ID: <20260921183758.1812310-1-edumazet@google.com> (raw)

netdev_rss_key_fill() hands drivers a uniformly random key. Because the
Toeplitz hash is linear over GF(2), a random key is singular for a given
header field and queue count with probability 1/2: flows differing only
in the low order bits of that field (such as a burst of consecutive
ephemeral ports) then cannot reach all RX queues. On one affected 16-queue
host, only 4 queues received traffic until the key was replaced.

Patch 1 synchronizes proc_do_rss_key() with netdev_rss_key_fill() using an
smp_wmb()/smp_rmb() pair and a boolean flag so readers of
/proc/sys/net/core/netdev_rss_key print zero bytes until the key is fully
populated.

Patch 2 keeps the key random but constrains 1008 of its 2048 bits so that,
at every 16-bit aligned position and for every power-of-two queue count up
to 256, consecutive values of a field ending there visit every queue once.
Applying the fixup on the 16-bit grid covers standard 2-tuple/4-tuple
hashes as well as encapsulated or bitmap-selected layouts (such as PSP
inner TCP ports at byte 78) without enumerating them in the core. The
fixup is a bijection onto the set of valid keys, and redraws in the ~1 in
5 case where two 32-bit windows a multiple of 8 bits apart alias.

Patch 3 adds a KUnit suite verifying full rank across standard and
encapsulated fields, the full 16-bit grid, window non-aliasing, and
end-to-end flow spreading.

Patches 4 and 5 add kselftests for keys on a running system: patch 4
checks /proc/sys/net/core/netdev_rss_key, and patch 5 checks the live RSS
key and indirection table reported by a device via ethtool.

Eric Dumazet (5):
  net: synchronize proc_do_rss_key() with netdev_rss_key_fill()
  net: ethtool: generate RSS keys that spread flows over all queues
  net: ethtool: add KUnit tests for the generated RSS key
  selftests: net: check the quality of the host RSS key
  selftests: drivers: net: check the RSS key a device uses

 Documentation/networking/scaling.rst          |   9 +
 net/Kconfig                                   |  14 +
 net/core/dev.h                                |   1 +
 net/core/sysctl_net_core.c                    |   7 +-
 net/ethtool/Makefile                          |   2 +
 net/ethtool/common.h                          |  11 +
 net/ethtool/ioctl.c                           | 170 +++++++++-
 net/ethtool/rss_key_test.c                    | 314 ++++++++++++++++++
 .../testing/selftests/drivers/net/hw/Makefile |   1 +
 .../drivers/net/hw/lib/py/__init__.py         |   5 +
 .../selftests/drivers/net/hw/rss_key.py       | 172 ++++++++++
 tools/testing/selftests/net/Makefile          |   1 +
 .../testing/selftests/net/lib/py/__init__.py  |   5 +
 tools/testing/selftests/net/lib/py/rsskey.py  | 108 ++++++
 tools/testing/selftests/net/netdev_rss_key.py | 117 +++++++
 15 files changed, 935 insertions(+), 2 deletions(-)
 create mode 100644 net/ethtool/rss_key_test.c
 create mode 100755 tools/testing/selftests/drivers/net/hw/rss_key.py
 create mode 100644 tools/testing/selftests/net/lib/py/rsskey.py
 create mode 100755 tools/testing/selftests/net/netdev_rss_key.py

-- 
2.55.0.1082.g2b9226bbc0-goog


             reply	other threads:[~2026-09-21 18:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 18:37 Eric Dumazet [this message]
2026-09-21 18:37 ` [PATCH net-next 1/5] net: synchronize proc_do_rss_key() with netdev_rss_key_fill() Eric Dumazet
2026-09-21 19:51   ` Jakub Kicinski
2026-09-21 19:53     ` Jakub Kicinski
2026-09-21 20:03     ` Eric Dumazet
2026-09-21 18:37 ` [PATCH net-next 2/5] net: ethtool: generate RSS keys that spread flows over all queues Eric Dumazet
2026-09-21 19:59   ` Jakub Kicinski
2026-09-21 18:37 ` [PATCH net-next 3/5] net: ethtool: add KUnit tests for the generated RSS key Eric Dumazet
2026-09-21 20:03   ` Jakub Kicinski
2026-09-21 20:10     ` Eric Dumazet
2026-09-21 20:35       ` Eric Dumazet
2026-09-21 18:37 ` [PATCH net-next 4/5] selftests: net: check the quality of the host " Eric Dumazet
2026-09-21 18:37 ` [PATCH net-next 5/5] selftests: drivers: net: check the RSS key a device uses Eric Dumazet
2026-09-21 20:09   ` Jakub Kicinski
2026-09-21 20:47     ` Eric Dumazet

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=20260921183758.1812310-1-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.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