aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-04-26 03:25:58 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-06-21 04:19:27 -0400
commit72a32f1f3f68b7d95e7151b5f88831fb9906416e (patch)
tree831b7793cabc8dc01ad3cad05f7abf1b0ac99e6b
parent80605c6513207344d00b32e8d1e64bd34fdf1358 (diff)
ixgbe: consolidate MRQC and MTQC handling
The MRQC and MTQC registers are configured in the main setup path but are also reconfigured in the DCB setup path. The DCB path fixes the DCB configuration by configuring the SECTXMINIFG gap which is required for DCB pause to operate correctly. This patch reduces the duplicate code and does all setup in ixgbe_setup_mtqc() and ixgbe_setup_mrqc(). Additionally, this removes the IXGBE_QDE. This write never set the WRITE bit in the register so the write was not actually doing anything. Also this was to clear the register but, it is never set and defaults to zero. If this is needed for SRIOV it should be added correctly in a follow up patch. But it's never been working so removing it here should be OK. 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>
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.c57
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c7
2 files changed, 7 insertions, 57 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c
index befe8ad134c5..ade98200288c 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82599.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c
@@ -319,62 +319,6 @@ static s32 ixgbe_dcb_config_tc_stats_82599(struct ixgbe_hw *hw)
319} 319}
320 320
321/** 321/**
322 * ixgbe_dcb_config_82599 - Configure general DCB parameters
323 * @hw: pointer to hardware structure
324 *
325 * Configure general DCB parameters.
326 */
327static s32 ixgbe_dcb_config_82599(struct ixgbe_hw *hw)
328{
329 u32 reg;
330 u32 q;
331
332 /* Disable the Tx desc arbiter so that MTQC can be changed */
333 reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
334 reg |= IXGBE_RTTDCS_ARBDIS;
335 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, reg);
336
337 /* Enable DCB for Rx with 8 TCs */
338 reg = IXGBE_READ_REG(hw, IXGBE_MRQC);
339 switch (reg & IXGBE_MRQC_MRQE_MASK) {
340 case 0:
341 case IXGBE_MRQC_RT4TCEN:
342 /* RSS disabled cases */
343 reg = (reg & ~IXGBE_MRQC_MRQE_MASK) | IXGBE_MRQC_RT8TCEN;
344 break;
345 case IXGBE_MRQC_RSSEN:
346 case IXGBE_MRQC_RTRSS4TCEN:
347 /* RSS enabled cases */
348 reg = (reg & ~IXGBE_MRQC_MRQE_MASK) | IXGBE_MRQC_RTRSS8TCEN;
349 break;
350 default:
351 /* Unsupported value, assume stale data, overwrite no RSS */
352 reg = (reg & ~IXGBE_MRQC_MRQE_MASK) | IXGBE_MRQC_RT8TCEN;
353 }
354 IXGBE_WRITE_REG(hw, IXGBE_MRQC, reg);
355
356 /* Enable DCB for Tx with 8 TCs */
357 reg = IXGBE_MTQC_RT_ENA | IXGBE_MTQC_8TC_8TQ;
358 IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
359
360 /* Disable drop for all queues */
361 for (q = 0; q < 128; q++)
362 IXGBE_WRITE_REG(hw, IXGBE_QDE, q << IXGBE_QDE_IDX_SHIFT);
363
364 /* Enable the Tx desc arbiter */
365 reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
366 reg &= ~IXGBE_RTTDCS_ARBDIS;
367 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, reg);
368
369 /* Enable Security TX Buffer IFG for DCB */
370 reg = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG);
371 reg |= IXGBE_SECTX_DCB;
372 IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, reg);
373
374 return 0;
375}
376
377/**
378 * ixgbe_dcb_hw_config_82599 - Configure and enable DCB 322 * ixgbe_dcb_hw_config_82599 - Configure and enable DCB
379 * @hw: pointer to hardware structure 323 * @hw: pointer to hardware structure
380 * @refill: refill credits index by traffic class 324 * @refill: refill credits index by traffic class
@@ -388,7 +332,6 @@ static s32 ixgbe_dcb_config_82599(struct ixgbe_hw *hw)
388s32 ixgbe_dcb_hw_config_82599(struct ixgbe_hw *hw, u8 pfc_en, u16 *refill, 332s32 ixgbe_dcb_hw_config_82599(struct ixgbe_hw *hw, u8 pfc_en, u16 *refill,
389 u16 *max, u8 *bwg_id, u8 *prio_type, u8 *prio_tc) 333 u16 *max, u8 *bwg_id, u8 *prio_type, u8 *prio_tc)
390{ 334{
391 ixgbe_dcb_config_82599(hw);
392 ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwg_id, 335 ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwg_id,
393 prio_type, prio_tc); 336 prio_type, prio_tc);
394 ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, 337 ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max,
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index fba1e323495e..20467da4f90e 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2816,6 +2816,7 @@ static void ixgbe_setup_mtqc(struct ixgbe_adapter *adapter)
2816 struct ixgbe_hw *hw = &adapter->hw; 2816 struct ixgbe_hw *hw = &adapter->hw;
2817 u32 rttdcs; 2817 u32 rttdcs;
2818 u32 mask; 2818 u32 mask;
2819 u32 reg;
2819 2820
2820 if (hw->mac.type == ixgbe_mac_82598EB) 2821 if (hw->mac.type == ixgbe_mac_82598EB)
2821 return; 2822 return;
@@ -2838,6 +2839,12 @@ static void ixgbe_setup_mtqc(struct ixgbe_adapter *adapter)
2838 /* We enable 8 traffic classes, DCB only */ 2839 /* We enable 8 traffic classes, DCB only */
2839 IXGBE_WRITE_REG(hw, IXGBE_MTQC, 2840 IXGBE_WRITE_REG(hw, IXGBE_MTQC,
2840 (IXGBE_MTQC_RT_ENA | IXGBE_MTQC_8TC_8TQ)); 2841 (IXGBE_MTQC_RT_ENA | IXGBE_MTQC_8TC_8TQ));
2842
2843 /* Enable Security TX Buffer IFG for DCB */
2844 reg = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG);
2845 reg |= IXGBE_SECTX_DCB;
2846 IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, reg);
2847
2841 break; 2848 break;
2842 2849
2843 default: 2850 default: