aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82598.c44
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.c54
2 files changed, 47 insertions, 51 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ixgbe/ixgbe_dcb_82598.c
index c97cf9160dc0..1bc57e52cee3 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82598.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82598.c
@@ -233,21 +233,27 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en)
233 u32 reg, rx_pba_size; 233 u32 reg, rx_pba_size;
234 u8 i; 234 u8 i;
235 235
236 if (!pfc_en) 236 if (pfc_en) {
237 goto out; 237 /* Enable Transmit Priority Flow Control */
238 238 reg = IXGBE_READ_REG(hw, IXGBE_RMCS);
239 /* Enable Transmit Priority Flow Control */ 239 reg &= ~IXGBE_RMCS_TFCE_802_3X;
240 reg = IXGBE_READ_REG(hw, IXGBE_RMCS); 240 /* correct the reporting of our flow control status */
241 reg &= ~IXGBE_RMCS_TFCE_802_3X; 241 reg |= IXGBE_RMCS_TFCE_PRIORITY;
242 /* correct the reporting of our flow control status */ 242 IXGBE_WRITE_REG(hw, IXGBE_RMCS, reg);
243 reg |= IXGBE_RMCS_TFCE_PRIORITY; 243
244 IXGBE_WRITE_REG(hw, IXGBE_RMCS, reg); 244 /* Enable Receive Priority Flow Control */
245 245 reg = IXGBE_READ_REG(hw, IXGBE_FCTRL);
246 /* Enable Receive Priority Flow Control */ 246 reg &= ~IXGBE_FCTRL_RFCE;
247 reg = IXGBE_READ_REG(hw, IXGBE_FCTRL); 247 reg |= IXGBE_FCTRL_RPFCE;
248 reg &= ~IXGBE_FCTRL_RFCE; 248 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, reg);
249 reg |= IXGBE_FCTRL_RPFCE; 249
250 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, reg); 250 /* Configure pause time */
251 for (i = 0; i < (MAX_TRAFFIC_CLASS >> 1); i++)
252 IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), 0x68006800);
253
254 /* Configure flow control refresh threshold value */
255 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, 0x3400);
256 }
251 257
252 /* 258 /*
253 * Configure flow control thresholds and enable priority flow control 259 * Configure flow control thresholds and enable priority flow control
@@ -273,14 +279,6 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en)
273 IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), reg); 279 IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), reg);
274 } 280 }
275 281
276 /* Configure pause time */
277 for (i = 0; i < (MAX_TRAFFIC_CLASS >> 1); i++)
278 IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), 0x68006800);
279
280 /* Configure flow control refresh threshold value */
281 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, 0x3400);
282
283out:
284 return 0; 282 return 0;
285} 283}
286 284
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