aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_dcb_82599.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-03-10 07:06:12 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-12 07:15:35 -0500
commit1f4a0244ff002672be855ff2eaa4a29a63d42d42 (patch)
tree9d122241efafdb5a09e718c45c7c5bdd95194b2b /drivers/net/ixgbe/ixgbe_dcb_82599.c
parentff4ab2061199cdb938282d302d5044b1858e28c8 (diff)
ixgbe: DCB, PFC not cleared until reset occurs
The PFC configuration is not cleared until the device is reset. This has not been a problem because setting DCB attributes forced a hardware reset. Now that we no longer require this reset to occur PFC remains configured even after being disabled until the device is reset. This removes a goto in the PFC hardware set routines for 82598 and 82599 devices that was short circuiting the clear. 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/net/ixgbe/ixgbe_dcb_82599.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c
index 0a482bbf1bd2..025af8c53ddb 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82599.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c
@@ -253,13 +253,6 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en)
253{ 253{
254 u32 i, reg, rx_pba_size; 254 u32 i, reg, rx_pba_size;
255 255
256 /* If PFC is disabled globally then fall back to LFC. */
257 if (!pfc_en) {
258 for (i = 0; i < MAX_TRAFFIC_CLASS; i++)
259 hw->mac.ops.fc_enable(hw, i);
260 goto out;
261 }
262
263 /* Configure PFC Tx thresholds per TC */ 256 /* Configure PFC Tx thresholds per TC */
264 for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { 257 for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
265 int enabled = pfc_en & (1 << i); 258 int enabled = pfc_en & (1 << i);
@@ -278,28 +271,33 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en)
278 IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), reg); 271 IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), reg);
279 } 272 }
280 273
281 /* Configure pause time (2 TCs per register) */ 274 if (pfc_en) {
282 reg = hw->fc.pause_time | (hw->fc.pause_time << 16); 275 /* Configure pause time (2 TCs per register) */
283 for (i = 0; i < (MAX_TRAFFIC_CLASS / 2); i++) 276 reg = hw->fc.pause_time | (hw->fc.pause_time << 16);
284 IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); 277 for (i = 0; i < (MAX_TRAFFIC_CLASS / 2); i++)
285 278 IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg);
286 /* Configure flow control refresh threshold value */ 279
287 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); 280 /* Configure flow control refresh threshold value */
288 281 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2);
289 /* Enable Transmit PFC */ 282
290 reg = IXGBE_FCCFG_TFCE_PRIORITY; 283
291 IXGBE_WRITE_REG(hw, IXGBE_FCCFG, reg); 284 reg = IXGBE_FCCFG_TFCE_PRIORITY;
285 IXGBE_WRITE_REG(hw, IXGBE_FCCFG, reg);
286 /*
287 * Enable Receive PFC
288 * We will always honor XOFF frames we receive when
289 * we are in PFC mode.
290 */
291 reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
292 reg &= ~IXGBE_MFLCN_RFCE;
293 reg |= IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_DPF;
294 IXGBE_WRITE_REG(hw, IXGBE_MFLCN, reg);
295
296 } else {
297 for (i = 0; i < MAX_TRAFFIC_CLASS; i++)
298 hw->mac.ops.fc_enable(hw, i);
299 }
292 300
293 /*
294 * Enable Receive PFC
295 * We will always honor XOFF frames we receive when
296 * we are in PFC mode.
297 */
298 reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
299 reg &= ~IXGBE_MFLCN_RFCE;
300 reg |= IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_DPF;
301 IXGBE_WRITE_REG(hw, IXGBE_MFLCN, reg);
302out:
303 return 0; 301 return 0;
304} 302}
305 303