mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 17:15:46 -04:00
ixgbe: Populate the prio_tc_map in ixgbe_setup_tc
There were cases where the prio_tc_map was not populated when we were calling open. This will result in us incorrectly configuring the traffic classes when DCB is enabled. In order to correct this I have updated the code so that we now populate the values prior to allocating the q_vectors and calling ixgbe_open. Cc: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
df0676d1bd
commit
02debdc9b9
@@ -6595,6 +6595,31 @@ static void ixgbe_validate_rtr(struct ixgbe_adapter *adapter, u8 tc)
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_set_prio_tc_map - Configure netdev prio tc map
|
||||
* @adapter: Pointer to adapter struct
|
||||
*
|
||||
* Populate the netdev user priority to tc map
|
||||
*/
|
||||
static void ixgbe_set_prio_tc_map(struct ixgbe_adapter *adapter)
|
||||
{
|
||||
struct net_device *dev = adapter->netdev;
|
||||
struct ixgbe_dcb_config *dcb_cfg = &adapter->dcb_cfg;
|
||||
struct ieee_ets *ets = adapter->ixgbe_ieee_ets;
|
||||
u8 prio;
|
||||
|
||||
for (prio = 0; prio < MAX_USER_PRIORITY; prio++) {
|
||||
u8 tc = 0;
|
||||
|
||||
if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)
|
||||
tc = ixgbe_dcb_get_tc_from_up(dcb_cfg, 0, prio);
|
||||
else if (ets)
|
||||
tc = ets->prio_tc[prio];
|
||||
|
||||
netdev_set_prio_tc_map(dev, prio, tc);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_setup_tc - configure net_device for multiple traffic classes
|
||||
*
|
||||
@@ -6633,6 +6658,8 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
|
||||
|
||||
if (tc) {
|
||||
netdev_set_num_tc(dev, tc);
|
||||
ixgbe_set_prio_tc_map(adapter);
|
||||
|
||||
adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
|
||||
adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
|
||||
|
||||
@@ -6642,6 +6669,7 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
|
||||
}
|
||||
} else {
|
||||
netdev_reset_tc(dev);
|
||||
|
||||
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
|
||||
adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user