aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ixgbe/ixgbe_82598.c2
-rw-r--r--drivers/net/ixgbe/ixgbe_common.c5
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82598.c4
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c32
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c10
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c19
7 files changed, 66 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 3f83a12785db..d291d1cbe041 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -252,6 +252,7 @@ struct ixgbe_adapter {
252 struct ixgbe_dcb_config dcb_cfg; 252 struct ixgbe_dcb_config dcb_cfg;
253 struct ixgbe_dcb_config temp_dcb_cfg; 253 struct ixgbe_dcb_config temp_dcb_cfg;
254 u8 dcb_set_bitmap; 254 u8 dcb_set_bitmap;
255 enum ixgbe_fc_mode last_lfc_mode;
255 256
256 /* Interrupt Throttle Rate */ 257 /* Interrupt Throttle Rate */
257 u32 itr_setting; 258 u32 itr_setting;
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index 55186dc7dd78..afc9fe3f1eda 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -363,7 +363,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
363 } 363 }
364 364
365 /* Configure pause time (2 TCs per register) */ 365 /* Configure pause time (2 TCs per register) */
366 reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num)); 366 reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num / 2));
367 if ((packetbuf_num & 1) == 0) 367 if ((packetbuf_num & 1) == 0)
368 reg = (reg & 0xFFFF0000) | hw->fc.pause_time; 368 reg = (reg & 0xFFFF0000) | hw->fc.pause_time;
369 else 369 else
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 530da909dc7a..0cc3c47cb453 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -1661,9 +1661,10 @@ s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num)
1661 reg = IXGBE_READ_REG(hw, IXGBE_MTQC); 1661 reg = IXGBE_READ_REG(hw, IXGBE_MTQC);
1662 /* Thresholds are different for link flow control when in DCB mode */ 1662 /* Thresholds are different for link flow control when in DCB mode */
1663 if (reg & IXGBE_MTQC_RT_ENA) { 1663 if (reg & IXGBE_MTQC_RT_ENA) {
1664 rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(packetbuf_num));
1665
1666 /* Always disable XON for LFC when in DCB mode */ 1664 /* Always disable XON for LFC when in DCB mode */
1665 IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(packetbuf_num), 0);
1666
1667 rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(packetbuf_num));
1667 reg = (rx_pba_size >> 2) & 0xFFE0; 1668 reg = (rx_pba_size >> 2) & 0xFFE0;
1668 if (hw->fc.current_mode & ixgbe_fc_tx_pause) 1669 if (hw->fc.current_mode & ixgbe_fc_tx_pause)
1669 reg |= IXGBE_FCRTH_FCEN; 1670 reg |= IXGBE_FCRTH_FCEN;
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ixgbe/ixgbe_dcb_82598.c
index 62206273d888..f30263898ebc 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82598.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82598.c
@@ -294,6 +294,9 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw,
294 u32 reg, rx_pba_size; 294 u32 reg, rx_pba_size;
295 u8 i; 295 u8 i;
296 296
297 if (!dcb_config->pfc_mode_enable)
298 goto out;
299
297 /* Enable Transmit Priority Flow Control */ 300 /* Enable Transmit Priority Flow Control */
298 reg = IXGBE_READ_REG(hw, IXGBE_RMCS); 301 reg = IXGBE_READ_REG(hw, IXGBE_RMCS);
299 reg &= ~IXGBE_RMCS_TFCE_802_3X; 302 reg &= ~IXGBE_RMCS_TFCE_802_3X;
@@ -341,6 +344,7 @@ s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw,
341 /* Configure flow control refresh threshold value */ 344 /* Configure flow control refresh threshold value */
342 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, 0x3400); 345 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, 0x3400);
343 346
347out:
344 return 0; 348 return 0;
345} 349}
346 350
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 5d5d390f84bf..6cbff96cc0ff 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -126,7 +126,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
126 netdev->netdev_ops->ndo_stop(netdev); 126 netdev->netdev_ops->ndo_stop(netdev);
127 ixgbe_clear_interrupt_scheme(adapter); 127 ixgbe_clear_interrupt_scheme(adapter);
128 128
129 adapter->hw.fc.requested_mode = ixgbe_fc_pfc; 129 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
130 adapter->last_lfc_mode = adapter->hw.fc.current_mode;
131 adapter->hw.fc.requested_mode = ixgbe_fc_none;
132 }
130 adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; 133 adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
131 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 134 adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
132 ixgbe_init_interrupt_scheme(adapter); 135 ixgbe_init_interrupt_scheme(adapter);
@@ -135,11 +138,13 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
135 } else { 138 } else {
136 /* Turn off DCB */ 139 /* Turn off DCB */
137 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 140 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
138 adapter->hw.fc.requested_mode = ixgbe_fc_default;
139 if (netif_running(netdev)) 141 if (netif_running(netdev))
140 netdev->netdev_ops->ndo_stop(netdev); 142 netdev->netdev_ops->ndo_stop(netdev);
141 ixgbe_clear_interrupt_scheme(adapter); 143 ixgbe_clear_interrupt_scheme(adapter);
142 144
145 adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
146 adapter->temp_dcb_cfg.pfc_mode_enable = false;
147 adapter->dcb_cfg.pfc_mode_enable = false;
143 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 148 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
144 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 149 adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
145 ixgbe_init_interrupt_scheme(adapter); 150 ixgbe_init_interrupt_scheme(adapter);
@@ -329,9 +334,24 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
329 return ret; 334 return ret;
330 } 335 }
331 336
337 if (adapter->dcb_cfg.pfc_mode_enable) {
338 if ((adapter->hw.mac.type != ixgbe_mac_82598EB) &&
339 (adapter->hw.fc.current_mode != ixgbe_fc_pfc))
340 adapter->last_lfc_mode = adapter->hw.fc.current_mode;
341 adapter->hw.fc.requested_mode = ixgbe_fc_pfc;
342 } else {
343 if (adapter->hw.mac.type != ixgbe_mac_82598EB)
344 adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
345 else
346 adapter->hw.fc.requested_mode = ixgbe_fc_none;
347 }
348
332 if (netif_running(netdev)) 349 if (netif_running(netdev))
333 ixgbe_up(adapter); 350 ixgbe_up(adapter);
334 351
352 if (adapter->dcb_cfg.pfc_mode_enable)
353 adapter->hw.fc.current_mode = ixgbe_fc_pfc;
354
335 adapter->dcb_set_bitmap = 0x00; 355 adapter->dcb_set_bitmap = 0x00;
336 clear_bit(__IXGBE_RESETTING, &adapter->state); 356 clear_bit(__IXGBE_RESETTING, &adapter->state);
337 return ret; 357 return ret;
@@ -409,11 +429,17 @@ static u8 ixgbe_dcbnl_getpfcstate(struct net_device *netdev)
409{ 429{
410 struct ixgbe_adapter *adapter = netdev_priv(netdev); 430 struct ixgbe_adapter *adapter = netdev_priv(netdev);
411 431
412 return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED); 432 return adapter->dcb_cfg.pfc_mode_enable;
413} 433}
414 434
415static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state) 435static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
416{ 436{
437 struct ixgbe_adapter *adapter = netdev_priv(netdev);
438
439 adapter->temp_dcb_cfg.pfc_mode_enable = state;
440 if (adapter->temp_dcb_cfg.pfc_mode_enable !=
441 adapter->dcb_cfg.pfc_mode_enable)
442 adapter->dcb_set_bitmap |= BIT_PFC;
417 return; 443 return;
418} 444}
419 445
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 39fb98faffd0..6c7324339ec8 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -270,6 +270,13 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
270 struct ixgbe_adapter *adapter = netdev_priv(netdev); 270 struct ixgbe_adapter *adapter = netdev_priv(netdev);
271 struct ixgbe_hw *hw = &adapter->hw; 271 struct ixgbe_hw *hw = &adapter->hw;
272 272
273#ifdef CONFIG_DCB
274 if (adapter->dcb_cfg.pfc_mode_enable ||
275 ((hw->mac.type == ixgbe_mac_82598EB) &&
276 (adapter->flags & IXGBE_FLAG_DCB_ENABLED)))
277 return -EINVAL;
278
279#endif
273 if (pause->autoneg != AUTONEG_ENABLE) 280 if (pause->autoneg != AUTONEG_ENABLE)
274 hw->fc.disable_fc_autoneg = true; 281 hw->fc.disable_fc_autoneg = true;
275 else 282 else
@@ -286,6 +293,9 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
286 else 293 else
287 return -EINVAL; 294 return -EINVAL;
288 295
296#ifdef CONFIG_DCB
297 adapter->last_lfc_mode = hw->fc.requested_mode;
298#endif
289 hw->mac.ops.setup_fc(hw, 0); 299 hw->mac.ops.setup_fc(hw, 0);
290 300
291 return 0; 301 return 0;
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;