aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorGal Pressman <galp@mellanox.com>2017-01-11 07:32:26 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-14 18:25:38 -0500
commite68f0dbb6bb0f0487a8ae2a117ae1950b6656f1a (patch)
tree76d38474f28a748d9f4aa20e1a907216a8149cb7 /drivers/net/ethernet
parent1a1981ef15a5bb52c46ab109a63cf1d4ddaee992 (diff)
net/mlx5e: Modify TIRs hash only when it's needed
commit 1d3398facd08a7fd4202f269317a95668eb880b9 upstream. 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: bdfc028de1b3 ("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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 27ff401cec20..51c6a57ca873 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -991,6 +991,7 @@ static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
991{ 991{
992 struct mlx5e_priv *priv = netdev_priv(dev); 992 struct mlx5e_priv *priv = netdev_priv(dev);
993 int inlen = MLX5_ST_SZ_BYTES(modify_tir_in); 993 int inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
994 bool hash_changed = false;
994 void *in; 995 void *in;
995 996
996 if ((hfunc != ETH_RSS_HASH_NO_CHANGE) && 997 if ((hfunc != ETH_RSS_HASH_NO_CHANGE) &&
@@ -1012,14 +1013,21 @@ static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
1012 mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, 0); 1013 mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, 0);
1013 } 1014 }
1014 1015
1015 if (key) 1016 if (hfunc != ETH_RSS_HASH_NO_CHANGE &&
1017 hfunc != priv->params.rss_hfunc) {
1018 priv->params.rss_hfunc = hfunc;
1019 hash_changed = true;
1020 }
1021
1022 if (key) {
1016 memcpy(priv->params.toeplitz_hash_key, key, 1023 memcpy(priv->params.toeplitz_hash_key, key,
1017 sizeof(priv->params.toeplitz_hash_key)); 1024 sizeof(priv->params.toeplitz_hash_key));
1025 hash_changed = hash_changed ||
1026 priv->params.rss_hfunc == ETH_RSS_HASH_TOP;
1027 }
1018 1028
1019 if (hfunc != ETH_RSS_HASH_NO_CHANGE) 1029 if (hash_changed)
1020 priv->params.rss_hfunc = hfunc; 1030 mlx5e_modify_tirs_hash(priv, in, inlen);
1021
1022 mlx5e_modify_tirs_hash(priv, in, inlen);
1023 1031
1024 mutex_unlock(&priv->state_lock); 1032 mutex_unlock(&priv->state_lock);
1025 1033