aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-05-17 08:35:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-18 00:04:13 -0400
commit264857b8fe8a16fc95f12e898951fc6bd4bdaa7a (patch)
treeefb090175b49f72170555eab18cdcf1156ed2a4a /drivers/net/ixgbe/ixgbe_main.c
parent70b77628d8d943b27cc0f72002b5884028aee38c (diff)
ixgbe: Allow link flow control in DCB mode for 82599 adapters
82599 supports using either link flow control or priority flow control when in DCB mode. The dcbnl interface already supports sending down configurations through rtnetlink that can enable LFC when DCB is enabled, so the driver should take advantage of this. 82598 does not support using LFC when DCB is enabled, so explicitly disable it when we're in DCB mode. This means we always run in PFC mode when DCB is enabled. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 1b4af3f541b7..b53f26501173 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3554,6 +3554,7 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
3554 adapter->dcb_cfg.bw_percentage[DCB_TX_CONFIG][0] = 100; 3554 adapter->dcb_cfg.bw_percentage[DCB_TX_CONFIG][0] = 100;
3555 adapter->dcb_cfg.bw_percentage[DCB_RX_CONFIG][0] = 100; 3555 adapter->dcb_cfg.bw_percentage[DCB_RX_CONFIG][0] = 100;
3556 adapter->dcb_cfg.rx_pba_cfg = pba_equal; 3556 adapter->dcb_cfg.rx_pba_cfg = pba_equal;
3557 adapter->dcb_cfg.pfc_mode_enable = false;
3557 adapter->dcb_cfg.round_robin_enable = false; 3558 adapter->dcb_cfg.round_robin_enable = false;
3558 adapter->dcb_set_bitmap = 0x00; 3559 adapter->dcb_set_bitmap = 0x00;
3559 ixgbe_copy_dcb_cfg(&adapter->dcb_cfg, &adapter->temp_dcb_cfg, 3560 ixgbe_copy_dcb_cfg(&adapter->dcb_cfg, &adapter->temp_dcb_cfg,
@@ -3564,6 +3565,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
3564 /* default flow control settings */ 3565 /* default flow control settings */
3565 hw->fc.requested_mode = ixgbe_fc_full; 3566 hw->fc.requested_mode = ixgbe_fc_full;
3566 hw->fc.current_mode = ixgbe_fc_full; /* init for ethtool output */ 3567 hw->fc.current_mode = ixgbe_fc_full; /* init for ethtool output */
3568#ifdef CONFIG_DCB
3569 adapter->last_lfc_mode = hw->fc.current_mode;
3570#endif
3567 hw->fc.high_water = IXGBE_DEFAULT_FCRTH; 3571 hw->fc.high_water = IXGBE_DEFAULT_FCRTH;
3568 hw->fc.low_water = IXGBE_DEFAULT_FCRTL; 3572 hw->fc.low_water = IXGBE_DEFAULT_FCRTL;
3569 hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE; 3573 hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE;
@@ -4319,11 +4323,24 @@ static void ixgbe_watchdog_task(struct work_struct *work)
4319 4323
4320 if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE) { 4324 if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE) {
4321 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); 4325 hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
4326 if (link_up) {
4327#ifdef CONFIG_DCB
4328 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
4329 for (i = 0; i < MAX_TRAFFIC_CLASS; i++)
4330 hw->mac.ops.setup_fc(hw, i);
4331 } else {
4332 hw->mac.ops.setup_fc(hw, 0);
4333 }
4334#else
4335 hw->mac.ops.setup_fc(hw, 0);
4336#endif
4337 }
4338
4322 if (link_up || 4339 if (link_up ||
4323 time_after(jiffies, (adapter->link_check_timeout + 4340 time_after(jiffies, (adapter->link_check_timeout +
4324 IXGBE_TRY_LINK_TIMEOUT))) { 4341 IXGBE_TRY_LINK_TIMEOUT))) {
4325 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMC_LSC);
4326 adapter->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE; 4342 adapter->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
4343 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMC_LSC);
4327 } 4344 }
4328 adapter->link_up = link_up; 4345 adapter->link_up = link_up;
4329 adapter->link_speed = link_speed; 4346 adapter->link_speed = link_speed;