Message ID | 20240220032948.35305-3-saeed@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,01/10] Revert "net/mlx5: Block entering switchdev mode with ns inconsistency" | expand |
On Mon, 19 Feb 2024 19:29:46 -0800 Saeed Mahameed wrote: > + /* Changing the channels number can affect the size of the RXFH indir table. > + * Therefore, if the RXFH was previously configured, > + * unconfigure it to ensure that the RXFH is reverted to a uniform table. > + */ > + rxfh_configured = netif_is_rxfh_configured(priv->netdev); > + if (rxfh_configured) > + priv->netdev->priv_flags &= ~IFF_RXFH_CONFIGURED; The sole purpose of this flag is to prevent drivers from resetting configuration set by the user. The user can: ethtool -X $ifc default if they no longer care.
On 21/02/2024 4:46, Jakub Kicinski wrote: > On Mon, 19 Feb 2024 19:29:46 -0800 Saeed Mahameed wrote: >> + /* Changing the channels number can affect the size of the RXFH indir table. >> + * Therefore, if the RXFH was previously configured, >> + * unconfigure it to ensure that the RXFH is reverted to a uniform table. >> + */ >> + rxfh_configured = netif_is_rxfh_configured(priv->netdev); >> + if (rxfh_configured) >> + priv->netdev->priv_flags &= ~IFF_RXFH_CONFIGURED; > > The sole purpose of this flag is to prevent drivers from resetting > configuration set by the user. The user can: > > ethtool -X $ifc default > > if they no longer care. > Thanks Jakub, somehow I missed this ethtool option. We will definitely send a modified solution.
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index cc51ce16df14..ae459570c9ef 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -435,6 +435,7 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv, struct mlx5e_params *cur_params = &priv->channels.params; unsigned int count = ch->combined_count; struct mlx5e_params new_params; + bool rxfh_configured; bool arfs_enabled; int rss_cnt; bool opened; @@ -492,10 +493,25 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv, if (arfs_enabled) mlx5e_arfs_disable(priv->fs); + /* Changing the channels number can affect the size of the RXFH indir table. + * Therefore, if the RXFH was previously configured, + * unconfigure it to ensure that the RXFH is reverted to a uniform table. + */ + rxfh_configured = netif_is_rxfh_configured(priv->netdev); + if (rxfh_configured) + priv->netdev->priv_flags &= ~IFF_RXFH_CONFIGURED; + /* Switch to new channels, set new parameters and close old ones */ err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_num_channels_changed_ctx, NULL, true); - + if (rxfh_configured) { + /* Revert the RXFH configured */ + if (err) + priv->netdev->priv_flags |= IFF_RXFH_CONFIGURED; + else + netdev_warn(priv->netdev, "%s: RXFH table entries reverting to default\n", + __func__); + } if (arfs_enabled) { int err2 = mlx5e_arfs_enable(priv->fs);