aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-12-05 18:27:28 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-05 18:27:28 -0500
commit5d91c2d00a0fc10448f49b52b344e5619b99765a (patch)
tree17c6c382ef2bf3fbcd0dfaaefbea6d01da85f248
parent17e6abeec4cb8df1e33ea0e2b889586c731a68be (diff)
parent560f20dad7b46e6e8cd166d992679fc96fc50026 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
-rw-r--r--drivers/net/ethernet/intel/e1000e/e1000.h1
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c27
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c26
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c96
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h1
5 files changed, 80 insertions, 71 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 9fe18d1d53d8..f478a22ed577 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -309,6 +309,7 @@ struct e1000_adapter {
309 u32 txd_cmd; 309 u32 txd_cmd;
310 310
311 bool detect_tx_hung; 311 bool detect_tx_hung;
312 bool tx_hang_recheck;
312 u8 tx_timeout_factor; 313 u8 tx_timeout_factor;
313 314
314 u32 tx_int_delay; 315 u32 tx_int_delay;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c6e976302f97..93ae0c26d434 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1014,6 +1014,7 @@ static void e1000_print_hw_hang(struct work_struct *work)
1014 struct e1000_adapter *adapter = container_of(work, 1014 struct e1000_adapter *adapter = container_of(work,
1015 struct e1000_adapter, 1015 struct e1000_adapter,
1016 print_hang_task); 1016 print_hang_task);
1017 struct net_device *netdev = adapter->netdev;
1017 struct e1000_ring *tx_ring = adapter->tx_ring; 1018 struct e1000_ring *tx_ring = adapter->tx_ring;
1018 unsigned int i = tx_ring->next_to_clean; 1019 unsigned int i = tx_ring->next_to_clean;
1019 unsigned int eop = tx_ring->buffer_info[i].next_to_watch; 1020 unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
@@ -1025,6 +1026,21 @@ static void e1000_print_hw_hang(struct work_struct *work)
1025 if (test_bit(__E1000_DOWN, &adapter->state)) 1026 if (test_bit(__E1000_DOWN, &adapter->state))
1026 return; 1027 return;
1027 1028
1029 if (!adapter->tx_hang_recheck &&
1030 (adapter->flags2 & FLAG2_DMA_BURST)) {
1031 /* May be block on write-back, flush and detect again
1032 * flush pending descriptor writebacks to memory
1033 */
1034 ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
1035 /* execute the writes immediately */
1036 e1e_flush();
1037 adapter->tx_hang_recheck = true;
1038 return;
1039 }
1040 /* Real hang detected */
1041 adapter->tx_hang_recheck = false;
1042 netif_stop_queue(netdev);
1043
1028 e1e_rphy(hw, PHY_STATUS, &phy_status); 1044 e1e_rphy(hw, PHY_STATUS, &phy_status);
1029 e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); 1045 e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
1030 e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); 1046 e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
@@ -1145,10 +1161,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
1145 if (tx_ring->buffer_info[i].time_stamp && 1161 if (tx_ring->buffer_info[i].time_stamp &&
1146 time_after(jiffies, tx_ring->buffer_info[i].time_stamp 1162 time_after(jiffies, tx_ring->buffer_info[i].time_stamp
1147 + (adapter->tx_timeout_factor * HZ)) && 1163 + (adapter->tx_timeout_factor * HZ)) &&
1148 !(er32(STATUS) & E1000_STATUS_TXOFF)) { 1164 !(er32(STATUS) & E1000_STATUS_TXOFF))
1149 schedule_work(&adapter->print_hang_task); 1165 schedule_work(&adapter->print_hang_task);
1150 netif_stop_queue(netdev); 1166 else
1151 } 1167 adapter->tx_hang_recheck = false;
1152 } 1168 }
1153 adapter->total_tx_bytes += total_tx_bytes; 1169 adapter->total_tx_bytes += total_tx_bytes;
1154 adapter->total_tx_packets += total_tx_packets; 1170 adapter->total_tx_packets += total_tx_packets;
@@ -3500,7 +3516,6 @@ int e1000e_up(struct e1000_adapter *adapter)
3500 3516
3501 clear_bit(__E1000_DOWN, &adapter->state); 3517 clear_bit(__E1000_DOWN, &adapter->state);
3502 3518
3503 napi_enable(&adapter->napi);
3504 if (adapter->msix_entries) 3519 if (adapter->msix_entries)
3505 e1000_configure_msix(adapter); 3520 e1000_configure_msix(adapter);
3506 e1000_irq_enable(adapter); 3521 e1000_irq_enable(adapter);
@@ -3562,7 +3577,6 @@ void e1000e_down(struct e1000_adapter *adapter)
3562 e1e_flush(); 3577 e1e_flush();
3563 usleep_range(10000, 20000); 3578 usleep_range(10000, 20000);
3564 3579
3565 napi_disable(&adapter->napi);
3566 e1000_irq_disable(adapter); 3580 e1000_irq_disable(adapter);
3567 3581
3568 del_timer_sync(&adapter->watchdog_timer); 3582 del_timer_sync(&adapter->watchdog_timer);
@@ -3838,6 +3852,7 @@ static int e1000_open(struct net_device *netdev)
3838 3852
3839 e1000_irq_enable(adapter); 3853 e1000_irq_enable(adapter);
3840 3854
3855 adapter->tx_hang_recheck = false;
3841 netif_start_queue(netdev); 3856 netif_start_queue(netdev);
3842 3857
3843 adapter->idle_check = true; 3858 adapter->idle_check = true;
@@ -3884,6 +3899,8 @@ static int e1000_close(struct net_device *netdev)
3884 3899
3885 pm_runtime_get_sync(&pdev->dev); 3900 pm_runtime_get_sync(&pdev->dev);
3886 3901
3902 napi_disable(&adapter->napi);
3903
3887 if (!test_bit(__E1000_DOWN, &adapter->state)) { 3904 if (!test_bit(__E1000_DOWN, &adapter->state)) {
3888 e1000e_down(adapter); 3905 e1000e_down(adapter);
3889 e1000_free_irq(adapter); 3906 e1000_free_irq(adapter);
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b66b8aa751e7..143cfebe3182 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7061,15 +7061,28 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
7061 wr32(E1000_DMCTXTH, 0); 7061 wr32(E1000_DMCTXTH, 0);
7062 7062
7063 /* 7063 /*
7064 * DMA Coalescing high water mark needs to be higher 7064 * DMA Coalescing high water mark needs to be greater
7065 * than the RX threshold. set hwm to PBA - 2 * max 7065 * than the Rx threshold. Set hwm to PBA - max frame
7066 * frame size 7066 * size in 16B units, capping it at PBA - 6KB.
7067 */ 7067 */
7068 hwm = pba - (2 * adapter->max_frame_size); 7068 hwm = 64 * pba - adapter->max_frame_size / 16;
7069 if (hwm < 64 * (pba - 6))
7070 hwm = 64 * (pba - 6);
7071 reg = rd32(E1000_FCRTC);
7072 reg &= ~E1000_FCRTC_RTH_COAL_MASK;
7073 reg |= ((hwm << E1000_FCRTC_RTH_COAL_SHIFT)
7074 & E1000_FCRTC_RTH_COAL_MASK);
7075 wr32(E1000_FCRTC, reg);
7076
7077 /*
7078 * Set the DMA Coalescing Rx threshold to PBA - 2 * max
7079 * frame size, capping it at PBA - 10KB.
7080 */
7081 dmac_thr = pba - adapter->max_frame_size / 512;
7082 if (dmac_thr < pba - 10)
7083 dmac_thr = pba - 10;
7069 reg = rd32(E1000_DMACR); 7084 reg = rd32(E1000_DMACR);
7070 reg &= ~E1000_DMACR_DMACTHR_MASK; 7085 reg &= ~E1000_DMACR_DMACTHR_MASK;
7071 dmac_thr = pba - 4;
7072
7073 reg |= ((dmac_thr << E1000_DMACR_DMACTHR_SHIFT) 7086 reg |= ((dmac_thr << E1000_DMACR_DMACTHR_SHIFT)
7074 & E1000_DMACR_DMACTHR_MASK); 7087 & E1000_DMACR_DMACTHR_MASK);
7075 7088
@@ -7085,7 +7098,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
7085 * coalescing(smart fifb)-UTRESH=0 7098 * coalescing(smart fifb)-UTRESH=0
7086 */ 7099 */
7087 wr32(E1000_DMCRTRH, 0); 7100 wr32(E1000_DMCRTRH, 0);
7088 wr32(E1000_FCRTC, hwm);
7089 7101
7090 reg = (IGB_DMCTLX_DCFLUSH_DIS | 0x4); 7102 reg = (IGB_DMCTLX_DCFLUSH_DIS | 0x4);
7091 7103
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 33b93ffb87cb..da31735311f1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -158,10 +158,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
158{ 158{
159 struct ixgbe_adapter *adapter = netdev_priv(netdev); 159 struct ixgbe_adapter *adapter = netdev_priv(netdev);
160 160
161 /* Abort a bad configuration */
162 if (ffs(up_map) > adapter->dcb_cfg.num_tcs.pg_tcs)
163 return;
164
165 if (prio != DCB_ATTR_VALUE_UNDEFINED) 161 if (prio != DCB_ATTR_VALUE_UNDEFINED)
166 adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type = prio; 162 adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type = prio;
167 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED) 163 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED)
@@ -185,7 +181,7 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
185 181
186 if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap != 182 if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap !=
187 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap) 183 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap)
188 adapter->dcb_set_bitmap |= BIT_PFC; 184 adapter->dcb_set_bitmap |= BIT_PFC | BIT_APP_UPCHG;
189} 185}
190 186
191static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, 187static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
@@ -206,10 +202,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
206{ 202{
207 struct ixgbe_adapter *adapter = netdev_priv(netdev); 203 struct ixgbe_adapter *adapter = netdev_priv(netdev);
208 204
209 /* Abort bad configurations */
210 if (ffs(up_map) > adapter->dcb_cfg.num_tcs.pg_tcs)
211 return;
212
213 if (prio != DCB_ATTR_VALUE_UNDEFINED) 205 if (prio != DCB_ATTR_VALUE_UNDEFINED)
214 adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type = prio; 206 adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type = prio;
215 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED) 207 if (bwg_id != DCB_ATTR_VALUE_UNDEFINED)
@@ -309,6 +301,27 @@ static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
309 *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc; 301 *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc;
310} 302}
311 303
304#ifdef IXGBE_FCOE
305static void ixgbe_dcbnl_devreset(struct net_device *dev)
306{
307 struct ixgbe_adapter *adapter = netdev_priv(dev);
308
309 while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
310 usleep_range(1000, 2000);
311
312 if (netif_running(dev))
313 dev->netdev_ops->ndo_stop(dev);
314
315 ixgbe_clear_interrupt_scheme(adapter);
316 ixgbe_init_interrupt_scheme(adapter);
317
318 if (netif_running(dev))
319 dev->netdev_ops->ndo_open(dev);
320
321 clear_bit(__IXGBE_RESETTING, &adapter->state);
322}
323#endif
324
312static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) 325static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
313{ 326{
314 struct ixgbe_adapter *adapter = netdev_priv(netdev); 327 struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -338,27 +351,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
338 if (ret) 351 if (ret)
339 return DCB_NO_HW_CHG; 352 return DCB_NO_HW_CHG;
340 353
341#ifdef IXGBE_FCOE
342 if (up && !(up & (1 << adapter->fcoe.up)))
343 adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
344
345 /*
346 * Only take down the adapter if an app change occurred. FCoE
347 * may shuffle tx rings in this case and this can not be done
348 * without a reset currently.
349 */
350 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
351 while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
352 usleep_range(1000, 2000);
353
354 adapter->fcoe.up = ffs(up) - 1;
355
356 if (netif_running(netdev))
357 netdev->netdev_ops->ndo_stop(netdev);
358 ixgbe_clear_interrupt_scheme(adapter);
359 }
360#endif
361
362 if (adapter->dcb_cfg.pfc_mode_enable) { 354 if (adapter->dcb_cfg.pfc_mode_enable) {
363 switch (adapter->hw.mac.type) { 355 switch (adapter->hw.mac.type) {
364 case ixgbe_mac_82599EB: 356 case ixgbe_mac_82599EB:
@@ -385,15 +377,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
385 } 377 }
386 } 378 }
387 379
388#ifdef IXGBE_FCOE
389 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
390 ixgbe_init_interrupt_scheme(adapter);
391 if (netif_running(netdev))
392 netdev->netdev_ops->ndo_open(netdev);
393 ret = DCB_HW_CHG_RST;
394 }
395#endif
396
397 if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) { 380 if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) {
398 u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS]; 381 u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS];
399 u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS]; 382 u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS];
@@ -442,8 +425,19 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
442 if (adapter->dcb_cfg.pfc_mode_enable) 425 if (adapter->dcb_cfg.pfc_mode_enable)
443 adapter->hw.fc.current_mode = ixgbe_fc_pfc; 426 adapter->hw.fc.current_mode = ixgbe_fc_pfc;
444 427
445 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) 428#ifdef IXGBE_FCOE
446 clear_bit(__IXGBE_RESETTING, &adapter->state); 429 /* Reprogam FCoE hardware offloads when the traffic class
430 * FCoE is using changes. This happens if the APP info
431 * changes or the up2tc mapping is updated.
432 */
433 if ((up && !(up & (1 << adapter->fcoe.up))) ||
434 (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) {
435 adapter->fcoe.up = ffs(up) - 1;
436 ixgbe_dcbnl_devreset(netdev);
437 ret = DCB_HW_CHG_RST;
438 }
439#endif
440
447 adapter->dcb_set_bitmap = 0x00; 441 adapter->dcb_set_bitmap = 0x00;
448 return ret; 442 return ret;
449} 443}
@@ -661,22 +655,6 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
661 return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc); 655 return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc);
662} 656}
663 657
664#ifdef IXGBE_FCOE
665static void ixgbe_dcbnl_devreset(struct net_device *dev)
666{
667 struct ixgbe_adapter *adapter = netdev_priv(dev);
668
669 if (netif_running(dev))
670 dev->netdev_ops->ndo_stop(dev);
671
672 ixgbe_clear_interrupt_scheme(adapter);
673 ixgbe_init_interrupt_scheme(adapter);
674
675 if (netif_running(dev))
676 dev->netdev_ops->ndo_open(dev);
677}
678#endif
679
680static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev, 658static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
681 struct dcb_app *app) 659 struct dcb_app *app)
682{ 660{
@@ -761,7 +739,9 @@ static u8 ixgbe_dcbnl_setdcbx(struct net_device *dev, u8 mode)
761 ixgbe_dcbnl_ieee_setets(dev, &ets); 739 ixgbe_dcbnl_ieee_setets(dev, &ets);
762 ixgbe_dcbnl_ieee_setpfc(dev, &pfc); 740 ixgbe_dcbnl_ieee_setpfc(dev, &pfc);
763 } else if (mode & DCB_CAP_DCBX_VER_CEE) { 741 } else if (mode & DCB_CAP_DCBX_VER_CEE) {
764 adapter->dcb_set_bitmap |= (BIT_PFC & BIT_PG_TX & BIT_PG_RX); 742 u8 mask = BIT_PFC | BIT_PG_TX | BIT_PG_RX | BIT_APP_UPCHG;
743
744 adapter->dcb_set_bitmap |= mask;
765 ixgbe_dcbnl_set_all(dev); 745 ixgbe_dcbnl_set_all(dev);
766 } else { 746 } else {
767 /* Drop into single TC mode strict priority as this 747 /* Drop into single TC mode strict priority as this
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
index df04f1a3857c..e8badab03359 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
@@ -33,7 +33,6 @@ void ixgbe_msg_task(struct ixgbe_adapter *adapter);
33int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask); 33int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
34void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter); 34void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter);
35void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter); 35void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);
36void ixgbe_dump_registers(struct ixgbe_adapter *adapter);
37int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac); 36int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);
38int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan, 37int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,
39 u8 qos); 38 u8 qos);