Lines Matching full:interface
14 #define DRV_SUMMARY "Intel(R) Ethernet Switch Host Interface Driver"
180 * Synchronizes page for reuse by the interface
248 * true if the buffer can be reused by the interface.
636 struct fm10k_intfc *interface = netdev_priv(skb->dev); in fm10k_port_is_vxlan() local
638 if (interface->vxlan_port != udp_hdr(skb)->dest) in fm10k_port_is_vxlan()
1114 struct fm10k_intfc *interface = ring->q_vector->interface; in fm10k_get_tx_pending() local
1115 struct fm10k_hw *hw = &interface->hw; in fm10k_get_tx_pending()
1160 * @interface: driver private struct
1162 void fm10k_tx_timeout_reset(struct fm10k_intfc *interface) in fm10k_tx_timeout_reset() argument
1165 if (!test_bit(__FM10K_DOWN, interface->state)) { in fm10k_tx_timeout_reset()
1166 interface->tx_timeout_count++; in fm10k_tx_timeout_reset()
1167 set_bit(FM10K_FLAG_RESET_REQUESTED, interface->flags); in fm10k_tx_timeout_reset()
1168 fm10k_service_event_schedule(interface); in fm10k_tx_timeout_reset()
1181 struct fm10k_intfc *interface = q_vector->interface; in fm10k_clean_tx_irq() local
1188 if (test_bit(__FM10K_DOWN, interface->state)) in fm10k_clean_tx_irq()
1278 struct fm10k_hw *hw = &interface->hw; in fm10k_clean_tx_irq()
1280 netif_err(interface, drv, tx_ring->netdev, in fm10k_clean_tx_irq()
1294 netif_info(interface, probe, tx_ring->netdev, in fm10k_clean_tx_irq()
1295 "tx hang %d detected on queue %d, resetting interface\n", in fm10k_clean_tx_irq()
1296 interface->tx_timeout_count + 1, in fm10k_clean_tx_irq()
1299 fm10k_tx_timeout_reset(interface); in fm10k_clean_tx_irq()
1318 !test_bit(__FM10K_DOWN, interface->state)) { in fm10k_clean_tx_irq()
1468 * @interface: board private structure to initialize
1477 static bool fm10k_set_qos_queues(struct fm10k_intfc *interface) in fm10k_set_qos_queues() argument
1479 struct net_device *dev = interface->netdev; in fm10k_set_qos_queues()
1491 f = &interface->ring_feature[RING_F_QOS]; in fm10k_set_qos_queues()
1496 rss_i = interface->hw.mac.max_queues / pcs; in fm10k_set_qos_queues()
1500 f = &interface->ring_feature[RING_F_RSS]; in fm10k_set_qos_queues()
1509 interface->num_rx_queues = rss_i * pcs; in fm10k_set_qos_queues()
1510 interface->num_tx_queues = rss_i * pcs; in fm10k_set_qos_queues()
1517 * @interface: board private structure to initialize
1523 static bool fm10k_set_rss_queues(struct fm10k_intfc *interface) in fm10k_set_rss_queues() argument
1528 f = &interface->ring_feature[RING_F_RSS]; in fm10k_set_rss_queues()
1529 rss_i = min_t(u16, interface->hw.mac.max_queues, f->limit); in fm10k_set_rss_queues()
1535 interface->num_rx_queues = rss_i; in fm10k_set_rss_queues()
1536 interface->num_tx_queues = rss_i; in fm10k_set_rss_queues()
1543 * @interface: board private structure to initialize
1552 static void fm10k_set_num_queues(struct fm10k_intfc *interface) in fm10k_set_num_queues() argument
1555 if (fm10k_set_qos_queues(interface)) in fm10k_set_num_queues()
1559 fm10k_set_rss_queues(interface); in fm10k_set_num_queues()
1564 * @interface: board private structure
1569 static void fm10k_reset_num_queues(struct fm10k_intfc *interface) in fm10k_reset_num_queues() argument
1571 interface->num_tx_queues = 0; in fm10k_reset_num_queues()
1572 interface->num_rx_queues = 0; in fm10k_reset_num_queues()
1573 interface->num_q_vectors = 0; in fm10k_reset_num_queues()
1578 * @interface: board private structure to initialize
1579 * @v_count: q_vectors allocated on interface, used for ring interleaving
1580 * @v_idx: index of vector in interface struct
1588 static int fm10k_alloc_q_vector(struct fm10k_intfc *interface, in fm10k_alloc_q_vector() argument
1605 netif_napi_add(interface->netdev, &q_vector->napi, fm10k_poll); in fm10k_alloc_q_vector()
1607 /* tie q_vector and interface together */ in fm10k_alloc_q_vector()
1608 interface->q_vector[v_idx] = q_vector; in fm10k_alloc_q_vector()
1609 q_vector->interface = interface; in fm10k_alloc_q_vector()
1618 q_vector->tx.itr = interface->tx_itr; in fm10k_alloc_q_vector()
1619 q_vector->tx.itr_scale = interface->hw.mac.itr_scale; in fm10k_alloc_q_vector()
1624 ring->dev = &interface->pdev->dev; in fm10k_alloc_q_vector()
1625 ring->netdev = interface->netdev; in fm10k_alloc_q_vector()
1631 ring->count = interface->tx_ring_count; in fm10k_alloc_q_vector()
1634 /* assign ring to interface */ in fm10k_alloc_q_vector()
1635 interface->tx_ring[txr_idx] = ring; in fm10k_alloc_q_vector()
1647 q_vector->rx.itr = interface->rx_itr; in fm10k_alloc_q_vector()
1648 q_vector->rx.itr_scale = interface->hw.mac.itr_scale; in fm10k_alloc_q_vector()
1653 ring->dev = &interface->pdev->dev; in fm10k_alloc_q_vector()
1654 ring->netdev = interface->netdev; in fm10k_alloc_q_vector()
1655 rcu_assign_pointer(ring->l2_accel, interface->l2_accel); in fm10k_alloc_q_vector()
1661 ring->count = interface->rx_ring_count; in fm10k_alloc_q_vector()
1664 /* assign ring to interface */ in fm10k_alloc_q_vector()
1665 interface->rx_ring[rxr_idx] = ring; in fm10k_alloc_q_vector()
1682 * @interface: board private structure to initialize
1689 static void fm10k_free_q_vector(struct fm10k_intfc *interface, int v_idx) in fm10k_free_q_vector() argument
1691 struct fm10k_q_vector *q_vector = interface->q_vector[v_idx]; in fm10k_free_q_vector()
1697 interface->tx_ring[ring->queue_index] = NULL; in fm10k_free_q_vector()
1700 interface->rx_ring[ring->queue_index] = NULL; in fm10k_free_q_vector()
1702 interface->q_vector[v_idx] = NULL; in fm10k_free_q_vector()
1709 * @interface: board private structure to initialize
1714 static int fm10k_alloc_q_vectors(struct fm10k_intfc *interface) in fm10k_alloc_q_vectors() argument
1716 unsigned int q_vectors = interface->num_q_vectors; in fm10k_alloc_q_vectors()
1717 unsigned int rxr_remaining = interface->num_rx_queues; in fm10k_alloc_q_vectors()
1718 unsigned int txr_remaining = interface->num_tx_queues; in fm10k_alloc_q_vectors()
1724 err = fm10k_alloc_q_vector(interface, q_vectors, v_idx, in fm10k_alloc_q_vectors()
1739 err = fm10k_alloc_q_vector(interface, q_vectors, v_idx, in fm10k_alloc_q_vectors()
1756 fm10k_reset_num_queues(interface); in fm10k_alloc_q_vectors()
1759 fm10k_free_q_vector(interface, v_idx); in fm10k_alloc_q_vectors()
1766 * @interface: board private structure to initialize
1772 static void fm10k_free_q_vectors(struct fm10k_intfc *interface) in fm10k_free_q_vectors() argument
1774 int v_idx = interface->num_q_vectors; in fm10k_free_q_vectors()
1776 fm10k_reset_num_queues(interface); in fm10k_free_q_vectors()
1779 fm10k_free_q_vector(interface, v_idx); in fm10k_free_q_vectors()
1784 * @interface: board private structure to initialize
1788 static void fm10k_reset_msix_capability(struct fm10k_intfc *interface) in fm10k_reset_msix_capability() argument
1790 pci_disable_msix(interface->pdev); in fm10k_reset_msix_capability()
1791 kfree(interface->msix_entries); in fm10k_reset_msix_capability()
1792 interface->msix_entries = NULL; in fm10k_reset_msix_capability()
1797 * @interface: board private structure to initialize
1802 static int fm10k_init_msix_capability(struct fm10k_intfc *interface) in fm10k_init_msix_capability() argument
1804 struct fm10k_hw *hw = &interface->hw; in fm10k_init_msix_capability()
1813 v_budget = max(interface->num_rx_queues, interface->num_tx_queues); in fm10k_init_msix_capability()
1828 interface->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry), in fm10k_init_msix_capability()
1830 if (!interface->msix_entries) in fm10k_init_msix_capability()
1835 interface->msix_entries[vector].entry = vector; in fm10k_init_msix_capability()
1838 v_budget = pci_enable_msix_range(interface->pdev, in fm10k_init_msix_capability()
1839 interface->msix_entries, in fm10k_init_msix_capability()
1843 kfree(interface->msix_entries); in fm10k_init_msix_capability()
1844 interface->msix_entries = NULL; in fm10k_init_msix_capability()
1849 interface->num_q_vectors = v_budget - NON_Q_VECTORS; in fm10k_init_msix_capability()
1856 * @interface: Interface structure continaining rings and devices
1860 static bool fm10k_cache_ring_qos(struct fm10k_intfc *interface) in fm10k_cache_ring_qos() argument
1862 struct net_device *dev = interface->netdev; in fm10k_cache_ring_qos()
1864 u16 pc_stride = interface->ring_feature[RING_F_QOS].mask + 1; in fm10k_cache_ring_qos()
1870 rss_i = interface->ring_feature[RING_F_RSS].indices; in fm10k_cache_ring_qos()
1876 interface->tx_ring[offset + i]->reg_idx = q_idx; in fm10k_cache_ring_qos()
1877 interface->tx_ring[offset + i]->qos_pc = pc; in fm10k_cache_ring_qos()
1878 interface->rx_ring[offset + i]->reg_idx = q_idx; in fm10k_cache_ring_qos()
1879 interface->rx_ring[offset + i]->qos_pc = pc; in fm10k_cache_ring_qos()
1889 * @interface: Interface structure continaining rings and devices
1893 static void fm10k_cache_ring_rss(struct fm10k_intfc *interface) in fm10k_cache_ring_rss() argument
1897 for (i = 0; i < interface->num_rx_queues; i++) in fm10k_cache_ring_rss()
1898 interface->rx_ring[i]->reg_idx = i; in fm10k_cache_ring_rss()
1900 for (i = 0; i < interface->num_tx_queues; i++) in fm10k_cache_ring_rss()
1901 interface->tx_ring[i]->reg_idx = i; in fm10k_cache_ring_rss()
1906 * @interface: Interface structure containing rings and devices
1912 static void fm10k_assign_rings(struct fm10k_intfc *interface) in fm10k_assign_rings() argument
1914 if (fm10k_cache_ring_qos(interface)) in fm10k_assign_rings()
1917 fm10k_cache_ring_rss(interface); in fm10k_assign_rings()
1920 static void fm10k_init_reta(struct fm10k_intfc *interface) in fm10k_init_reta() argument
1922 u16 i, rss_i = interface->ring_feature[RING_F_RSS].indices; in fm10k_init_reta()
1928 if (netif_is_rxfh_configured(interface->netdev)) { in fm10k_init_reta()
1930 reta = interface->reta[i]; in fm10k_init_reta()
1938 dev_err(&interface->pdev->dev, in fm10k_init_reta()
1948 fm10k_write_reta(interface, NULL); in fm10k_init_reta()
1953 * @interface: board private structure to initialize
1959 int fm10k_init_queueing_scheme(struct fm10k_intfc *interface) in fm10k_init_queueing_scheme() argument
1964 fm10k_set_num_queues(interface); in fm10k_init_queueing_scheme()
1967 err = fm10k_init_msix_capability(interface); in fm10k_init_queueing_scheme()
1969 dev_err(&interface->pdev->dev, in fm10k_init_queueing_scheme()
1975 err = fm10k_alloc_q_vectors(interface); in fm10k_init_queueing_scheme()
1977 dev_err(&interface->pdev->dev, in fm10k_init_queueing_scheme()
1983 fm10k_assign_rings(interface); in fm10k_init_queueing_scheme()
1986 fm10k_init_reta(interface); in fm10k_init_queueing_scheme()
1991 fm10k_reset_msix_capability(interface); in fm10k_init_queueing_scheme()
1993 fm10k_reset_num_queues(interface); in fm10k_init_queueing_scheme()
1999 * @interface: board private structure to clear queueing scheme on
2004 void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface) in fm10k_clear_queueing_scheme() argument
2006 fm10k_free_q_vectors(interface); in fm10k_clear_queueing_scheme()
2007 fm10k_reset_msix_capability(interface); in fm10k_clear_queueing_scheme()