Skip to content

Commit ee35724

Browse files
cjubrankuba-moo
authored andcommitted
net/mlx5e: RSS, Block changing channels number when RXFH is configured
Changing the channels number after configuring the receive flow hash indirection table may affect the RSS table size. The previous configuration may no longer be compatible with the new receive flow hash indirection table. Block changing the channels number when RXFH is configured and changing the channels number requires resizing the RSS table size. Fixes: 74a8dad ("net/mlx5e: Preparations for supporting larger number of channels") Signed-off-by: Carolina Jubran <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9eca93f commit ee35724

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,23 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
451451

452452
mutex_lock(&priv->state_lock);
453453

454+
/* If RXFH is configured, changing the channels number is allowed only if
455+
* it does not require resizing the RSS table. This is because the previous
456+
* configuration may no longer be compatible with the new RSS table.
457+
*/
458+
if (netif_is_rxfh_configured(priv->netdev)) {
459+
int cur_rqt_size = mlx5e_rqt_size(priv->mdev, cur_params->num_channels);
460+
int new_rqt_size = mlx5e_rqt_size(priv->mdev, count);
461+
462+
if (new_rqt_size != cur_rqt_size) {
463+
err = -EINVAL;
464+
netdev_err(priv->netdev,
465+
"%s: RXFH is configured, block changing channels number that affects RSS table size (new: %d, current: %d)\n",
466+
__func__, new_rqt_size, cur_rqt_size);
467+
goto out;
468+
}
469+
}
470+
454471
/* Don't allow changing the number of channels if HTB offload is active,
455472
* because the numeration of the QoS SQs will change, while per-queue
456473
* qdiscs are attached.

0 commit comments

Comments
 (0)