Skip to content

Commit 6c685bd

Browse files
Binary-Eaterkuba-moo
authored andcommitted
net/mlx5e: Use channel mdev reference instead of global mdev instance for coalescing
Channels can potentially have independent mdev instances. Do not refer to the global mdev instance in the mlx5e_priv instance for channel FW operations related to coalescing. CQ numbers that would be valid on the channel's mdev instance may not be correctly referenced if using the mlx5e_priv instance. Fixes: 67936e1 ("net/mlx5e: Let channels be SD-aware") Signed-off-by: Rahul Rameshbabu <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bf72998 commit 6c685bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,12 @@ static int mlx5e_get_coalesce(struct net_device *netdev,
589589
static void
590590
mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
591591
{
592-
struct mlx5_core_dev *mdev = priv->mdev;
593592
int tc;
594593
int i;
595594

596595
for (i = 0; i < priv->channels.num; ++i) {
597596
struct mlx5e_channel *c = priv->channels.c[i];
597+
struct mlx5_core_dev *mdev = c->mdev;
598598

599599
for (tc = 0; tc < c->num_tc; tc++) {
600600
mlx5_core_modify_cq_moderation(mdev,
@@ -608,11 +608,11 @@ mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coal
608608
static void
609609
mlx5e_set_priv_channels_rx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
610610
{
611-
struct mlx5_core_dev *mdev = priv->mdev;
612611
int i;
613612

614613
for (i = 0; i < priv->channels.num; ++i) {
615614
struct mlx5e_channel *c = priv->channels.c[i];
615+
struct mlx5_core_dev *mdev = c->mdev;
616616

617617
mlx5_core_modify_cq_moderation(mdev, &c->rq.cq.mcq,
618618
coal->rx_coalesce_usecs,

0 commit comments

Comments
 (0)