Skip to content

Commit a833538

Browse files
gal-pressmankuba-moo
authored andcommitted
net/mlx5e: Use extack in set rxfh callback
The ->set/create/modify_rxfh() callbacks now pass a valid extack instead of NULL through netlink [1]. In case of an error, reflect it through extack instead of a dmesg print. [1] commit c0ae035 ("ethtool: rss: initial RSS_SET (indirection table handling)") Signed-off-by: Gal Pressman <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c40a94c commit a833538

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,8 @@ static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *
14941494
}
14951495

14961496
static int mlx5e_rxfh_hfunc_check(struct mlx5e_priv *priv,
1497-
const struct ethtool_rxfh_param *rxfh)
1497+
const struct ethtool_rxfh_param *rxfh,
1498+
struct netlink_ext_ack *extack)
14981499
{
14991500
unsigned int count;
15001501

@@ -1504,8 +1505,10 @@ static int mlx5e_rxfh_hfunc_check(struct mlx5e_priv *priv,
15041505
unsigned int xor8_max_channels = mlx5e_rqt_max_num_channels_allowed_for_xor8();
15051506

15061507
if (count > xor8_max_channels) {
1507-
netdev_err(priv->netdev, "%s: Cannot set RSS hash function to XOR, current number of channels (%d) exceeds the maximum allowed for XOR8 RSS hfunc (%d)\n",
1508-
__func__, count, xor8_max_channels);
1508+
NL_SET_ERR_MSG_FMT_MOD(
1509+
extack,
1510+
"Number of channels (%u) exceeds the max for XOR8 RSS (%u)",
1511+
count, xor8_max_channels);
15091512
return -EINVAL;
15101513
}
15111514
}
@@ -1524,7 +1527,7 @@ static int mlx5e_set_rxfh(struct net_device *dev,
15241527

15251528
mutex_lock(&priv->state_lock);
15261529

1527-
err = mlx5e_rxfh_hfunc_check(priv, rxfh);
1530+
err = mlx5e_rxfh_hfunc_check(priv, rxfh, extack);
15281531
if (err)
15291532
goto unlock;
15301533

@@ -1550,7 +1553,7 @@ static int mlx5e_create_rxfh_context(struct net_device *dev,
15501553

15511554
mutex_lock(&priv->state_lock);
15521555

1553-
err = mlx5e_rxfh_hfunc_check(priv, rxfh);
1556+
err = mlx5e_rxfh_hfunc_check(priv, rxfh, extack);
15541557
if (err)
15551558
goto unlock;
15561559

@@ -1590,7 +1593,7 @@ static int mlx5e_modify_rxfh_context(struct net_device *dev,
15901593

15911594
mutex_lock(&priv->state_lock);
15921595

1593-
err = mlx5e_rxfh_hfunc_check(priv, rxfh);
1596+
err = mlx5e_rxfh_hfunc_check(priv, rxfh, extack);
15941597
if (err)
15951598
goto unlock;
15961599

0 commit comments

Comments
 (0)