Skip to content

Commit 646bb57

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Fix setting of TC configuration for macvlan case
When we were enabling macvlan interfaces we weren't correctly configuring things until ixgbe_setup_tc was called a second time either by tweaking the number of queues or increasing the macvlan count past 15. The issue came down to the fact that num_rx_pools is not populated until after the queues and interrupts are reinitialized. Instead of trying to set it sooner we can just move the call to setup at least 1 traffic class to the SR-IOV/VMDq setup function so that we just set it for this one case. We already had a spot that was configuring the queues for TC 0 in the code here anyway so it makes sense to also set the number of TCs here as well. Fixes: 49cfbeb ("ixgbe: Fix handling of macvlan Tx offload") Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent f0dc7f9 commit 646bb57

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
593593
}
594594

595595
#endif
596+
/* To support macvlan offload we have to use num_tc to
597+
* restrict the queues that can be used by the device.
598+
* By doing this we can avoid reporting a false number of
599+
* queues.
600+
*/
601+
if (vmdq_i > 1)
602+
netdev_set_num_tc(adapter->netdev, 1);
603+
596604
/* populate TC0 for use by pool 0 */
597605
netdev_set_tc_queue(adapter->netdev, 0,
598606
adapter->num_rx_queues_per_pool, 0);

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8822,14 +8822,6 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
88228822
} else {
88238823
netdev_reset_tc(dev);
88248824

8825-
/* To support macvlan offload we have to use num_tc to
8826-
* restrict the queues that can be used by the device.
8827-
* By doing this we can avoid reporting a false number of
8828-
* queues.
8829-
*/
8830-
if (!tc && adapter->num_rx_pools > 1)
8831-
netdev_set_num_tc(dev, 1);
8832-
88338825
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
88348826
adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
88358827

0 commit comments

Comments
 (0)