Lines Matching full:interface

14 #define DRV_SUMMARY	"Intel(R) Ethernet Switch Host Interface Driver"
173 * Synchronizes page for reuse by the interface
246 * true if the buffer can be reused by the interface.
634 struct fm10k_intfc *interface = netdev_priv(skb->dev); in fm10k_port_is_vxlan() local
636 if (interface->vxlan_port != udp_hdr(skb)->dest) in fm10k_port_is_vxlan()
1112 struct fm10k_intfc *interface = ring->q_vector->interface; in fm10k_get_tx_pending() local
1113 struct fm10k_hw *hw = &interface->hw; in fm10k_get_tx_pending()
1158 * @interface: driver private struct
1160 void fm10k_tx_timeout_reset(struct fm10k_intfc *interface) in fm10k_tx_timeout_reset() argument
1163 if (!test_bit(__FM10K_DOWN, interface->state)) { in fm10k_tx_timeout_reset()
1164 interface->tx_timeout_count++; in fm10k_tx_timeout_reset()
1165 set_bit(FM10K_FLAG_RESET_REQUESTED, interface->flags); in fm10k_tx_timeout_reset()
1166 fm10k_service_event_schedule(interface); in fm10k_tx_timeout_reset()
1179 struct fm10k_intfc *interface = q_vector->interface; in fm10k_clean_tx_irq() local
1186 if (test_bit(__FM10K_DOWN, interface->state)) in fm10k_clean_tx_irq()
1276 struct fm10k_hw *hw = &interface->hw; in fm10k_clean_tx_irq()
1278 netif_err(interface, drv, tx_ring->netdev, in fm10k_clean_tx_irq()
1292 netif_info(interface, probe, tx_ring->netdev, in fm10k_clean_tx_irq()
1293 "tx hang %d detected on queue %d, resetting interface\n", in fm10k_clean_tx_irq()
1294 interface->tx_timeout_count + 1, in fm10k_clean_tx_irq()
1297 fm10k_tx_timeout_reset(interface); in fm10k_clean_tx_irq()
1316 !test_bit(__FM10K_DOWN, interface->state)) { in fm10k_clean_tx_irq()
1466 * @interface: board private structure to initialize
1475 static bool fm10k_set_qos_queues(struct fm10k_intfc *interface) in fm10k_set_qos_queues() argument
1477 struct net_device *dev = interface->netdev; in fm10k_set_qos_queues()
1489 f = &interface->ring_feature[RING_F_QOS]; in fm10k_set_qos_queues()
1494 rss_i = interface->hw.mac.max_queues / pcs; in fm10k_set_qos_queues()
1498 f = &interface->ring_feature[RING_F_RSS]; in fm10k_set_qos_queues()
1507 interface->num_rx_queues = rss_i * pcs; in fm10k_set_qos_queues()
1508 interface->num_tx_queues = rss_i * pcs; in fm10k_set_qos_queues()
1515 * @interface: board private structure to initialize
1521 static bool fm10k_set_rss_queues(struct fm10k_intfc *interface) in fm10k_set_rss_queues() argument
1526 f = &interface->ring_feature[RING_F_RSS]; in fm10k_set_rss_queues()
1527 rss_i = min_t(u16, interface->hw.mac.max_queues, f->limit); in fm10k_set_rss_queues()
1533 interface->num_rx_queues = rss_i; in fm10k_set_rss_queues()
1534 interface->num_tx_queues = rss_i; in fm10k_set_rss_queues()
1541 * @interface: board private structure to initialize
1550 static void fm10k_set_num_queues(struct fm10k_intfc *interface) in fm10k_set_num_queues() argument
1553 if (fm10k_set_qos_queues(interface)) in fm10k_set_num_queues()
1557 fm10k_set_rss_queues(interface); in fm10k_set_num_queues()
1562 * @interface: board private structure
1567 static void fm10k_reset_num_queues(struct fm10k_intfc *interface) in fm10k_reset_num_queues() argument
1569 interface->num_tx_queues = 0; in fm10k_reset_num_queues()
1570 interface->num_rx_queues = 0; in fm10k_reset_num_queues()
1571 interface->num_q_vectors = 0; in fm10k_reset_num_queues()
1576 * @interface: board private structure to initialize
1577 * @v_count: q_vectors allocated on interface, used for ring interleaving
1578 * @v_idx: index of vector in interface struct
1586 static int fm10k_alloc_q_vector(struct fm10k_intfc *interface, in fm10k_alloc_q_vector() argument
1603 netif_napi_add(interface->netdev, &q_vector->napi, in fm10k_alloc_q_vector()
1606 /* tie q_vector and interface together */ in fm10k_alloc_q_vector()
1607 interface->q_vector[v_idx] = q_vector; in fm10k_alloc_q_vector()
1608 q_vector->interface = interface; in fm10k_alloc_q_vector()
1617 q_vector->tx.itr = interface->tx_itr; in fm10k_alloc_q_vector()
1618 q_vector->tx.itr_scale = interface->hw.mac.itr_scale; in fm10k_alloc_q_vector()
1623 ring->dev = &interface->pdev->dev; in fm10k_alloc_q_vector()
1624 ring->netdev = interface->netdev; in fm10k_alloc_q_vector()
1630 ring->count = interface->tx_ring_count; in fm10k_alloc_q_vector()
1633 /* assign ring to interface */ in fm10k_alloc_q_vector()
1634 interface->tx_ring[txr_idx] = ring; in fm10k_alloc_q_vector()
1646 q_vector->rx.itr = interface->rx_itr; in fm10k_alloc_q_vector()
1647 q_vector->rx.itr_scale = interface->hw.mac.itr_scale; in fm10k_alloc_q_vector()
1652 ring->dev = &interface->pdev->dev; in fm10k_alloc_q_vector()
1653 ring->netdev = interface->netdev; in fm10k_alloc_q_vector()
1654 rcu_assign_pointer(ring->l2_accel, interface->l2_accel); in fm10k_alloc_q_vector()
1660 ring->count = interface->rx_ring_count; in fm10k_alloc_q_vector()
1663 /* assign ring to interface */ in fm10k_alloc_q_vector()
1664 interface->rx_ring[rxr_idx] = ring; in fm10k_alloc_q_vector()
1681 * @interface: board private structure to initialize
1688 static void fm10k_free_q_vector(struct fm10k_intfc *interface, int v_idx) in fm10k_free_q_vector() argument
1690 struct fm10k_q_vector *q_vector = interface->q_vector[v_idx]; in fm10k_free_q_vector()
1696 interface->tx_ring[ring->queue_index] = NULL; in fm10k_free_q_vector()
1699 interface->rx_ring[ring->queue_index] = NULL; in fm10k_free_q_vector()
1701 interface->q_vector[v_idx] = NULL; in fm10k_free_q_vector()
1708 * @interface: board private structure to initialize
1713 static int fm10k_alloc_q_vectors(struct fm10k_intfc *interface) in fm10k_alloc_q_vectors() argument
1715 unsigned int q_vectors = interface->num_q_vectors; in fm10k_alloc_q_vectors()
1716 unsigned int rxr_remaining = interface->num_rx_queues; in fm10k_alloc_q_vectors()
1717 unsigned int txr_remaining = interface->num_tx_queues; in fm10k_alloc_q_vectors()
1723 err = fm10k_alloc_q_vector(interface, q_vectors, v_idx, in fm10k_alloc_q_vectors()
1738 err = fm10k_alloc_q_vector(interface, q_vectors, v_idx, in fm10k_alloc_q_vectors()
1755 fm10k_reset_num_queues(interface); in fm10k_alloc_q_vectors()
1758 fm10k_free_q_vector(interface, v_idx); in fm10k_alloc_q_vectors()
1765 * @interface: board private structure to initialize
1771 static void fm10k_free_q_vectors(struct fm10k_intfc *interface) in fm10k_free_q_vectors() argument
1773 int v_idx = interface->num_q_vectors; in fm10k_free_q_vectors()
1775 fm10k_reset_num_queues(interface); in fm10k_free_q_vectors()
1778 fm10k_free_q_vector(interface, v_idx); in fm10k_free_q_vectors()
1783 * @interface: board private structure to initialize
1787 static void fm10k_reset_msix_capability(struct fm10k_intfc *interface) in fm10k_reset_msix_capability() argument
1789 pci_disable_msix(interface->pdev); in fm10k_reset_msix_capability()
1790 kfree(interface->msix_entries); in fm10k_reset_msix_capability()
1791 interface->msix_entries = NULL; in fm10k_reset_msix_capability()
1796 * @interface: board private structure to initialize
1801 static int fm10k_init_msix_capability(struct fm10k_intfc *interface) in fm10k_init_msix_capability() argument
1803 struct fm10k_hw *hw = &interface->hw; in fm10k_init_msix_capability()
1812 v_budget = max(interface->num_rx_queues, interface->num_tx_queues); in fm10k_init_msix_capability()
1827 interface->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry), in fm10k_init_msix_capability()
1829 if (!interface->msix_entries) in fm10k_init_msix_capability()
1834 interface->msix_entries[vector].entry = vector; in fm10k_init_msix_capability()
1837 v_budget = pci_enable_msix_range(interface->pdev, in fm10k_init_msix_capability()
1838 interface->msix_entries, in fm10k_init_msix_capability()
1842 kfree(interface->msix_entries); in fm10k_init_msix_capability()
1843 interface->msix_entries = NULL; in fm10k_init_msix_capability()
1848 interface->num_q_vectors = v_budget - NON_Q_VECTORS; in fm10k_init_msix_capability()
1855 * @interface: Interface structure continaining rings and devices
1859 static bool fm10k_cache_ring_qos(struct fm10k_intfc *interface) in fm10k_cache_ring_qos() argument
1861 struct net_device *dev = interface->netdev; in fm10k_cache_ring_qos()
1863 u16 pc_stride = interface->ring_feature[RING_F_QOS].mask + 1; in fm10k_cache_ring_qos()
1869 rss_i = interface->ring_feature[RING_F_RSS].indices; in fm10k_cache_ring_qos()
1875 interface->tx_ring[offset + i]->reg_idx = q_idx; in fm10k_cache_ring_qos()
1876 interface->tx_ring[offset + i]->qos_pc = pc; in fm10k_cache_ring_qos()
1877 interface->rx_ring[offset + i]->reg_idx = q_idx; in fm10k_cache_ring_qos()
1878 interface->rx_ring[offset + i]->qos_pc = pc; in fm10k_cache_ring_qos()
1888 * @interface: Interface structure continaining rings and devices
1892 static void fm10k_cache_ring_rss(struct fm10k_intfc *interface) in fm10k_cache_ring_rss() argument
1896 for (i = 0; i < interface->num_rx_queues; i++) in fm10k_cache_ring_rss()
1897 interface->rx_ring[i]->reg_idx = i; in fm10k_cache_ring_rss()
1899 for (i = 0; i < interface->num_tx_queues; i++) in fm10k_cache_ring_rss()
1900 interface->tx_ring[i]->reg_idx = i; in fm10k_cache_ring_rss()
1905 * @interface: Interface structure containing rings and devices
1911 static void fm10k_assign_rings(struct fm10k_intfc *interface) in fm10k_assign_rings() argument
1913 if (fm10k_cache_ring_qos(interface)) in fm10k_assign_rings()
1916 fm10k_cache_ring_rss(interface); in fm10k_assign_rings()
1919 static void fm10k_init_reta(struct fm10k_intfc *interface) in fm10k_init_reta() argument
1921 u16 i, rss_i = interface->ring_feature[RING_F_RSS].indices; in fm10k_init_reta()
1927 if (netif_is_rxfh_configured(interface->netdev)) { in fm10k_init_reta()
1929 reta = interface->reta[i]; in fm10k_init_reta()
1937 dev_err(&interface->pdev->dev, in fm10k_init_reta()
1947 fm10k_write_reta(interface, NULL); in fm10k_init_reta()
1952 * @interface: board private structure to initialize
1958 int fm10k_init_queueing_scheme(struct fm10k_intfc *interface) in fm10k_init_queueing_scheme() argument
1963 fm10k_set_num_queues(interface); in fm10k_init_queueing_scheme()
1966 err = fm10k_init_msix_capability(interface); in fm10k_init_queueing_scheme()
1968 dev_err(&interface->pdev->dev, in fm10k_init_queueing_scheme()
1974 err = fm10k_alloc_q_vectors(interface); in fm10k_init_queueing_scheme()
1976 dev_err(&interface->pdev->dev, in fm10k_init_queueing_scheme()
1982 fm10k_assign_rings(interface); in fm10k_init_queueing_scheme()
1985 fm10k_init_reta(interface); in fm10k_init_queueing_scheme()
1990 fm10k_reset_msix_capability(interface); in fm10k_init_queueing_scheme()
1992 fm10k_reset_num_queues(interface); in fm10k_init_queueing_scheme()
1998 * @interface: board private structure to clear queueing scheme on
2003 void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface) in fm10k_clear_queueing_scheme() argument
2005 fm10k_free_q_vectors(interface); in fm10k_clear_queueing_scheme()
2006 fm10k_reset_msix_capability(interface); in fm10k_clear_queueing_scheme()