aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-04-22 00:08:09 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-05-14 21:08:09 -0400
commitf0f9778d043481f3cded693849e3b88b01fbc69b (patch)
tree03ca48b8bc740f75f0101ad3d2ed0a2c2899627e /drivers/net/ixgbe
parentd034acf1851c15c3da56d31e7eb4151e40ed0119 (diff)
ixgbe: Merge over-temp task into service task
This change merges the over-temp task into the service task. As a result all tasklets are finally combined into once single tasklet for easier management. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe.h2
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c87
2 files changed, 53 insertions, 36 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index a180cde6008a..e467b20ed1f0 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -379,6 +379,7 @@ struct ixgbe_adapter {
379#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1) 379#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1)
380#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1) 380#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1)
381#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2) 381#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2)
382#define IXGBE_FLAG2_TEMP_SENSOR_EVENT (u32)(1 << 3)
382#define IXGBE_FLAG2_SEARCH_FOR_SFP (u32)(1 << 4) 383#define IXGBE_FLAG2_SEARCH_FOR_SFP (u32)(1 << 4)
383#define IXGBE_FLAG2_SFP_NEEDS_RESET (u32)(1 << 5) 384#define IXGBE_FLAG2_SFP_NEEDS_RESET (u32)(1 << 5)
384#define IXGBE_FLAG2_RESET_REQUESTED (u32)(1 << 6) 385#define IXGBE_FLAG2_RESET_REQUESTED (u32)(1 << 6)
@@ -456,7 +457,6 @@ struct ixgbe_adapter {
456 bool link_up; 457 bool link_up;
457 unsigned long link_check_timeout; 458 unsigned long link_check_timeout;
458 459
459 struct work_struct check_overtemp_task;
460 struct work_struct service_task; 460 struct work_struct service_task;
461 struct timer_list service_timer; 461 struct timer_list service_timer;
462 u32 fdir_pballoc; 462 u32 fdir_pballoc;
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 7edd3603344a..dad56e15d4f9 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1825,35 +1825,51 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector)
1825} 1825}
1826 1826
1827/** 1827/**
1828 * ixgbe_check_overtemp_task - worker thread to check over tempurature 1828 * ixgbe_check_overtemp_subtask - check for over tempurature
1829 * @work: pointer to work_struct containing our data 1829 * @adapter: pointer to adapter
1830 **/ 1830 **/
1831static void ixgbe_check_overtemp_task(struct work_struct *work) 1831static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
1832{ 1832{
1833 struct ixgbe_adapter *adapter = container_of(work,
1834 struct ixgbe_adapter,
1835 check_overtemp_task);
1836 struct ixgbe_hw *hw = &adapter->hw; 1833 struct ixgbe_hw *hw = &adapter->hw;
1837 u32 eicr = adapter->interrupt_event; 1834 u32 eicr = adapter->interrupt_event;
1838 1835
1839 if (!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)) 1836 if (test_bit(__IXGBE_DOWN, &adapter->state))
1840 return; 1837 return;
1841 1838
1839 if (!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
1840 !(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_EVENT))
1841 return;
1842
1843 adapter->flags2 &= ~IXGBE_FLAG2_TEMP_SENSOR_EVENT;
1844
1842 switch (hw->device_id) { 1845 switch (hw->device_id) {
1843 case IXGBE_DEV_ID_82599_T3_LOM: { 1846 case IXGBE_DEV_ID_82599_T3_LOM:
1844 u32 autoneg; 1847 /*
1845 bool link_up = false; 1848 * Since the warning interrupt is for both ports
1849 * we don't have to check if:
1850 * - This interrupt wasn't for our port.
1851 * - We may have missed the interrupt so always have to
1852 * check if we got a LSC
1853 */
1854 if (!(eicr & IXGBE_EICR_GPI_SDP0) &&
1855 !(eicr & IXGBE_EICR_LSC))
1856 return;
1857
1858 if (!(eicr & IXGBE_EICR_LSC) && hw->mac.ops.check_link) {
1859 u32 autoneg;
1860 bool link_up = false;
1846 1861
1847 if (hw->mac.ops.check_link)
1848 hw->mac.ops.check_link(hw, &autoneg, &link_up, false); 1862 hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
1849 1863
1850 if (((eicr & IXGBE_EICR_GPI_SDP0) && (!link_up)) || 1864 if (link_up)
1851 (eicr & IXGBE_EICR_LSC)) 1865 return;
1852 /* Check if this is due to overtemp */ 1866 }
1853 if (hw->phy.ops.check_overtemp(hw) == IXGBE_ERR_OVERTEMP) 1867
1854 break; 1868 /* Check if this is not due to overtemp */
1855 return; 1869 if (hw->phy.ops.check_overtemp(hw) != IXGBE_ERR_OVERTEMP)
1856 } 1870 return;
1871
1872 break;
1857 default: 1873 default:
1858 if (!(eicr & IXGBE_EICR_GPI_SDP0)) 1874 if (!(eicr & IXGBE_EICR_GPI_SDP0))
1859 return; 1875 return;
@@ -1863,8 +1879,8 @@ static void ixgbe_check_overtemp_task(struct work_struct *work)
1863 "Network adapter has been stopped because it has over heated. " 1879 "Network adapter has been stopped because it has over heated. "
1864 "Restart the computer. If the problem persists, " 1880 "Restart the computer. If the problem persists, "
1865 "power off the system and replace the adapter\n"); 1881 "power off the system and replace the adapter\n");
1866 /* write to clear the interrupt */ 1882
1867 IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0); 1883 adapter->interrupt_event = 0;
1868} 1884}
1869 1885
1870static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr) 1886static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr)
@@ -1940,13 +1956,6 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
1940 1956
1941 switch (hw->mac.type) { 1957 switch (hw->mac.type) {
1942 case ixgbe_mac_82599EB: 1958 case ixgbe_mac_82599EB:
1943 ixgbe_check_sfp_event(adapter, eicr);
1944 if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
1945 ((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC))) {
1946 adapter->interrupt_event = eicr;
1947 schedule_work(&adapter->check_overtemp_task);
1948 }
1949 /* now fallthrough to handle Flow Director */
1950 case ixgbe_mac_X540: 1959 case ixgbe_mac_X540:
1951 /* Handle Flow Director Full threshold interrupt */ 1960 /* Handle Flow Director Full threshold interrupt */
1952 if (eicr & IXGBE_EICR_FLOW_DIR) { 1961 if (eicr & IXGBE_EICR_FLOW_DIR) {
@@ -1966,6 +1975,15 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
1966 ixgbe_service_event_schedule(adapter); 1975 ixgbe_service_event_schedule(adapter);
1967 } 1976 }
1968 } 1977 }
1978 ixgbe_check_sfp_event(adapter, eicr);
1979 if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
1980 ((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC))) {
1981 if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
1982 adapter->interrupt_event = eicr;
1983 adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_EVENT;
1984 ixgbe_service_event_schedule(adapter);
1985 }
1986 }
1969 break; 1987 break;
1970 default: 1988 default:
1971 break; 1989 break;
@@ -2561,8 +2579,11 @@ static irqreturn_t ixgbe_intr(int irq, void *data)
2561 ixgbe_check_sfp_event(adapter, eicr); 2579 ixgbe_check_sfp_event(adapter, eicr);
2562 if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) && 2580 if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
2563 ((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC))) { 2581 ((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC))) {
2564 adapter->interrupt_event = eicr; 2582 if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
2565 schedule_work(&adapter->check_overtemp_task); 2583 adapter->interrupt_event = eicr;
2584 adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_EVENT;
2585 ixgbe_service_event_schedule(adapter);
2586 }
2566 } 2587 }
2567 break; 2588 break;
2568 default: 2589 default:
@@ -5974,7 +5995,7 @@ static void ixgbe_fdir_reinit_subtask(struct ixgbe_adapter *adapter)
5974 if (ixgbe_reinit_fdir_tables_82599(hw) == 0) { 5995 if (ixgbe_reinit_fdir_tables_82599(hw) == 0) {
5975 for (i = 0; i < adapter->num_tx_queues; i++) 5996 for (i = 0; i < adapter->num_tx_queues; i++)
5976 set_bit(__IXGBE_TX_FDIR_INIT_DONE, 5997 set_bit(__IXGBE_TX_FDIR_INIT_DONE,
5977 &(adapter->tx_ring[i]->state)); 5998 &(adapter->tx_ring[i]->state));
5978 /* re-enable flow director interrupts */ 5999 /* re-enable flow director interrupts */
5979 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR); 6000 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR);
5980 } else { 6001 } else {
@@ -6379,6 +6400,7 @@ static void ixgbe_service_task(struct work_struct *work)
6379 ixgbe_reset_subtask(adapter); 6400 ixgbe_reset_subtask(adapter);
6380 ixgbe_sfp_detection_subtask(adapter); 6401 ixgbe_sfp_detection_subtask(adapter);
6381 ixgbe_sfp_link_config_subtask(adapter); 6402 ixgbe_sfp_link_config_subtask(adapter);
6403 ixgbe_check_overtemp_subtask(adapter);
6382 ixgbe_watchdog_subtask(adapter); 6404 ixgbe_watchdog_subtask(adapter);
6383 ixgbe_fdir_reinit_subtask(adapter); 6405 ixgbe_fdir_reinit_subtask(adapter);
6384 ixgbe_check_hang_subtask(adapter); 6406 ixgbe_check_hang_subtask(adapter);
@@ -7648,9 +7670,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7648 /* carrier off reporting is important to ethtool even BEFORE open */ 7670 /* carrier off reporting is important to ethtool even BEFORE open */
7649 netif_carrier_off(netdev); 7671 netif_carrier_off(netdev);
7650 7672
7651 if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
7652 INIT_WORK(&adapter->check_overtemp_task,
7653 ixgbe_check_overtemp_task);
7654#ifdef CONFIG_IXGBE_DCA 7673#ifdef CONFIG_IXGBE_DCA
7655 if (dca_add_requester(&pdev->dev) == 0) { 7674 if (dca_add_requester(&pdev->dev) == 0) {
7656 adapter->flags |= IXGBE_FLAG_DCA_ENABLED; 7675 adapter->flags |= IXGBE_FLAG_DCA_ENABLED;
@@ -7707,8 +7726,6 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
7707 set_bit(__IXGBE_DOWN, &adapter->state); 7726 set_bit(__IXGBE_DOWN, &adapter->state);
7708 cancel_work_sync(&adapter->service_task); 7727 cancel_work_sync(&adapter->service_task);
7709 7728
7710 if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
7711 cancel_work_sync(&adapter->check_overtemp_task);
7712#ifdef CONFIG_IXGBE_DCA 7729#ifdef CONFIG_IXGBE_DCA
7713 if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { 7730 if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) {
7714 adapter->flags &= ~IXGBE_FLAG_DCA_ENABLED; 7731 adapter->flags &= ~IXGBE_FLAG_DCA_ENABLED;