Skip to content

Commit 5f1572e

Browse files
ayalevin123Saeed Mahameed
authored andcommitted
net/mlx5e: Fix ethtool hfunc configuration change
Changing RX hash function requires rearranging of RQT internal indexes, the user isn't exposed to such changes and these changes do not affect the user configured indirection table. Rebuild RQ table on hfunc change. Fixes: bdfc028 ("net/mlx5e: Fix ethtool RX hash func configuration change") Signed-off-by: Aya Levin <ayal@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 36d45fb commit 5f1572e

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,8 @@ int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
11731173
struct mlx5e_priv *priv = netdev_priv(dev);
11741174
struct mlx5e_rss_params *rss = &priv->rss_params;
11751175
int inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
1176-
bool hash_changed = false;
1176+
bool refresh_tirs = false;
1177+
bool refresh_rqt = false;
11771178
void *in;
11781179

11791180
if ((hfunc != ETH_RSS_HASH_NO_CHANGE) &&
@@ -1189,36 +1190,38 @@ int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
11891190

11901191
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != rss->hfunc) {
11911192
rss->hfunc = hfunc;
1192-
hash_changed = true;
1193+
refresh_rqt = true;
1194+
refresh_tirs = true;
11931195
}
11941196

11951197
if (indir) {
11961198
memcpy(rss->indirection_rqt, indir,
11971199
sizeof(rss->indirection_rqt));
1198-
1199-
if (test_bit(MLX5E_STATE_OPENED, &priv->state)) {
1200-
u32 rqtn = priv->indir_rqt.rqtn;
1201-
struct mlx5e_redirect_rqt_param rrp = {
1202-
.is_rss = true,
1203-
{
1204-
.rss = {
1205-
.hfunc = rss->hfunc,
1206-
.channels = &priv->channels,
1207-
},
1208-
},
1209-
};
1210-
1211-
mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, rrp);
1212-
}
1200+
refresh_rqt = true;
12131201
}
12141202

12151203
if (key) {
12161204
memcpy(rss->toeplitz_hash_key, key,
12171205
sizeof(rss->toeplitz_hash_key));
1218-
hash_changed = hash_changed || rss->hfunc == ETH_RSS_HASH_TOP;
1206+
refresh_tirs = refresh_tirs || rss->hfunc == ETH_RSS_HASH_TOP;
1207+
}
1208+
1209+
if (refresh_rqt && test_bit(MLX5E_STATE_OPENED, &priv->state)) {
1210+
struct mlx5e_redirect_rqt_param rrp = {
1211+
.is_rss = true,
1212+
{
1213+
.rss = {
1214+
.hfunc = rss->hfunc,
1215+
.channels = &priv->channels,
1216+
},
1217+
},
1218+
};
1219+
u32 rqtn = priv->indir_rqt.rqtn;
1220+
1221+
mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, rrp);
12191222
}
12201223

1221-
if (hash_changed)
1224+
if (refresh_tirs)
12221225
mlx5e_modify_tirs_hash(priv, in);
12231226

12241227
mutex_unlock(&priv->state_lock);

0 commit comments

Comments
 (0)