]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ethtool: Add RSS indirection table resize helpers
authorBjörn Töpel <bjorn@kernel.org>
Fri, 20 Mar 2026 08:58:22 +0000 (09:58 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Mar 2026 00:59:54 +0000 (17:59 -0700)
commit02bcb20083b2780772cfb66cd426f31940296783
treef3314669962e081fd927a4bd0ece69dc793e9fef
parent0475f9e779b456f934adbc44eeb98e3080a1893f
ethtool: Add RSS indirection table resize helpers

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

Add driver helpers to resize indirection tables:

ethtool_rxfh_indir_can_resize() checks whether the default context
indirection table can be resized.

ethtool_rxfh_indir_resize() resizes the default context table in
place. Folding (shrink) requires the table to be periodic at the new
size; non-periodic tables are rejected. Unfolding (grow) replicates
the existing pattern. Sizes must be multiples of each other.

ethtool_rxfh_ctxs_can_resize() validates all non-default RSS contexts
can be resized.

ethtool_rxfh_ctxs_resize() applies the resize.

Signed-off-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20260320085826.1957255-3-bjorn@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/ethtool.h
net/ethtool/common.c