Skip to contentSkip to conversation

Patch "net/mlx5e: Fix update of hash function/key via ethtool" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Feb 15, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net/mlx5e: Fix update of hash function/key via ethtool

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-mlx5e-fix-update-of-hash-function-key-via-ethtool.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Tue Feb 14 17:03:08 PST 2017

From: Gal Pressman <[email protected]>
Date: Thu, 12 Jan 2017 16:25:46 +0200
Subject: net/mlx5e: Fix update of hash function/key via ethtool

From: Gal Pressman <[email protected]>

[ Upstream commit a100ff3eef193d2d79daf98dcd97a54776ffeb78 ]

Modifying TIR hash should change selected fields bitmask in addition to the function and key.

Formerly, Only on ethool mlx5e_set_rxfh "ethtoo -X" we would not set this field resulting in zeroing of its value, which means no packet fields are used for RX RSS hash calculation thus causing all traffic to arrive in RQ[0].

On driver load out of the box we don't have this issue, since the TIR hash is fully created from scratch.

Tested:
ethtool -X ethX hkey <new key>
ethtool -X ethX hfunc <new func>
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")
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h         |    3 
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |   13 -
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c    |  198 +++++++++----------
 3 files changed, 109 insertions(+), 105 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +2 -1
@@ -765,7 +765,8 @@ void mlx5e_disable_vlan_filter(struct ml
 int mlx5e_modify_rqs_vsd(struct mlx5e_priv *priv, bool vsd);
 
 int mlx5e_redirect_rqt(struct mlx5e_priv *priv, u32 rqtn, int sz, int ix);
-void mlx5e_build_tir_ctx_hash(void *tirc, struct mlx5e_priv *priv);
+void mlx5e_build_indir_tir_ctx_hash(struct mlx5e_priv *priv, void *tirc,
+				    enum mlx5e_traffic_types tt);
 
 int mlx5e_open_locked(struct net_device *netdev);
 int mlx5e_close_locked(struct net_device *netdev);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +8 -5
@@ -975,15 +975,18 @@ static int mlx5e_get_rxfh(struct net_dev
 
 static void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen)
 {
-	struct mlx5_core_dev *mdev = priv->mdev;
 	void *tirc = MLX5_ADDR_OF(modify_tir_in, in, ctx);
-	int i;
+	struct mlx5_core_dev *mdev = priv->mdev;
+	int ctxlen = MLX5_ST_SZ_BYTES(tirc);
+	int tt;
 
 	MLX5_SET(modify_tir_in, in, bitmask.hash, 1);
-	mlx5e_build_tir_ctx_hash(tirc, priv);
 
-	for (i = 0; i < MLX5E_NUM_INDIR_TIRS; i++)
-		mlx5_core_modify_tir(mdev, priv->indir_tir[i].tirn, in, inlen);
+	for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
+		memset(tirc, 0, ctxlen);
+		mlx5e_build_indir_tir_ctx_hash(priv, tirc, tt);
+		mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in, inlen);
+	}
 }
 
 static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +99 -99

223 lines not on this page · raw message

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/net-mlx5e-fix-update-of-hash-function-key-via-ethtool.patch