All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] ethtool: Dynamic RSS context indirection table resizing
@ 2026-03-03 18:15 Björn Töpel
  2026-03-03 18:15 ` [PATCH net-next 1/5] ethtool: Add RSS indirection table resize helpers Björn Töpel
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Björn Töpel @ 2026-03-03 18:15 UTC (permalink / raw)
  To: Michael Chan, Pavan Chebbi, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
	linux-kernel, netdev, linux-kselftest
  Cc: Björn Töpel, Willem de Bruijn

Hi!

Some NICs (e.g. bnxt) change their RSS indirection table size based on
the queue count, because the hardware table is a shared resource. The
ethtool core locks ctx->indir_size at context creation, so drivers
have to reject channel changes when RSS contexts exist.

This series adds resize helpers and wires them up in bnxt and
netdevsim.

Patch 1 adds three core helpers:
  ethtool_rxfh_indir_can_resize() - read-only validation
  ethtool_rxfh_indir_resize() - fold/unfold a raw table in place
  ethtool_rxfh_contexts_resize_all() - resize all non-default
    contexts (all-or-none), with locking and RSS_NTF notifications

Patch 2 uses them in bnxt_set_channels(), replacing the -EINVAL
rejection. Context 0 is validated first, then non-default contexts are
resized, then context 0 is mutated.

Patch 3 adds RSS context support to netdevsim with dynamic table
sizing (roundup_pow_of_two(channels) * 16), exercising the full resize
path.

Patches 4-5 add tests:
  ethtool-rss.sh - netdevsim-specific bash test
  rss_drv.py - Python test that runs on any device with dynamic
    table sizing (skips otherwise)

Running the tests:

  # netdevsim bash test (requires root, netdevsim module)
  cd tools/testing/selftests/drivers/net/netdevsim
  sudo ./ethtool-rss.sh

  # Python test on netdevsim
  cd tools/testing/selftests/drivers/net/hw
  sudo ./rss_drv.py

  # Python test on real hardware
  sudo NETIF=eth0 ./rss_drv.py

Open items:

 - Pre-existing bug in bnxt: the IFF_RXFH_CONFIGURED guard in
   bnxt_set_channels() only protects context 0. If context 0 uses
   defaults but non-default contexts exist, channel changes that
   change the table size succeed without updating ctx->indir_size for
   those contexts. The core's ethtool_check_max_channel() prevents
   invalid queue references but not the size mismatch itself. This
   series fixes it by resizing all contexts. Should a separate fix be
   sent to net for the existing bug?

 - No user-controlled minimum table size yet. The plan is to record
   the user-provided indirection table length in the context (e.g.
   ctx->user_indir_size) and use it as a floor when folding: reject if
   new_size < user_indir_size. This way the user's original table size
   serves as an implicit minimum, preventing the driver from shrinking
   below what the user intended. Left for a follow-up.

 - rss_drv.py lives in drivers/net/hw/ but runs on netdevsim too now.
   Maybe move up a level?


Björn Töpel (5):
  ethtool: Add RSS indirection table resize helpers
  bnxt_en: Resize RSS contexts on channel count change
  netdevsim: Add RSS context support with dynamic table sizing
  selftests: netdevsim: Add RSS indirection table resize test
  selftests: rss_drv: Add RSS indirection table resize tests

 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  23 +++-
 drivers/net/netdevsim/ethtool.c               | 119 ++++++++++++++++-
 drivers/net/netdevsim/netdevsim.h             |   4 +
 include/linux/ethtool.h                       |   3 +
 net/ethtool/common.c                          | 126 ++++++++++++++++++
 .../selftests/drivers/net/hw/rss_drv.py       | 101 +++++++++++++-
 .../selftests/drivers/net/netdevsim/Makefile  |   1 +
 .../drivers/net/netdevsim/ethtool-rss.sh      | 123 +++++++++++++++++
 8 files changed, 488 insertions(+), 12 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/netdevsim/ethtool-rss.sh


base-commit: ed0abfe93fd135dac223e87a3c945017b1fa8bfc
-- 
2.53.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-03-04 17:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 18:15 [PATCH net-next 0/5] ethtool: Dynamic RSS context indirection table resizing Björn Töpel
2026-03-03 18:15 ` [PATCH net-next 1/5] ethtool: Add RSS indirection table resize helpers Björn Töpel
2026-03-04  0:03   ` Jakub Kicinski
2026-03-04 11:37     ` Björn Töpel
2026-03-04 17:09       ` Jakub Kicinski
2026-03-03 18:15 ` [PATCH net-next 2/5] bnxt_en: Resize RSS contexts on channel count change Björn Töpel
2026-03-03 19:20   ` Michael Chan
2026-03-04 11:38     ` Björn Töpel
2026-03-04  0:05   ` Jakub Kicinski
2026-03-04 11:39     ` Björn Töpel
2026-03-03 18:15 ` [PATCH net-next 3/5] netdevsim: Add RSS context support with dynamic table sizing Björn Töpel
2026-03-04  0:07   ` Jakub Kicinski
2026-03-04 11:40     ` Björn Töpel
2026-03-03 18:15 ` [PATCH net-next 4/5] selftests: netdevsim: Add RSS indirection table resize test Björn Töpel
2026-03-04  0:07   ` Jakub Kicinski
2026-03-03 18:15 ` [PATCH net-next 5/5] selftests: rss_drv: Add RSS indirection table resize tests Björn Töpel
2026-03-04  0:16   ` Jakub Kicinski
2026-03-04  8:23 ` [PATCH net-next 0/5] ethtool: Dynamic RSS context indirection table resizing Pavan Chebbi

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.