aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-11-11 20:12:22 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-12-05 03:12:53 -0500
commit43497cc21889725a0fa0dcea1ce72ec567796f3a (patch)
treef9d02cf34021d2bbea95590ac13b9080a5359f9b /drivers
parent4909fe979c4863bb748cd35e2cec9aab1e140a10 (diff)
ixgbe: DCB: IEEE transitions may fail to reprogram hardware.
Transitioning through an IEEE DCBX version from a CEE DCBX and back (CEE->IEEE->CEE) may leave IEEE attributes programmed in the hardware. DCB uses a bit field in the set routines to determine which attributes PG, PFC, APP need to be reprogrammed. This is needed because user flow allows queueing a series of changes and then reprogramming the hardware with the entire set in one operation. When transitioning from IEEE DCBX mode back into CEE DCBX mode the PG and PFC bits need to be set so the possibly different CEE attributes get programmed into the device. This patch fixes broken logic that was evaluating to 0 and never setting any bits. Further this removes some checks for num_tc in set routines. This logic only worked when the number of traffic classes and user priorities were equal. This is no longer the case for X540 devices. Besides we can trust user input in this case if the device is incorrectly configured the DCB bandwidths will be incorrectly mapped but no OOPs, BUG, or hardware failure will occur. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 8c056c06761f..da31735311f1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -158,10 +158,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
158{ 158{
159 struct ixgbe_adapter *adapter = netdev_priv(netdev); 159 struct ixgbe_adapter *adapter = netdev_priv(netdev);
160 160
161 /* Abort a bad configuration */
162 if (ffs(up_map) > adapter->dcb_cfg.num_tcs.pg_tcs)
163 return;
164
165 if (prio != DCB_ATTR_VALUE_UNDEFINED) 161 if (prio != DCB_ATTR_VALUE_UNDEFINED)
166 adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type = prio; 162 adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type = prio;
167 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED) 163 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED)
@@ -185,7 +181,7 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
185 181
186 if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap != 182 if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap !=
187 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap) 183 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap)
188 adapter->dcb_set_bitmap |= BIT_PFC; 184 adapter->dcb_set_bitmap |= BIT_PFC | BIT_APP_UPCHG;
189} 185}
190 186
191static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, 187static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
@@ -206,10 +202,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
206{ 202{
207 struct ixgbe_adapter *adapter = netdev_priv(netdev); 203 struct ixgbe_adapter *adapter = netdev_priv(netdev);
208 204
209 /* Abort bad configurations */
210 if (ffs(up_map) > adapter->dcb_cfg.num_tcs.pg_tcs)
211 return;
212
213 if (prio != DCB_ATTR_VALUE_UNDEFINED) 205 if (prio != DCB_ATTR_VALUE_UNDEFINED)
214 adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type = prio; 206 adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type = prio;
215 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED) 207 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED)
@@ -434,7 +426,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
434 adapter->hw.fc.current_mode = ixgbe_fc_pfc; 426 adapter->hw.fc.current_mode = ixgbe_fc_pfc;
435 427
436#ifdef IXGBE_FCOE 428#ifdef IXGBE_FCOE
437 if (up && !(up & (1 << adapter->fcoe.up))) { 429 /* Reprogam FCoE hardware offloads when the traffic class
430 * FCoE is using changes. This happens if the APP info
431 * changes or the up2tc mapping is updated.
432 */
433 if ((up && !(up & (1 << adapter->fcoe.up))) ||
434 (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) {
438 adapter->fcoe.up = ffs(up) - 1; 435 adapter->fcoe.up = ffs(up) - 1;
439 ixgbe_dcbnl_devreset(netdev); 436 ixgbe_dcbnl_devreset(netdev);
440 ret = DCB_HW_CHG_RST; 437 ret = DCB_HW_CHG_RST;
@@ -742,7 +739,9 @@ static u8 ixgbe_dcbnl_setdcbx(struct net_device *dev, u8 mode)
742 ixgbe_dcbnl_ieee_setets(dev, &ets); 739 ixgbe_dcbnl_ieee_setets(dev, &ets);
743 ixgbe_dcbnl_ieee_setpfc(dev, &pfc); 740 ixgbe_dcbnl_ieee_setpfc(dev, &pfc);
744 } else if (mode & DCB_CAP_DCBX_VER_CEE) { 741 } else if (mode & DCB_CAP_DCBX_VER_CEE) {
745 adapter->dcb_set_bitmap |= (BIT_PFC & BIT_PG_TX & BIT_PG_RX); 742 u8 mask = BIT_PFC | BIT_PG_TX | BIT_PG_RX | BIT_APP_UPCHG;
743
744 adapter->dcb_set_bitmap |= mask;
746 ixgbe_dcbnl_set_all(dev); 745 ixgbe_dcbnl_set_all(dev);
747 } else { 746 } else {
748 /* Drop into single TC mode strict priority as this 747 /* Drop into single TC mode strict priority as this