Lines Matching full:interface
14 #define DRV_SUMMARY "Intel(R) Ethernet Switch Host Interface Driver"
181 * Synchronizes page for reuse by the interface
249 * true if the buffer can be reused by the interface.
637 struct fm10k_intfc *interface = netdev_priv(skb->dev); in fm10k_port_is_vxlan() local
639 if (interface->vxlan_port != udp_hdr(skb)->dest) in fm10k_port_is_vxlan()
1115 struct fm10k_intfc *interface = ring->q_vector->interface; in fm10k_get_tx_pending() local
1116 struct fm10k_hw *hw = &interface->hw; in fm10k_get_tx_pending()
1161 * @interface: driver private struct
1163 void fm10k_tx_timeout_reset(struct fm10k_intfc *interface) in fm10k_tx_timeout_reset() argument
1166 if (!test_bit(__FM10K_DOWN, interface->state)) { in fm10k_tx_timeout_reset()
1167 interface->tx_timeout_count++; in fm10k_tx_timeout_reset()
1168 set_bit(FM10K_FLAG_RESET_REQUESTED, interface->flags); in fm10k_tx_timeout_reset()
1169 fm10k_service_event_schedule(interface); in fm10k_tx_timeout_reset()
1182 struct fm10k_intfc *interface = q_vector->interface; in fm10k_clean_tx_irq() local
1189 if (test_bit(__FM10K_DOWN, interface->state)) in fm10k_clean_tx_irq()
1279 struct fm10k_hw *hw = &interface->hw; in fm10k_clean_tx_irq()
1281 netif_err(interface, drv, tx_ring->netdev, in fm10k_clean_tx_irq()
1295 netif_info(interface, probe, tx_ring->netdev, in fm10k_clean_tx_irq()
1296 "tx hang %d detected on queue %d, resetting interface\n", in fm10k_clean_tx_irq()
1297 interface->tx_timeout_count + 1, in fm10k_clean_tx_irq()
1300 fm10k_tx_timeout_reset(interface); in fm10k_clean_tx_irq()
1319 !test_bit(__FM10K_DOWN, interface->state)) { in fm10k_clean_tx_irq()
1469 * @interface: board private structure to initialize
1478 static bool fm10k_set_qos_queues(struct fm10k_intfc *interface) in fm10k_set_qos_queues() argument
1480 struct net_device *dev = interface->netdev; in fm10k_set_qos_queues()
1492 f = &interface->ring_feature[RING_F_QOS]; in fm10k_set_qos_queues()
1497 rss_i = interface->hw.mac.max_queues / pcs; in fm10k_set_qos_queues()
1501 f = &interface->ring_feature[RING_F_RSS]; in fm10k_set_qos_queues()
1510 interface->num_rx_queues = rss_i * pcs; in fm10k_set_qos_queues()
1511 interface->num_tx_queues = rss_i * pcs; in fm10k_set_qos_queues()
1518 * @interface: board private structure to initialize
1524 static bool fm10k_set_rss_queues(struct fm10k_intfc *interface) in fm10k_set_rss_queues() argument
1529 f = &interface->ring_feature[RING_F_RSS]; in fm10k_set_rss_queues()
1530 rss_i = min_t(u16, interface->hw.mac.max_queues, f->limit); in fm10k_set_rss_queues()
1536 interface->num_rx_queues = rss_i; in fm10k_set_rss_queues()
1537 interface->num_tx_queues = rss_i; in fm10k_set_rss_queues()
1544 * @interface: board private structure to initialize
1553 static void fm10k_set_num_queues(struct fm10k_intfc *interface) in fm10k_set_num_queues() argument
1556 if (fm10k_set_qos_queues(interface)) in fm10k_set_num_queues()
1560 fm10k_set_rss_queues(interface); in fm10k_set_num_queues()
1565 * @interface: board private structure
1570 static void fm10k_reset_num_queues(struct fm10k_intfc *interface) in fm10k_reset_num_queues() argument
1572 interface->num_tx_queues = 0; in fm10k_reset_num_queues()
1573 interface->num_rx_queues = 0; in fm10k_reset_num_queues()
1574 interface->num_q_vectors = 0; in fm10k_reset_num_queues()
1579 * @interface: board private structure to initialize
1580 * @v_count: q_vectors allocated on interface, used for ring interleaving
1581 * @v_idx: index of vector in interface struct
1589 static int fm10k_alloc_q_vector(struct fm10k_intfc *interface, in fm10k_alloc_q_vector() argument
1606 netif_napi_add(interface->netdev, &q_vector->napi, fm10k_poll); in fm10k_alloc_q_vector()
1608 /* tie q_vector and interface together */ in fm10k_alloc_q_vector()
1609 interface->q_vector[v_idx] = q_vector; in fm10k_alloc_q_vector()
1610 q_vector->interface = interface; in fm10k_alloc_q_vector()
1619 q_vector->tx.itr = interface->tx_itr; in fm10k_alloc_q_vector()
1620 q_vector->tx.itr_scale = interface->hw.mac.itr_scale; in fm10k_alloc_q_vector()
1625 ring->dev = &interface->pdev->dev; in fm10k_alloc_q_vector()
1626 ring->netdev = interface->netdev; in fm10k_alloc_q_vector()
1632 ring->count = interface->tx_ring_count; in fm10k_alloc_q_vector()
1635 /* assign ring to interface */ in fm10k_alloc_q_vector()
1636 interface->tx_ring[txr_idx] = ring; in fm10k_alloc_q_vector()
1648 q_vector->rx.itr = interface->rx_itr; in fm10k_alloc_q_vector()
1649 q_vector->rx.itr_scale = interface->hw.mac.itr_scale; in fm10k_alloc_q_vector()
1654 ring->dev = &interface->pdev->dev; in fm10k_alloc_q_vector()
1655 ring->netdev = interface->netdev; in fm10k_alloc_q_vector()
1656 rcu_assign_pointer(ring->l2_accel, interface->l2_accel); in fm10k_alloc_q_vector()
1662 ring->count = interface->rx_ring_count; in fm10k_alloc_q_vector()
1665 /* assign ring to interface */ in fm10k_alloc_q_vector()
1666 interface->rx_ring[rxr_idx] = ring; in fm10k_alloc_q_vector()
1683 * @interface: board private structure to initialize
1690 static void fm10k_free_q_vector(struct fm10k_intfc *interface, int v_idx) in fm10k_free_q_vector() argument
1692 struct fm10k_q_vector *q_vector = interface->q_vector[v_idx]; in fm10k_free_q_vector()
1698 interface->tx_ring[ring->queue_index] = NULL; in fm10k_free_q_vector()
1701 interface->rx_ring[ring->queue_index] = NULL; in fm10k_free_q_vector()
1703 interface->q_vector[v_idx] = NULL; in fm10k_free_q_vector()
1710 * @interface: board private structure to initialize
1715 static int fm10k_alloc_q_vectors(struct fm10k_intfc *interface) in fm10k_alloc_q_vectors() argument
1717 unsigned int q_vectors = interface->num_q_vectors; in fm10k_alloc_q_vectors()
1718 unsigned int rxr_remaining = interface->num_rx_queues; in fm10k_alloc_q_vectors()
1719 unsigned int txr_remaining = interface->num_tx_queues; in fm10k_alloc_q_vectors()
1725 err = fm10k_alloc_q_vector(interface, q_vectors, v_idx, in fm10k_alloc_q_vectors()
1740 err = fm10k_alloc_q_vector(interface, q_vectors, v_idx, in fm10k_alloc_q_vectors()
1757 fm10k_reset_num_queues(interface); in fm10k_alloc_q_vectors()
1760 fm10k_free_q_vector(interface, v_idx); in fm10k_alloc_q_vectors()
1767 * @interface: board private structure to initialize
1773 static void fm10k_free_q_vectors(struct fm10k_intfc *interface) in fm10k_free_q_vectors() argument
1775 int v_idx = interface->num_q_vectors; in fm10k_free_q_vectors()
1777 fm10k_reset_num_queues(interface); in fm10k_free_q_vectors()
1780 fm10k_free_q_vector(interface, v_idx); in fm10k_free_q_vectors()
1785 * @interface: board private structure to initialize
1789 static void fm10k_reset_msix_capability(struct fm10k_intfc *interface) in fm10k_reset_msix_capability() argument
1791 pci_disable_msix(interface->pdev); in fm10k_reset_msix_capability()
1792 kfree(interface->msix_entries); in fm10k_reset_msix_capability()
1793 interface->msix_entries = NULL; in fm10k_reset_msix_capability()
1798 * @interface: board private structure to initialize
1803 static int fm10k_init_msix_capability(struct fm10k_intfc *interface) in fm10k_init_msix_capability() argument
1805 struct fm10k_hw *hw = &interface->hw; in fm10k_init_msix_capability()
1814 v_budget = max(interface->num_rx_queues, interface->num_tx_queues); in fm10k_init_msix_capability()
1829 interface->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry), in fm10k_init_msix_capability()
1831 if (!interface->msix_entries) in fm10k_init_msix_capability()
1836 interface->msix_entries[vector].entry = vector; in fm10k_init_msix_capability()
1839 v_budget = pci_enable_msix_range(interface->pdev, in fm10k_init_msix_capability()
1840 interface->msix_entries, in fm10k_init_msix_capability()
1844 kfree(interface->msix_entries); in fm10k_init_msix_capability()
1845 interface->msix_entries = NULL; in fm10k_init_msix_capability()
1850 interface->num_q_vectors = v_budget - NON_Q_VECTORS; in fm10k_init_msix_capability()
1857 * @interface: Interface structure continaining rings and devices
1861 static bool fm10k_cache_ring_qos(struct fm10k_intfc *interface) in fm10k_cache_ring_qos() argument
1863 struct net_device *dev = interface->netdev; in fm10k_cache_ring_qos()
1865 u16 pc_stride = interface->ring_feature[RING_F_QOS].mask + 1; in fm10k_cache_ring_qos()
1871 rss_i = interface->ring_feature[RING_F_RSS].indices; in fm10k_cache_ring_qos()
1877 interface->tx_ring[offset + i]->reg_idx = q_idx; in fm10k_cache_ring_qos()
1878 interface->tx_ring[offset + i]->qos_pc = pc; in fm10k_cache_ring_qos()
1879 interface->rx_ring[offset + i]->reg_idx = q_idx; in fm10k_cache_ring_qos()
1880 interface->rx_ring[offset + i]->qos_pc = pc; in fm10k_cache_ring_qos()
1890 * @interface: Interface structure continaining rings and devices
1894 static void fm10k_cache_ring_rss(struct fm10k_intfc *interface) in fm10k_cache_ring_rss() argument
1898 for (i = 0; i < interface->num_rx_queues; i++) in fm10k_cache_ring_rss()
1899 interface->rx_ring[i]->reg_idx = i; in fm10k_cache_ring_rss()
1901 for (i = 0; i < interface->num_tx_queues; i++) in fm10k_cache_ring_rss()
1902 interface->tx_ring[i]->reg_idx = i; in fm10k_cache_ring_rss()
1907 * @interface: Interface structure containing rings and devices
1913 static void fm10k_assign_rings(struct fm10k_intfc *interface) in fm10k_assign_rings() argument
1915 if (fm10k_cache_ring_qos(interface)) in fm10k_assign_rings()
1918 fm10k_cache_ring_rss(interface); in fm10k_assign_rings()
1921 static void fm10k_init_reta(struct fm10k_intfc *interface) in fm10k_init_reta() argument
1923 u16 i, rss_i = interface->ring_feature[RING_F_RSS].indices; in fm10k_init_reta()
1929 if (netif_is_rxfh_configured(interface->netdev)) { in fm10k_init_reta()
1931 reta = interface->reta[i]; in fm10k_init_reta()
1939 dev_err(&interface->pdev->dev, in fm10k_init_reta()
1949 fm10k_write_reta(interface, NULL); in fm10k_init_reta()
1954 * @interface: board private structure to initialize
1960 int fm10k_init_queueing_scheme(struct fm10k_intfc *interface) in fm10k_init_queueing_scheme() argument
1965 fm10k_set_num_queues(interface); in fm10k_init_queueing_scheme()
1968 err = fm10k_init_msix_capability(interface); in fm10k_init_queueing_scheme()
1970 dev_err(&interface->pdev->dev, in fm10k_init_queueing_scheme()
1976 err = fm10k_alloc_q_vectors(interface); in fm10k_init_queueing_scheme()
1978 dev_err(&interface->pdev->dev, in fm10k_init_queueing_scheme()
1984 fm10k_assign_rings(interface); in fm10k_init_queueing_scheme()
1987 fm10k_init_reta(interface); in fm10k_init_queueing_scheme()
1992 fm10k_reset_msix_capability(interface); in fm10k_init_queueing_scheme()
1994 fm10k_reset_num_queues(interface); in fm10k_init_queueing_scheme()
2000 * @interface: board private structure to clear queueing scheme on
2005 void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface) in fm10k_clear_queueing_scheme() argument
2007 fm10k_free_q_vectors(interface); in fm10k_clear_queueing_scheme()
2008 fm10k_reset_msix_capability(interface); in fm10k_clear_queueing_scheme()