Skip to content

Commit 4b5e5b7

Browse files
alaahldavem330
authored andcommitted
net/mlx4_core: Get num_tc using netdev_get_num_tc
Avoid reading num_tc directly from struct net_device, but use the helper function netdev_get_num_tc. Fixes: bc6a474 ("net/mlx4_en: num cores tx rings for every UP") Fixes: f5b6345 ("net/mlx4_en: User prio mapping gets corrupted when changing number of channels") Signed-off-by: Alaa Hleihel <alaa@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ae5a2e2 commit 4b5e5b7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/net/ethernet/mellanox/mlx4/en_ethtool.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
17881788
netif_set_real_num_tx_queues(dev, priv->tx_ring_num[TX]);
17891789
netif_set_real_num_rx_queues(dev, priv->rx_ring_num);
17901790

1791-
if (dev->num_tc)
1791+
if (netdev_get_num_tc(dev))
17921792
mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP);
17931793

17941794
en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num[TX]);

‎drivers/net/ethernet/mellanox/mlx4/en_tx.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb,
710710
u16 rings_p_up = priv->num_tx_rings_p_up;
711711
u8 up = 0;
712712

713-
if (dev->num_tc)
713+
if (netdev_get_num_tc(dev))
714714
return skb_tx_hash(dev, skb);
715715

716716
if (skb_vlan_tag_present(skb))

0 commit comments

Comments
 (0)