mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
net/mlx5e: Modify TIRs hash only when it's needed
commit1d3398facdupstream. We don't need to modify our TIRs unless the user requested a change in the hash function/key, for example when changing indirection only. Tested: # Modify TIRs hash is needed ethtool -X ethX hkey <new key> ethtool -X ethX hfunc <new func> # Modify TIRs hash is not needed ethtool -X ethX equal <new indirection table> All cases are verified with TCP Multi-Stream traffic over IPv4 & IPv6. Fixes:bdfc028de1("net/mlx5e: Fix ethtool RX hash func configuration change") Signed-off-by: Gal Pressman <galp@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1a1981ef15
commit
e68f0dbb6b
@@ -991,6 +991,7 @@ static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
|
|||||||
{
|
{
|
||||||
struct mlx5e_priv *priv = netdev_priv(dev);
|
struct mlx5e_priv *priv = netdev_priv(dev);
|
||||||
int inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
|
int inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
|
||||||
|
bool hash_changed = false;
|
||||||
void *in;
|
void *in;
|
||||||
|
|
||||||
if ((hfunc != ETH_RSS_HASH_NO_CHANGE) &&
|
if ((hfunc != ETH_RSS_HASH_NO_CHANGE) &&
|
||||||
@@ -1012,14 +1013,21 @@ static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
|
|||||||
mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, 0);
|
mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key)
|
if (hfunc != ETH_RSS_HASH_NO_CHANGE &&
|
||||||
|
hfunc != priv->params.rss_hfunc) {
|
||||||
|
priv->params.rss_hfunc = hfunc;
|
||||||
|
hash_changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key) {
|
||||||
memcpy(priv->params.toeplitz_hash_key, key,
|
memcpy(priv->params.toeplitz_hash_key, key,
|
||||||
sizeof(priv->params.toeplitz_hash_key));
|
sizeof(priv->params.toeplitz_hash_key));
|
||||||
|
hash_changed = hash_changed ||
|
||||||
|
priv->params.rss_hfunc == ETH_RSS_HASH_TOP;
|
||||||
|
}
|
||||||
|
|
||||||
if (hfunc != ETH_RSS_HASH_NO_CHANGE)
|
if (hash_changed)
|
||||||
priv->params.rss_hfunc = hfunc;
|
mlx5e_modify_tirs_hash(priv, in, inlen);
|
||||||
|
|
||||||
mlx5e_modify_tirs_hash(priv, in, inlen);
|
|
||||||
|
|
||||||
mutex_unlock(&priv->state_lock);
|
mutex_unlock(&priv->state_lock);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user