Lines Matching refs:adapter

99 static void ixgbevf_service_event_schedule(struct ixgbevf_adapter *adapter)  in ixgbevf_service_event_schedule()  argument
101 if (!test_bit(__IXGBEVF_DOWN, &adapter->state) && in ixgbevf_service_event_schedule()
102 !test_bit(__IXGBEVF_REMOVING, &adapter->state) && in ixgbevf_service_event_schedule()
103 !test_and_set_bit(__IXGBEVF_SERVICE_SCHED, &adapter->state)) in ixgbevf_service_event_schedule()
104 schedule_work(&adapter->service_task); in ixgbevf_service_event_schedule()
107 static void ixgbevf_service_event_complete(struct ixgbevf_adapter *adapter) in ixgbevf_service_event_complete() argument
109 BUG_ON(!test_bit(__IXGBEVF_SERVICE_SCHED, &adapter->state)); in ixgbevf_service_event_complete()
113 clear_bit(__IXGBEVF_SERVICE_SCHED, &adapter->state); in ixgbevf_service_event_complete()
117 static void ixgbevf_queue_reset_subtask(struct ixgbevf_adapter *adapter);
119 static void ixgbevf_free_all_rx_resources(struct ixgbevf_adapter *adapter);
123 struct ixgbevf_adapter *adapter = hw->back; in ixgbevf_remove_adapter() local
128 dev_err(&adapter->pdev->dev, "Adapter removed\n"); in ixgbevf_remove_adapter()
129 if (test_bit(__IXGBEVF_SERVICE_INITED, &adapter->state)) in ixgbevf_remove_adapter()
130 ixgbevf_service_event_schedule(adapter); in ixgbevf_remove_adapter()
172 static void ixgbevf_set_ivar(struct ixgbevf_adapter *adapter, s8 direction, in ixgbevf_set_ivar() argument
176 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_set_ivar()
225 struct ixgbevf_adapter *adapter = netdev_priv(ring->netdev); in ixgbevf_get_tx_pending() local
226 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_get_tx_pending()
265 static void ixgbevf_tx_timeout_reset(struct ixgbevf_adapter *adapter) in ixgbevf_tx_timeout_reset() argument
268 if (!test_bit(__IXGBEVF_DOWN, &adapter->state)) { in ixgbevf_tx_timeout_reset()
269 adapter->flags |= IXGBEVF_FLAG_RESET_REQUESTED; in ixgbevf_tx_timeout_reset()
270 ixgbevf_service_event_schedule(adapter); in ixgbevf_tx_timeout_reset()
280 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_tx_timeout() local
282 ixgbevf_tx_timeout_reset(adapter); in ixgbevf_tx_timeout()
293 struct ixgbevf_adapter *adapter = q_vector->adapter; in ixgbevf_clean_tx_irq() local
300 if (test_bit(__IXGBEVF_DOWN, &adapter->state)) in ixgbevf_clean_tx_irq()
389 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_clean_tx_irq()
414 ixgbevf_tx_timeout_reset(adapter); in ixgbevf_clean_tx_irq()
429 !test_bit(__IXGBEVF_DOWN, &adapter->state)) { in ixgbevf_clean_tx_irq()
904 static inline void ixgbevf_irq_enable_queues(struct ixgbevf_adapter *adapter, in ixgbevf_irq_enable_queues() argument
907 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_irq_enable_queues()
1010 struct ixgbevf_adapter *adapter = q_vector->adapter; in ixgbevf_poll() local
1045 if (adapter->rx_itr_setting & 1) in ixgbevf_poll()
1047 if (!test_bit(__IXGBEVF_DOWN, &adapter->state) && in ixgbevf_poll()
1048 !test_bit(__IXGBEVF_REMOVING, &adapter->state)) in ixgbevf_poll()
1049 ixgbevf_irq_enable_queues(adapter, in ixgbevf_poll()
1061 struct ixgbevf_adapter *adapter = q_vector->adapter; in ixgbevf_write_eitr() local
1062 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_write_eitr()
1080 struct ixgbevf_adapter *adapter = q_vector->adapter; in ixgbevf_busy_poll_recv() local
1084 if (test_bit(__IXGBEVF_DOWN, &adapter->state)) in ixgbevf_busy_poll_recv()
1115 static void ixgbevf_configure_msix(struct ixgbevf_adapter *adapter) in ixgbevf_configure_msix() argument
1120 q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_configure_msix()
1121 adapter->eims_enable_mask = 0; in ixgbevf_configure_msix()
1129 q_vector = adapter->q_vector[v_idx]; in ixgbevf_configure_msix()
1132 ixgbevf_set_ivar(adapter, 0, ring->reg_idx, v_idx); in ixgbevf_configure_msix()
1135 ixgbevf_set_ivar(adapter, 1, ring->reg_idx, v_idx); in ixgbevf_configure_msix()
1139 if (adapter->tx_itr_setting == 1) in ixgbevf_configure_msix()
1142 q_vector->itr = adapter->tx_itr_setting; in ixgbevf_configure_msix()
1145 if (adapter->rx_itr_setting == 1) in ixgbevf_configure_msix()
1148 q_vector->itr = adapter->rx_itr_setting; in ixgbevf_configure_msix()
1152 adapter->eims_enable_mask |= 1 << v_idx; in ixgbevf_configure_msix()
1157 ixgbevf_set_ivar(adapter, -1, 1, v_idx); in ixgbevf_configure_msix()
1159 adapter->eims_other = 1 << v_idx; in ixgbevf_configure_msix()
1160 adapter->eims_enable_mask |= adapter->eims_other; in ixgbevf_configure_msix()
1267 struct ixgbevf_adapter *adapter = data; in ixgbevf_msix_other() local
1268 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_msix_other()
1272 ixgbevf_service_event_schedule(adapter); in ixgbevf_msix_other()
1274 IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other); in ixgbevf_msix_other()
1325 static int ixgbevf_map_rings_to_vectors(struct ixgbevf_adapter *adapter) in ixgbevf_map_rings_to_vectors() argument
1330 int rxr_remaining = adapter->num_rx_queues; in ixgbevf_map_rings_to_vectors()
1331 int txr_remaining = adapter->num_tx_queues; in ixgbevf_map_rings_to_vectors()
1336 q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_map_rings_to_vectors()
1341 if (q_vectors == adapter->num_rx_queues + adapter->num_tx_queues) { in ixgbevf_map_rings_to_vectors()
1343 map_vector_to_rxq(adapter, v_start, rxr_idx); in ixgbevf_map_rings_to_vectors()
1346 map_vector_to_txq(adapter, v_start, txr_idx); in ixgbevf_map_rings_to_vectors()
1358 map_vector_to_rxq(adapter, i, rxr_idx); in ixgbevf_map_rings_to_vectors()
1366 map_vector_to_txq(adapter, i, txr_idx); in ixgbevf_map_rings_to_vectors()
1383 static int ixgbevf_request_msix_irqs(struct ixgbevf_adapter *adapter) in ixgbevf_request_msix_irqs() argument
1385 struct net_device *netdev = adapter->netdev; in ixgbevf_request_msix_irqs()
1386 int q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_request_msix_irqs()
1391 struct ixgbevf_q_vector *q_vector = adapter->q_vector[vector]; in ixgbevf_request_msix_irqs()
1392 struct msix_entry *entry = &adapter->msix_entries[vector]; in ixgbevf_request_msix_irqs()
1411 hw_dbg(&adapter->hw, in ixgbevf_request_msix_irqs()
1418 err = request_irq(adapter->msix_entries[vector].vector, in ixgbevf_request_msix_irqs()
1419 &ixgbevf_msix_other, 0, netdev->name, adapter); in ixgbevf_request_msix_irqs()
1421 hw_dbg(&adapter->hw, "request_irq for msix_other failed: %d\n", in ixgbevf_request_msix_irqs()
1431 free_irq(adapter->msix_entries[vector].vector, in ixgbevf_request_msix_irqs()
1432 adapter->q_vector[vector]); in ixgbevf_request_msix_irqs()
1444 adapter->num_msix_vectors = 0; in ixgbevf_request_msix_irqs()
1448 static inline void ixgbevf_reset_q_vectors(struct ixgbevf_adapter *adapter) in ixgbevf_reset_q_vectors() argument
1450 int i, q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_reset_q_vectors()
1453 struct ixgbevf_q_vector *q_vector = adapter->q_vector[i]; in ixgbevf_reset_q_vectors()
1469 static int ixgbevf_request_irq(struct ixgbevf_adapter *adapter) in ixgbevf_request_irq() argument
1473 err = ixgbevf_request_msix_irqs(adapter); in ixgbevf_request_irq()
1476 hw_dbg(&adapter->hw, "request_irq failed, Error %d\n", err); in ixgbevf_request_irq()
1481 static void ixgbevf_free_irq(struct ixgbevf_adapter *adapter) in ixgbevf_free_irq() argument
1485 q_vectors = adapter->num_msix_vectors; in ixgbevf_free_irq()
1488 free_irq(adapter->msix_entries[i].vector, adapter); in ixgbevf_free_irq()
1493 if (!adapter->q_vector[i]->rx.ring && in ixgbevf_free_irq()
1494 !adapter->q_vector[i]->tx.ring) in ixgbevf_free_irq()
1497 free_irq(adapter->msix_entries[i].vector, in ixgbevf_free_irq()
1498 adapter->q_vector[i]); in ixgbevf_free_irq()
1501 ixgbevf_reset_q_vectors(adapter); in ixgbevf_free_irq()
1508 static inline void ixgbevf_irq_disable(struct ixgbevf_adapter *adapter) in ixgbevf_irq_disable() argument
1510 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_irq_disable()
1519 for (i = 0; i < adapter->num_msix_vectors; i++) in ixgbevf_irq_disable()
1520 synchronize_irq(adapter->msix_entries[i].vector); in ixgbevf_irq_disable()
1527 static inline void ixgbevf_irq_enable(struct ixgbevf_adapter *adapter) in ixgbevf_irq_enable() argument
1529 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_irq_enable()
1531 IXGBE_WRITE_REG(hw, IXGBE_VTEIAM, adapter->eims_enable_mask); in ixgbevf_irq_enable()
1532 IXGBE_WRITE_REG(hw, IXGBE_VTEIAC, adapter->eims_enable_mask); in ixgbevf_irq_enable()
1533 IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_enable_mask); in ixgbevf_irq_enable()
1543 static void ixgbevf_configure_tx_ring(struct ixgbevf_adapter *adapter, in ixgbevf_configure_tx_ring() argument
1546 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_configure_tx_ring()
1573 ring->tail = adapter->io_addr + IXGBE_VFTDT(reg_idx); in ixgbevf_configure_tx_ring()
1608 static void ixgbevf_configure_tx(struct ixgbevf_adapter *adapter) in ixgbevf_configure_tx() argument
1613 for (i = 0; i < adapter->num_tx_queues; i++) in ixgbevf_configure_tx()
1614 ixgbevf_configure_tx_ring(adapter, adapter->tx_ring[i]); in ixgbevf_configure_tx()
1619 static void ixgbevf_configure_srrctl(struct ixgbevf_adapter *adapter, int index) in ixgbevf_configure_srrctl() argument
1621 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_configure_srrctl()
1633 static void ixgbevf_setup_psrtype(struct ixgbevf_adapter *adapter) in ixgbevf_setup_psrtype() argument
1635 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_setup_psrtype()
1642 if (adapter->num_rx_queues > 1) in ixgbevf_setup_psrtype()
1649 static void ixgbevf_disable_rx_queue(struct ixgbevf_adapter *adapter, in ixgbevf_disable_rx_queue() argument
1652 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_disable_rx_queue()
1676 static void ixgbevf_rx_desc_queue_enable(struct ixgbevf_adapter *adapter, in ixgbevf_rx_desc_queue_enable() argument
1679 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_rx_desc_queue_enable()
1696 static void ixgbevf_setup_vfmrqc(struct ixgbevf_adapter *adapter) in ixgbevf_setup_vfmrqc() argument
1698 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_setup_vfmrqc()
1701 u16 rss_i = adapter->num_rx_queues; in ixgbevf_setup_vfmrqc()
1729 static void ixgbevf_configure_rx_ring(struct ixgbevf_adapter *adapter, in ixgbevf_configure_rx_ring() argument
1732 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_configure_rx_ring()
1739 ixgbevf_disable_rx_queue(adapter, ring); in ixgbevf_configure_rx_ring()
1753 ring->tail = adapter->io_addr + IXGBE_VFRDT(reg_idx); in ixgbevf_configure_rx_ring()
1760 ixgbevf_configure_srrctl(adapter, reg_idx); in ixgbevf_configure_rx_ring()
1768 ixgbevf_rx_desc_queue_enable(adapter, ring); in ixgbevf_configure_rx_ring()
1778 static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter) in ixgbevf_configure_rx() argument
1781 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_configure_rx()
1782 struct net_device *netdev = adapter->netdev; in ixgbevf_configure_rx()
1784 ixgbevf_setup_psrtype(adapter); in ixgbevf_configure_rx()
1786 ixgbevf_setup_vfmrqc(adapter); in ixgbevf_configure_rx()
1794 for (i = 0; i < adapter->num_rx_queues; i++) in ixgbevf_configure_rx()
1795 ixgbevf_configure_rx_ring(adapter, adapter->rx_ring[i]); in ixgbevf_configure_rx()
1801 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_vlan_rx_add_vid() local
1802 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_vlan_rx_add_vid()
1805 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_vlan_rx_add_vid()
1810 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_vlan_rx_add_vid()
1819 set_bit(vid, adapter->active_vlans); in ixgbevf_vlan_rx_add_vid()
1827 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_vlan_rx_kill_vid() local
1828 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_vlan_rx_kill_vid()
1831 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_vlan_rx_kill_vid()
1836 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_vlan_rx_kill_vid()
1838 clear_bit(vid, adapter->active_vlans); in ixgbevf_vlan_rx_kill_vid()
1843 static void ixgbevf_restore_vlan(struct ixgbevf_adapter *adapter) in ixgbevf_restore_vlan() argument
1847 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) in ixgbevf_restore_vlan()
1848 ixgbevf_vlan_rx_add_vid(adapter->netdev, in ixgbevf_restore_vlan()
1854 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_write_uc_addr_list() local
1855 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_write_uc_addr_list()
1891 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_set_rx_mode() local
1892 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_set_rx_mode()
1894 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_set_rx_mode()
1901 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_set_rx_mode()
1904 static void ixgbevf_napi_enable_all(struct ixgbevf_adapter *adapter) in ixgbevf_napi_enable_all() argument
1908 int q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_napi_enable_all()
1911 q_vector = adapter->q_vector[q_idx]; in ixgbevf_napi_enable_all()
1913 ixgbevf_qv_init_lock(adapter->q_vector[q_idx]); in ixgbevf_napi_enable_all()
1919 static void ixgbevf_napi_disable_all(struct ixgbevf_adapter *adapter) in ixgbevf_napi_disable_all() argument
1923 int q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_napi_disable_all()
1926 q_vector = adapter->q_vector[q_idx]; in ixgbevf_napi_disable_all()
1929 while (!ixgbevf_qv_disable(adapter->q_vector[q_idx])) { in ixgbevf_napi_disable_all()
1937 static int ixgbevf_configure_dcb(struct ixgbevf_adapter *adapter) in ixgbevf_configure_dcb() argument
1939 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_configure_dcb()
1942 unsigned int num_rx_queues = adapter->num_rx_queues; in ixgbevf_configure_dcb()
1943 unsigned int num_tx_queues = adapter->num_tx_queues; in ixgbevf_configure_dcb()
1946 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_configure_dcb()
1951 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_configure_dcb()
1961 adapter->tx_ring[0]->reg_idx = def_q; in ixgbevf_configure_dcb()
1968 if ((adapter->num_rx_queues != num_rx_queues) || in ixgbevf_configure_dcb()
1969 (adapter->num_tx_queues != num_tx_queues)) { in ixgbevf_configure_dcb()
1974 adapter->flags |= IXGBEVF_FLAG_QUEUE_RESET_REQUESTED; in ixgbevf_configure_dcb()
1980 static void ixgbevf_configure(struct ixgbevf_adapter *adapter) in ixgbevf_configure() argument
1982 ixgbevf_configure_dcb(adapter); in ixgbevf_configure()
1984 ixgbevf_set_rx_mode(adapter->netdev); in ixgbevf_configure()
1986 ixgbevf_restore_vlan(adapter); in ixgbevf_configure()
1988 ixgbevf_configure_tx(adapter); in ixgbevf_configure()
1989 ixgbevf_configure_rx(adapter); in ixgbevf_configure()
1992 static void ixgbevf_save_reset_stats(struct ixgbevf_adapter *adapter) in ixgbevf_save_reset_stats() argument
1995 if (adapter->stats.vfgprc || adapter->stats.vfgptc) { in ixgbevf_save_reset_stats()
1996 adapter->stats.saved_reset_vfgprc += adapter->stats.vfgprc - in ixgbevf_save_reset_stats()
1997 adapter->stats.base_vfgprc; in ixgbevf_save_reset_stats()
1998 adapter->stats.saved_reset_vfgptc += adapter->stats.vfgptc - in ixgbevf_save_reset_stats()
1999 adapter->stats.base_vfgptc; in ixgbevf_save_reset_stats()
2000 adapter->stats.saved_reset_vfgorc += adapter->stats.vfgorc - in ixgbevf_save_reset_stats()
2001 adapter->stats.base_vfgorc; in ixgbevf_save_reset_stats()
2002 adapter->stats.saved_reset_vfgotc += adapter->stats.vfgotc - in ixgbevf_save_reset_stats()
2003 adapter->stats.base_vfgotc; in ixgbevf_save_reset_stats()
2004 adapter->stats.saved_reset_vfmprc += adapter->stats.vfmprc - in ixgbevf_save_reset_stats()
2005 adapter->stats.base_vfmprc; in ixgbevf_save_reset_stats()
2009 static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter) in ixgbevf_init_last_counter_stats() argument
2011 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_init_last_counter_stats()
2013 adapter->stats.last_vfgprc = IXGBE_READ_REG(hw, IXGBE_VFGPRC); in ixgbevf_init_last_counter_stats()
2014 adapter->stats.last_vfgorc = IXGBE_READ_REG(hw, IXGBE_VFGORC_LSB); in ixgbevf_init_last_counter_stats()
2015 adapter->stats.last_vfgorc |= in ixgbevf_init_last_counter_stats()
2017 adapter->stats.last_vfgptc = IXGBE_READ_REG(hw, IXGBE_VFGPTC); in ixgbevf_init_last_counter_stats()
2018 adapter->stats.last_vfgotc = IXGBE_READ_REG(hw, IXGBE_VFGOTC_LSB); in ixgbevf_init_last_counter_stats()
2019 adapter->stats.last_vfgotc |= in ixgbevf_init_last_counter_stats()
2021 adapter->stats.last_vfmprc = IXGBE_READ_REG(hw, IXGBE_VFMPRC); in ixgbevf_init_last_counter_stats()
2023 adapter->stats.base_vfgprc = adapter->stats.last_vfgprc; in ixgbevf_init_last_counter_stats()
2024 adapter->stats.base_vfgorc = adapter->stats.last_vfgorc; in ixgbevf_init_last_counter_stats()
2025 adapter->stats.base_vfgptc = adapter->stats.last_vfgptc; in ixgbevf_init_last_counter_stats()
2026 adapter->stats.base_vfgotc = adapter->stats.last_vfgotc; in ixgbevf_init_last_counter_stats()
2027 adapter->stats.base_vfmprc = adapter->stats.last_vfmprc; in ixgbevf_init_last_counter_stats()
2030 static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter) in ixgbevf_negotiate_api() argument
2032 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_negotiate_api()
2039 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_negotiate_api()
2048 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_negotiate_api()
2051 static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter) in ixgbevf_up_complete() argument
2053 struct net_device *netdev = adapter->netdev; in ixgbevf_up_complete()
2054 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_up_complete()
2056 ixgbevf_configure_msix(adapter); in ixgbevf_up_complete()
2058 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_up_complete()
2065 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_up_complete()
2068 clear_bit(__IXGBEVF_DOWN, &adapter->state); in ixgbevf_up_complete()
2069 ixgbevf_napi_enable_all(adapter); in ixgbevf_up_complete()
2073 ixgbevf_irq_enable(adapter); in ixgbevf_up_complete()
2078 ixgbevf_save_reset_stats(adapter); in ixgbevf_up_complete()
2079 ixgbevf_init_last_counter_stats(adapter); in ixgbevf_up_complete()
2082 mod_timer(&adapter->service_timer, jiffies); in ixgbevf_up_complete()
2085 void ixgbevf_up(struct ixgbevf_adapter *adapter) in ixgbevf_up() argument
2087 ixgbevf_configure(adapter); in ixgbevf_up()
2089 ixgbevf_up_complete(adapter); in ixgbevf_up()
2162 static void ixgbevf_clean_all_rx_rings(struct ixgbevf_adapter *adapter) in ixgbevf_clean_all_rx_rings() argument
2166 for (i = 0; i < adapter->num_rx_queues; i++) in ixgbevf_clean_all_rx_rings()
2167 ixgbevf_clean_rx_ring(adapter->rx_ring[i]); in ixgbevf_clean_all_rx_rings()
2174 static void ixgbevf_clean_all_tx_rings(struct ixgbevf_adapter *adapter) in ixgbevf_clean_all_tx_rings() argument
2178 for (i = 0; i < adapter->num_tx_queues; i++) in ixgbevf_clean_all_tx_rings()
2179 ixgbevf_clean_tx_ring(adapter->tx_ring[i]); in ixgbevf_clean_all_tx_rings()
2182 void ixgbevf_down(struct ixgbevf_adapter *adapter) in ixgbevf_down() argument
2184 struct net_device *netdev = adapter->netdev; in ixgbevf_down()
2185 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_down()
2189 if (test_and_set_bit(__IXGBEVF_DOWN, &adapter->state)) in ixgbevf_down()
2193 for (i = 0; i < adapter->num_rx_queues; i++) in ixgbevf_down()
2194 ixgbevf_disable_rx_queue(adapter, adapter->rx_ring[i]); in ixgbevf_down()
2204 ixgbevf_irq_disable(adapter); in ixgbevf_down()
2206 ixgbevf_napi_disable_all(adapter); in ixgbevf_down()
2208 del_timer_sync(&adapter->service_timer); in ixgbevf_down()
2211 for (i = 0; i < adapter->num_tx_queues; i++) { in ixgbevf_down()
2212 u8 reg_idx = adapter->tx_ring[i]->reg_idx; in ixgbevf_down()
2218 if (!pci_channel_offline(adapter->pdev)) in ixgbevf_down()
2219 ixgbevf_reset(adapter); in ixgbevf_down()
2221 ixgbevf_clean_all_tx_rings(adapter); in ixgbevf_down()
2222 ixgbevf_clean_all_rx_rings(adapter); in ixgbevf_down()
2225 void ixgbevf_reinit_locked(struct ixgbevf_adapter *adapter) in ixgbevf_reinit_locked() argument
2229 while (test_and_set_bit(__IXGBEVF_RESETTING, &adapter->state)) in ixgbevf_reinit_locked()
2232 ixgbevf_down(adapter); in ixgbevf_reinit_locked()
2233 ixgbevf_up(adapter); in ixgbevf_reinit_locked()
2235 clear_bit(__IXGBEVF_RESETTING, &adapter->state); in ixgbevf_reinit_locked()
2238 void ixgbevf_reset(struct ixgbevf_adapter *adapter) in ixgbevf_reset() argument
2240 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_reset()
2241 struct net_device *netdev = adapter->netdev; in ixgbevf_reset()
2247 ixgbevf_negotiate_api(adapter); in ixgbevf_reset()
2250 if (is_valid_ether_addr(adapter->hw.mac.addr)) { in ixgbevf_reset()
2251 memcpy(netdev->dev_addr, adapter->hw.mac.addr, in ixgbevf_reset()
2253 memcpy(netdev->perm_addr, adapter->hw.mac.addr, in ixgbevf_reset()
2257 adapter->last_reset = jiffies; in ixgbevf_reset()
2260 static int ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter, in ixgbevf_acquire_msix_vectors() argument
2276 vectors = pci_enable_msix_range(adapter->pdev, adapter->msix_entries, in ixgbevf_acquire_msix_vectors()
2280 dev_err(&adapter->pdev->dev, in ixgbevf_acquire_msix_vectors()
2282 kfree(adapter->msix_entries); in ixgbevf_acquire_msix_vectors()
2283 adapter->msix_entries = NULL; in ixgbevf_acquire_msix_vectors()
2291 adapter->num_msix_vectors = vectors; in ixgbevf_acquire_msix_vectors()
2307 static void ixgbevf_set_num_queues(struct ixgbevf_adapter *adapter) in ixgbevf_set_num_queues() argument
2309 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_set_num_queues()
2315 adapter->num_rx_queues = 1; in ixgbevf_set_num_queues()
2316 adapter->num_tx_queues = 1; in ixgbevf_set_num_queues()
2318 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_set_num_queues()
2323 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_set_num_queues()
2330 adapter->num_rx_queues = num_tcs; in ixgbevf_set_num_queues()
2337 adapter->num_rx_queues = rss; in ixgbevf_set_num_queues()
2338 adapter->num_tx_queues = rss; in ixgbevf_set_num_queues()
2353 static int ixgbevf_alloc_queues(struct ixgbevf_adapter *adapter) in ixgbevf_alloc_queues() argument
2358 for (; tx < adapter->num_tx_queues; tx++) { in ixgbevf_alloc_queues()
2363 ring->dev = &adapter->pdev->dev; in ixgbevf_alloc_queues()
2364 ring->netdev = adapter->netdev; in ixgbevf_alloc_queues()
2365 ring->count = adapter->tx_ring_count; in ixgbevf_alloc_queues()
2369 adapter->tx_ring[tx] = ring; in ixgbevf_alloc_queues()
2372 for (; rx < adapter->num_rx_queues; rx++) { in ixgbevf_alloc_queues()
2377 ring->dev = &adapter->pdev->dev; in ixgbevf_alloc_queues()
2378 ring->netdev = adapter->netdev; in ixgbevf_alloc_queues()
2380 ring->count = adapter->rx_ring_count; in ixgbevf_alloc_queues()
2384 adapter->rx_ring[rx] = ring; in ixgbevf_alloc_queues()
2391 kfree(adapter->tx_ring[--tx]); in ixgbevf_alloc_queues()
2392 adapter->tx_ring[tx] = NULL; in ixgbevf_alloc_queues()
2396 kfree(adapter->rx_ring[--rx]); in ixgbevf_alloc_queues()
2397 adapter->rx_ring[rx] = NULL; in ixgbevf_alloc_queues()
2409 static int ixgbevf_set_interrupt_capability(struct ixgbevf_adapter *adapter) in ixgbevf_set_interrupt_capability() argument
2411 struct net_device *netdev = adapter->netdev; in ixgbevf_set_interrupt_capability()
2421 v_budget = max(adapter->num_rx_queues, adapter->num_tx_queues); in ixgbevf_set_interrupt_capability()
2428 adapter->msix_entries = kcalloc(v_budget, in ixgbevf_set_interrupt_capability()
2430 if (!adapter->msix_entries) { in ixgbevf_set_interrupt_capability()
2436 adapter->msix_entries[vector].entry = vector; in ixgbevf_set_interrupt_capability()
2438 err = ixgbevf_acquire_msix_vectors(adapter, v_budget); in ixgbevf_set_interrupt_capability()
2442 err = netif_set_real_num_tx_queues(netdev, adapter->num_tx_queues); in ixgbevf_set_interrupt_capability()
2446 err = netif_set_real_num_rx_queues(netdev, adapter->num_rx_queues); in ixgbevf_set_interrupt_capability()
2459 static int ixgbevf_alloc_q_vectors(struct ixgbevf_adapter *adapter) in ixgbevf_alloc_q_vectors() argument
2464 num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_alloc_q_vectors()
2470 q_vector->adapter = adapter; in ixgbevf_alloc_q_vectors()
2472 netif_napi_add(adapter->netdev, &q_vector->napi, in ixgbevf_alloc_q_vectors()
2477 adapter->q_vector[q_idx] = q_vector; in ixgbevf_alloc_q_vectors()
2485 q_vector = adapter->q_vector[q_idx]; in ixgbevf_alloc_q_vectors()
2491 adapter->q_vector[q_idx] = NULL; in ixgbevf_alloc_q_vectors()
2504 static void ixgbevf_free_q_vectors(struct ixgbevf_adapter *adapter) in ixgbevf_free_q_vectors() argument
2506 int q_idx, num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; in ixgbevf_free_q_vectors()
2509 struct ixgbevf_q_vector *q_vector = adapter->q_vector[q_idx]; in ixgbevf_free_q_vectors()
2511 adapter->q_vector[q_idx] = NULL; in ixgbevf_free_q_vectors()
2525 static void ixgbevf_reset_interrupt_capability(struct ixgbevf_adapter *adapter) in ixgbevf_reset_interrupt_capability() argument
2527 pci_disable_msix(adapter->pdev); in ixgbevf_reset_interrupt_capability()
2528 kfree(adapter->msix_entries); in ixgbevf_reset_interrupt_capability()
2529 adapter->msix_entries = NULL; in ixgbevf_reset_interrupt_capability()
2537 static int ixgbevf_init_interrupt_scheme(struct ixgbevf_adapter *adapter) in ixgbevf_init_interrupt_scheme() argument
2542 ixgbevf_set_num_queues(adapter); in ixgbevf_init_interrupt_scheme()
2544 err = ixgbevf_set_interrupt_capability(adapter); in ixgbevf_init_interrupt_scheme()
2546 hw_dbg(&adapter->hw, in ixgbevf_init_interrupt_scheme()
2551 err = ixgbevf_alloc_q_vectors(adapter); in ixgbevf_init_interrupt_scheme()
2553 hw_dbg(&adapter->hw, "Unable to allocate memory for queue vectors\n"); in ixgbevf_init_interrupt_scheme()
2557 err = ixgbevf_alloc_queues(adapter); in ixgbevf_init_interrupt_scheme()
2563 hw_dbg(&adapter->hw, "Multiqueue %s: Rx Queue count = %u, Tx Queue count = %u\n", in ixgbevf_init_interrupt_scheme()
2564 (adapter->num_rx_queues > 1) ? "Enabled" : in ixgbevf_init_interrupt_scheme()
2565 "Disabled", adapter->num_rx_queues, adapter->num_tx_queues); in ixgbevf_init_interrupt_scheme()
2567 set_bit(__IXGBEVF_DOWN, &adapter->state); in ixgbevf_init_interrupt_scheme()
2571 ixgbevf_free_q_vectors(adapter); in ixgbevf_init_interrupt_scheme()
2573 ixgbevf_reset_interrupt_capability(adapter); in ixgbevf_init_interrupt_scheme()
2585 static void ixgbevf_clear_interrupt_scheme(struct ixgbevf_adapter *adapter) in ixgbevf_clear_interrupt_scheme() argument
2589 for (i = 0; i < adapter->num_tx_queues; i++) { in ixgbevf_clear_interrupt_scheme()
2590 kfree(adapter->tx_ring[i]); in ixgbevf_clear_interrupt_scheme()
2591 adapter->tx_ring[i] = NULL; in ixgbevf_clear_interrupt_scheme()
2593 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbevf_clear_interrupt_scheme()
2594 kfree(adapter->rx_ring[i]); in ixgbevf_clear_interrupt_scheme()
2595 adapter->rx_ring[i] = NULL; in ixgbevf_clear_interrupt_scheme()
2598 adapter->num_tx_queues = 0; in ixgbevf_clear_interrupt_scheme()
2599 adapter->num_rx_queues = 0; in ixgbevf_clear_interrupt_scheme()
2601 ixgbevf_free_q_vectors(adapter); in ixgbevf_clear_interrupt_scheme()
2602 ixgbevf_reset_interrupt_capability(adapter); in ixgbevf_clear_interrupt_scheme()
2613 static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter) in ixgbevf_sw_init() argument
2615 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_sw_init()
2616 struct pci_dev *pdev = adapter->pdev; in ixgbevf_sw_init()
2617 struct net_device *netdev = adapter->netdev; in ixgbevf_sw_init()
2634 spin_lock_init(&adapter->mbx_lock); in ixgbevf_sw_init()
2646 ixgbevf_negotiate_api(adapter); in ixgbevf_sw_init()
2650 else if (is_zero_ether_addr(adapter->hw.mac.addr)) in ixgbevf_sw_init()
2663 adapter->rx_itr_setting = 1; in ixgbevf_sw_init()
2664 adapter->tx_itr_setting = 1; in ixgbevf_sw_init()
2667 adapter->tx_ring_count = IXGBEVF_DEFAULT_TXD; in ixgbevf_sw_init()
2668 adapter->rx_ring_count = IXGBEVF_DEFAULT_RXD; in ixgbevf_sw_init()
2670 set_bit(__IXGBEVF_DOWN, &adapter->state); in ixgbevf_sw_init()
2703 void ixgbevf_update_stats(struct ixgbevf_adapter *adapter) in ixgbevf_update_stats() argument
2705 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_update_stats()
2708 if (test_bit(__IXGBEVF_DOWN, &adapter->state) || in ixgbevf_update_stats()
2709 test_bit(__IXGBEVF_RESETTING, &adapter->state)) in ixgbevf_update_stats()
2712 UPDATE_VF_COUNTER_32bit(IXGBE_VFGPRC, adapter->stats.last_vfgprc, in ixgbevf_update_stats()
2713 adapter->stats.vfgprc); in ixgbevf_update_stats()
2714 UPDATE_VF_COUNTER_32bit(IXGBE_VFGPTC, adapter->stats.last_vfgptc, in ixgbevf_update_stats()
2715 adapter->stats.vfgptc); in ixgbevf_update_stats()
2717 adapter->stats.last_vfgorc, in ixgbevf_update_stats()
2718 adapter->stats.vfgorc); in ixgbevf_update_stats()
2720 adapter->stats.last_vfgotc, in ixgbevf_update_stats()
2721 adapter->stats.vfgotc); in ixgbevf_update_stats()
2722 UPDATE_VF_COUNTER_32bit(IXGBE_VFMPRC, adapter->stats.last_vfmprc, in ixgbevf_update_stats()
2723 adapter->stats.vfmprc); in ixgbevf_update_stats()
2725 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbevf_update_stats()
2726 adapter->hw_csum_rx_error += in ixgbevf_update_stats()
2727 adapter->rx_ring[i]->hw_csum_rx_error; in ixgbevf_update_stats()
2728 adapter->rx_ring[i]->hw_csum_rx_error = 0; in ixgbevf_update_stats()
2738 struct ixgbevf_adapter *adapter = (struct ixgbevf_adapter *)data; in ixgbevf_service_timer() local
2741 mod_timer(&adapter->service_timer, (HZ * 2) + jiffies); in ixgbevf_service_timer()
2743 ixgbevf_service_event_schedule(adapter); in ixgbevf_service_timer()
2746 static void ixgbevf_reset_subtask(struct ixgbevf_adapter *adapter) in ixgbevf_reset_subtask() argument
2748 if (!(adapter->flags & IXGBEVF_FLAG_RESET_REQUESTED)) in ixgbevf_reset_subtask()
2751 adapter->flags &= ~IXGBEVF_FLAG_RESET_REQUESTED; in ixgbevf_reset_subtask()
2754 if (test_bit(__IXGBEVF_DOWN, &adapter->state) || in ixgbevf_reset_subtask()
2755 test_bit(__IXGBEVF_RESETTING, &adapter->state)) in ixgbevf_reset_subtask()
2758 adapter->tx_timeout_count++; in ixgbevf_reset_subtask()
2760 ixgbevf_reinit_locked(adapter); in ixgbevf_reset_subtask()
2772 static void ixgbevf_check_hang_subtask(struct ixgbevf_adapter *adapter) in ixgbevf_check_hang_subtask() argument
2774 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_check_hang_subtask()
2779 if (test_bit(__IXGBEVF_DOWN, &adapter->state) || in ixgbevf_check_hang_subtask()
2780 test_bit(__IXGBEVF_RESETTING, &adapter->state)) in ixgbevf_check_hang_subtask()
2784 if (netif_carrier_ok(adapter->netdev)) { in ixgbevf_check_hang_subtask()
2785 for (i = 0; i < adapter->num_tx_queues; i++) in ixgbevf_check_hang_subtask()
2786 set_check_for_tx_hang(adapter->tx_ring[i]); in ixgbevf_check_hang_subtask()
2790 for (i = 0; i < adapter->num_msix_vectors - NON_Q_VECTORS; i++) { in ixgbevf_check_hang_subtask()
2791 struct ixgbevf_q_vector *qv = adapter->q_vector[i]; in ixgbevf_check_hang_subtask()
2805 static void ixgbevf_watchdog_update_link(struct ixgbevf_adapter *adapter) in ixgbevf_watchdog_update_link() argument
2807 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_watchdog_update_link()
2808 u32 link_speed = adapter->link_speed; in ixgbevf_watchdog_update_link()
2809 bool link_up = adapter->link_up; in ixgbevf_watchdog_update_link()
2812 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_watchdog_update_link()
2816 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_watchdog_update_link()
2819 if (err && time_after(jiffies, adapter->last_reset + (10 * HZ))) { in ixgbevf_watchdog_update_link()
2820 adapter->flags |= IXGBEVF_FLAG_RESET_REQUESTED; in ixgbevf_watchdog_update_link()
2824 adapter->link_up = link_up; in ixgbevf_watchdog_update_link()
2825 adapter->link_speed = link_speed; in ixgbevf_watchdog_update_link()
2833 static void ixgbevf_watchdog_link_is_up(struct ixgbevf_adapter *adapter) in ixgbevf_watchdog_link_is_up() argument
2835 struct net_device *netdev = adapter->netdev; in ixgbevf_watchdog_link_is_up()
2841 dev_info(&adapter->pdev->dev, "NIC Link is Up %s\n", in ixgbevf_watchdog_link_is_up()
2842 (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? in ixgbevf_watchdog_link_is_up()
2844 (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) ? in ixgbevf_watchdog_link_is_up()
2846 (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) ? in ixgbevf_watchdog_link_is_up()
2858 static void ixgbevf_watchdog_link_is_down(struct ixgbevf_adapter *adapter) in ixgbevf_watchdog_link_is_down() argument
2860 struct net_device *netdev = adapter->netdev; in ixgbevf_watchdog_link_is_down()
2862 adapter->link_speed = 0; in ixgbevf_watchdog_link_is_down()
2868 dev_info(&adapter->pdev->dev, "NIC Link is Down\n"); in ixgbevf_watchdog_link_is_down()
2877 static void ixgbevf_watchdog_subtask(struct ixgbevf_adapter *adapter) in ixgbevf_watchdog_subtask() argument
2880 if (test_bit(__IXGBEVF_DOWN, &adapter->state) || in ixgbevf_watchdog_subtask()
2881 test_bit(__IXGBEVF_RESETTING, &adapter->state)) in ixgbevf_watchdog_subtask()
2884 ixgbevf_watchdog_update_link(adapter); in ixgbevf_watchdog_subtask()
2886 if (adapter->link_up) in ixgbevf_watchdog_subtask()
2887 ixgbevf_watchdog_link_is_up(adapter); in ixgbevf_watchdog_subtask()
2889 ixgbevf_watchdog_link_is_down(adapter); in ixgbevf_watchdog_subtask()
2891 ixgbevf_update_stats(adapter); in ixgbevf_watchdog_subtask()
2900 struct ixgbevf_adapter *adapter = container_of(work, in ixgbevf_service_task() local
2903 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_service_task()
2906 if (!test_bit(__IXGBEVF_DOWN, &adapter->state)) { in ixgbevf_service_task()
2908 ixgbevf_down(adapter); in ixgbevf_service_task()
2914 ixgbevf_queue_reset_subtask(adapter); in ixgbevf_service_task()
2915 ixgbevf_reset_subtask(adapter); in ixgbevf_service_task()
2916 ixgbevf_watchdog_subtask(adapter); in ixgbevf_service_task()
2917 ixgbevf_check_hang_subtask(adapter); in ixgbevf_service_task()
2919 ixgbevf_service_event_complete(adapter); in ixgbevf_service_task()
2951 static void ixgbevf_free_all_tx_resources(struct ixgbevf_adapter *adapter) in ixgbevf_free_all_tx_resources() argument
2955 for (i = 0; i < adapter->num_tx_queues; i++) in ixgbevf_free_all_tx_resources()
2956 if (adapter->tx_ring[i]->desc) in ixgbevf_free_all_tx_resources()
2957 ixgbevf_free_tx_resources(adapter->tx_ring[i]); in ixgbevf_free_all_tx_resources()
2989 hw_dbg(&adapter->hw, "Unable to allocate memory for the transmit descriptor ring\n"); in ixgbevf_setup_tx_resources()
3003 static int ixgbevf_setup_all_tx_resources(struct ixgbevf_adapter *adapter) in ixgbevf_setup_all_tx_resources() argument
3007 for (i = 0; i < adapter->num_tx_queues; i++) { in ixgbevf_setup_all_tx_resources()
3008 err = ixgbevf_setup_tx_resources(adapter->tx_ring[i]); in ixgbevf_setup_all_tx_resources()
3011 hw_dbg(&adapter->hw, "Allocation for Tx Queue %u failed\n", i); in ixgbevf_setup_all_tx_resources()
3061 static int ixgbevf_setup_all_rx_resources(struct ixgbevf_adapter *adapter) in ixgbevf_setup_all_rx_resources() argument
3065 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbevf_setup_all_rx_resources()
3066 err = ixgbevf_setup_rx_resources(adapter->rx_ring[i]); in ixgbevf_setup_all_rx_resources()
3069 hw_dbg(&adapter->hw, "Allocation for Rx Queue %u failed\n", i); in ixgbevf_setup_all_rx_resources()
3100 static void ixgbevf_free_all_rx_resources(struct ixgbevf_adapter *adapter) in ixgbevf_free_all_rx_resources() argument
3104 for (i = 0; i < adapter->num_rx_queues; i++) in ixgbevf_free_all_rx_resources()
3105 if (adapter->rx_ring[i]->desc) in ixgbevf_free_all_rx_resources()
3106 ixgbevf_free_rx_resources(adapter->rx_ring[i]); in ixgbevf_free_all_rx_resources()
3123 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_open() local
3124 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_open()
3133 if (!adapter->num_msix_vectors) in ixgbevf_open()
3137 ixgbevf_reset(adapter); in ixgbevf_open()
3149 if (test_bit(__IXGBEVF_TESTING, &adapter->state)) in ixgbevf_open()
3155 err = ixgbevf_setup_all_tx_resources(adapter); in ixgbevf_open()
3160 err = ixgbevf_setup_all_rx_resources(adapter); in ixgbevf_open()
3164 ixgbevf_configure(adapter); in ixgbevf_open()
3170 ixgbevf_map_rings_to_vectors(adapter); in ixgbevf_open()
3172 err = ixgbevf_request_irq(adapter); in ixgbevf_open()
3176 ixgbevf_up_complete(adapter); in ixgbevf_open()
3181 ixgbevf_down(adapter); in ixgbevf_open()
3183 ixgbevf_free_all_rx_resources(adapter); in ixgbevf_open()
3185 ixgbevf_free_all_tx_resources(adapter); in ixgbevf_open()
3186 ixgbevf_reset(adapter); in ixgbevf_open()
3206 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_close() local
3208 ixgbevf_down(adapter); in ixgbevf_close()
3209 ixgbevf_free_irq(adapter); in ixgbevf_close()
3211 ixgbevf_free_all_tx_resources(adapter); in ixgbevf_close()
3212 ixgbevf_free_all_rx_resources(adapter); in ixgbevf_close()
3217 static void ixgbevf_queue_reset_subtask(struct ixgbevf_adapter *adapter) in ixgbevf_queue_reset_subtask() argument
3219 struct net_device *dev = adapter->netdev; in ixgbevf_queue_reset_subtask()
3221 if (!(adapter->flags & IXGBEVF_FLAG_QUEUE_RESET_REQUESTED)) in ixgbevf_queue_reset_subtask()
3224 adapter->flags &= ~IXGBEVF_FLAG_QUEUE_RESET_REQUESTED; in ixgbevf_queue_reset_subtask()
3227 if (test_bit(__IXGBEVF_DOWN, &adapter->state) || in ixgbevf_queue_reset_subtask()
3228 test_bit(__IXGBEVF_RESETTING, &adapter->state)) in ixgbevf_queue_reset_subtask()
3238 ixgbevf_clear_interrupt_scheme(adapter); in ixgbevf_queue_reset_subtask()
3239 ixgbevf_init_interrupt_scheme(adapter); in ixgbevf_queue_reset_subtask()
3602 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_xmit_frame() local
3619 tx_ring = adapter->tx_ring[skb->queue_mapping]; in ixgbevf_xmit_frame()
3682 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_set_mac() local
3683 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_set_mac()
3692 spin_lock_bh(&adapter->mbx_lock); in ixgbevf_set_mac()
3696 spin_unlock_bh(&adapter->mbx_lock); in ixgbevf_set_mac()
3710 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_change_mtu() local
3711 struct ixgbe_hw *hw = &adapter->hw; in ixgbevf_change_mtu()
3715 switch (adapter->hw.api_version) { in ixgbevf_change_mtu()
3721 if (adapter->hw.mac.type != ixgbe_mac_82599_vf) in ixgbevf_change_mtu()
3748 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_netpoll() local
3752 if (test_bit(__IXGBEVF_DOWN, &adapter->state)) in ixgbevf_netpoll()
3754 for (i = 0; i < adapter->num_rx_queues; i++) in ixgbevf_netpoll()
3755 ixgbevf_msix_clean_rings(0, adapter->q_vector[i]); in ixgbevf_netpoll()
3762 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_suspend() local
3771 ixgbevf_down(adapter); in ixgbevf_suspend()
3772 ixgbevf_free_irq(adapter); in ixgbevf_suspend()
3773 ixgbevf_free_all_tx_resources(adapter); in ixgbevf_suspend()
3774 ixgbevf_free_all_rx_resources(adapter); in ixgbevf_suspend()
3778 ixgbevf_clear_interrupt_scheme(adapter); in ixgbevf_suspend()
3786 if (!test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state)) in ixgbevf_suspend()
3796 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_resume() local
3811 clear_bit(__IXGBEVF_DISABLED, &adapter->state); in ixgbevf_resume()
3814 ixgbevf_reset(adapter); in ixgbevf_resume()
3817 err = ixgbevf_init_interrupt_scheme(adapter); in ixgbevf_resume()
3844 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_get_stats() local
3850 ixgbevf_update_stats(adapter); in ixgbevf_get_stats()
3852 stats->multicast = adapter->stats.vfmprc - adapter->stats.base_vfmprc; in ixgbevf_get_stats()
3854 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbevf_get_stats()
3855 ring = adapter->rx_ring[i]; in ixgbevf_get_stats()
3865 for (i = 0; i < adapter->num_tx_queues; i++) { in ixgbevf_get_stats()
3866 ring = adapter->tx_ring[i]; in ixgbevf_get_stats()
3920 struct ixgbevf_adapter *adapter = NULL; in ixgbevf_probe() local
3958 adapter = netdev_priv(netdev); in ixgbevf_probe()
3960 adapter->netdev = netdev; in ixgbevf_probe()
3961 adapter->pdev = pdev; in ixgbevf_probe()
3962 hw = &adapter->hw; in ixgbevf_probe()
3963 hw->back = adapter; in ixgbevf_probe()
3964 adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); in ixgbevf_probe()
3973 adapter->io_addr = hw->hw_addr; in ixgbevf_probe()
3989 err = ixgbevf_sw_init(adapter); in ixgbevf_probe()
4028 setup_timer(&adapter->service_timer, &ixgbevf_service_timer, in ixgbevf_probe()
4029 (unsigned long)adapter); in ixgbevf_probe()
4031 INIT_WORK(&adapter->service_task, ixgbevf_service_task); in ixgbevf_probe()
4032 set_bit(__IXGBEVF_SERVICE_INITED, &adapter->state); in ixgbevf_probe()
4033 clear_bit(__IXGBEVF_SERVICE_SCHED, &adapter->state); in ixgbevf_probe()
4035 err = ixgbevf_init_interrupt_scheme(adapter); in ixgbevf_probe()
4048 ixgbevf_init_last_counter_stats(adapter); in ixgbevf_probe()
4070 ixgbevf_clear_interrupt_scheme(adapter); in ixgbevf_probe()
4072 ixgbevf_reset_interrupt_capability(adapter); in ixgbevf_probe()
4073 iounmap(adapter->io_addr); in ixgbevf_probe()
4075 disable_dev = !test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state); in ixgbevf_probe()
4081 if (!adapter || disable_dev) in ixgbevf_probe()
4098 struct ixgbevf_adapter *adapter; in ixgbevf_remove() local
4104 adapter = netdev_priv(netdev); in ixgbevf_remove()
4106 set_bit(__IXGBEVF_REMOVING, &adapter->state); in ixgbevf_remove()
4107 cancel_work_sync(&adapter->service_task); in ixgbevf_remove()
4112 ixgbevf_clear_interrupt_scheme(adapter); in ixgbevf_remove()
4113 ixgbevf_reset_interrupt_capability(adapter); in ixgbevf_remove()
4115 iounmap(adapter->io_addr); in ixgbevf_remove()
4118 hw_dbg(&adapter->hw, "Remove complete\n"); in ixgbevf_remove()
4120 disable_dev = !test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state); in ixgbevf_remove()
4139 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_io_error_detected() local
4141 if (!test_bit(__IXGBEVF_SERVICE_INITED, &adapter->state)) in ixgbevf_io_error_detected()
4153 ixgbevf_down(adapter); in ixgbevf_io_error_detected()
4155 if (!test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state)) in ixgbevf_io_error_detected()
4173 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_io_slot_reset() local
4182 clear_bit(__IXGBEVF_DISABLED, &adapter->state); in ixgbevf_io_slot_reset()
4185 ixgbevf_reset(adapter); in ixgbevf_io_slot_reset()
4201 struct ixgbevf_adapter *adapter = netdev_priv(netdev); in ixgbevf_io_resume() local
4204 ixgbevf_up(adapter); in ixgbevf_io_resume()
4269 struct ixgbevf_adapter *adapter = hw->back; in ixgbevf_get_hw_dev_name() local
4271 return adapter->netdev->name; in ixgbevf_get_hw_dev_name()