]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5e: advertise max RSS indirection table size to ethtool
authorYael Chemla <ychemla@nvidia.com>
Mon, 11 May 2026 17:27:16 +0000 (20:27 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 May 2026 02:10:23 +0000 (19:10 -0700)
Set rxfh_indir_space to the maximum indirection table size the driver
can support: the next power of two above MLX5E_MAX_NUM_CHANNELS times
MLX5E_UNIFORM_SPREAD_RQT_FACTOR.

Without this, ethtool_rxfh_ctxs_can_resize() returns -EINVAL, blocking
non-default RSS contexts from tracking indirection table size changes
when the channel count changes.

Signed-off-by: Yael Chemla <ychemla@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260511172719.330490-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/rqt.c
drivers/net/ethernet/mellanox/mlx5/core/en/rqt.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

index bcafb4bf94154ff01969fc851852d4234f5b0c04..a3382f6a6b74c893923475132d153cb5f966974d 100644 (file)
@@ -168,8 +168,6 @@ out:
        return err;
 }
 
-#define MLX5E_UNIFORM_SPREAD_RQT_FACTOR 2
-
 u32 mlx5e_rqt_size(struct mlx5_core_dev *mdev, unsigned int num_channels)
 {
        u32 rqt_size = max_t(u32, MLX5E_INDIR_MIN_RQT_SIZE,
index e0bc30308c77000038d151a7caa206c516a6fe9a..680700e7437f0dea92a53b57fc1daf787d0e1fd0 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/kernel.h>
 
 #define MLX5E_INDIR_MIN_RQT_SIZE (BIT(8))
+#define MLX5E_UNIFORM_SPREAD_RQT_FACTOR 2
 
 struct mlx5_core_dev;
 
index a6da0219723c4f4f24f2c3faf7ef69bcc3f1f8ec..c483008e33e9d0b3a9e0ac31cc9add26c9c3336c 100644 (file)
 
 #define LANES_UNKNOWN           0
 
+#define MLX5E_MAX_INDIR_RQT_SIZE \
+       roundup_pow_of_two(MLX5E_MAX_NUM_CHANNELS * \
+                          MLX5E_UNIFORM_SPREAD_RQT_FACTOR)
+
 void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
                               struct ethtool_drvinfo *drvinfo)
 {
@@ -2692,6 +2696,7 @@ const struct ethtool_ops mlx5e_ethtool_ops = {
        .supported_input_xfrm = RXH_XFRM_SYM_OR_XOR,
        .supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT |
                                 ETHTOOL_RING_USE_HDS_THRS,
+       .rxfh_indir_space = MLX5E_MAX_INDIR_RQT_SIZE,
        .get_drvinfo       = mlx5e_get_drvinfo,
        .get_link          = ethtool_op_get_link,
        .get_link_ext_state  = mlx5e_get_link_ext_state,