mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 20:42:33 -04:00
ixgbe: Don't assume dev->num_tc is equal to hardware TC config
The code throughout ixgbe was assuming that dev->num_tc was populated and configured with the driver, when in fact this can be configured via mqprio without any hardware coordination other than restricting us to the real number of Tx queues we advertise. Instead of handling things this way we need to keep a local copy of the number of TCs in use so that we don't accidentally pull in the TC configuration from mqprio when it is configured in software mode. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
a8e87d9f73
commit
0efbf12b95
@@ -3117,7 +3117,7 @@ static int ixgbe_get_ts_info(struct net_device *dev,
|
||||
static unsigned int ixgbe_max_channels(struct ixgbe_adapter *adapter)
|
||||
{
|
||||
unsigned int max_combined;
|
||||
u8 tcs = netdev_get_num_tc(adapter->netdev);
|
||||
u8 tcs = adapter->hw_tcs;
|
||||
|
||||
if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) {
|
||||
/* We only support one q_vector without MSI-X */
|
||||
@@ -3174,7 +3174,7 @@ static void ixgbe_get_channels(struct net_device *dev,
|
||||
return;
|
||||
|
||||
/* same thing goes for being DCB enabled */
|
||||
if (netdev_get_num_tc(dev) > 1)
|
||||
if (adapter->hw_tcs > 1)
|
||||
return;
|
||||
|
||||
/* if ATR is disabled we can exit */
|
||||
@@ -3220,7 +3220,7 @@ static int ixgbe_set_channels(struct net_device *dev,
|
||||
|
||||
#endif
|
||||
/* use setup TC to update any traffic class queue mapping */
|
||||
return ixgbe_setup_tc(dev, netdev_get_num_tc(dev));
|
||||
return ixgbe_setup_tc(dev, adapter->hw_tcs);
|
||||
}
|
||||
|
||||
static int ixgbe_get_module_info(struct net_device *dev,
|
||||
|
||||
Reference in New Issue
Block a user