Lines Matching +full:rx +full:- +full:queues +full:- +full:config
1 /* SPDX-License-Identifier: GPL-2.0 */
19 #include <linux/dma-mapping.h>
89 #define ICE_MAX_NUM_DESC_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \
115 #define ICE_MAX_RXQS_PER_TC 256 /* Used when setting VSI context per TC Rx queues */
125 #define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - ICE_ETH_PKT_HDR_PAD)
133 #define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
134 #define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
135 #define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
136 #define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
162 for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++)
164 /* Macros for each Tx/Xdp/Rx ring in a VSI */
166 for ((i) = 0; (i) < (vsi)->num_txq; (i)++)
169 for ((i) = 0; (i) < (vsi)->num_xdp_txq; (i)++)
172 for ((i) = 0; (i) < (vsi)->num_rxq; (i)++)
174 /* Macros for each allocated Tx/Rx ring whether used or not in a VSI */
176 for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++)
179 for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++)
182 for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)
199 #define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
235 u32 q_teid; /* Tx-scheduler element identifier */
256 struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
311 ICE_FD_VF_FLUSH_CTX, /* set at FD Rx IRQ or timeout */
330 struct ice_ring_stats **rx_ring_stats; /* Rx ring stats array */
338 struct ice_rx_ring **rx_rings; /* Rx ring array */
356 u16 idx; /* software index in pf->vsi[] */
361 /* RSS config */
363 u16 rss_size; /* Allocated RSS queues */
371 #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
378 struct ice_vsi_vlan_info vlan_info; /* vlan config to be restored */
399 u16 *txq_map; /* index in pf->avail_txqs */
400 u16 *rxq_map; /* index in pf->avail_rxqs */
401 u16 alloc_txq; /* Allocated Tx queues */
402 u16 num_txq; /* Used Tx queues */
403 u16 alloc_rxq; /* Allocated Rx queues */
404 u16 num_rxq; /* Used Rx queues */
405 u16 req_txq; /* User requested Tx queues */
406 u16 req_rxq; /* User requested Rx queues */
412 u16 num_xdp_txq; /* Used XDP queues */
430 * it can be used after tc-qdisc delete, to get back RSS setting as
435 * and inclusive of ADQ, vsi->mqprio_opt keeps track of queue
468 u16 v_idx; /* index in the vsi->q_vector array. */
470 u8 num_ring_rx; /* total number of Rx rings in vector */
480 struct ice_ring_container rx; member
569 u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
582 unsigned long *avail_rxqs; /* bitmap to track PF Rx queue usage */
588 struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */
612 u16 max_pf_txqs; /* Total Tx queues PF wide */
613 u16 max_pf_rxqs; /* Total Rx queues PF wide */
615 u16 num_lan_tx; /* num LAN Tx queues setup */
616 u16 num_lan_rx; /* num LAN Rx queues setup */
617 u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
695 return !!qv->ch; /* Enable it to run with TC */ in ice_vector_ch_enabled()
699 * ice_ptp_pf_handles_tx_interrupt - Check if PF handles Tx interrupt
707 return pf->ptp.tx_interrupt_mode != ICE_PTP_TX_INTERRUPT_NONE; in ice_ptp_pf_handles_tx_interrupt()
711 * ice_irq_dynamic_ena - Enable default interrupt generation settings
720 u32 vector = (vsi && q_vector) ? q_vector->reg_idx : in ice_irq_dynamic_ena()
721 ((struct ice_pf *)hw->back)->oicr_irq.index; in ice_irq_dynamic_ena()
731 if (test_bit(ICE_VSI_DOWN, vsi->state)) in ice_irq_dynamic_ena()
737 * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev
744 return np->vsi->back; in ice_netdev_to_pf()
749 return !!READ_ONCE(vsi->xdp_prog); in ice_is_xdp_ena_vsi()
754 ring->flags |= ICE_TX_FLAGS_RING_XDP; in ice_set_ring_xdp()
758 * ice_is_txtime_ena - check if Tx Time is enabled on the Tx ring
765 struct ice_vsi *vsi = ring->vsi; in ice_is_txtime_ena()
766 struct ice_pf *pf = vsi->back; in ice_is_txtime_ena()
768 return test_bit(ring->q_index, pf->txtime_txqs); in ice_is_txtime_ena()
772 * ice_is_txtime_cfg - check if Tx Time is configured on the Tx ring
779 return !!(ring->flags & ICE_TX_FLAGS_TXTIME); in ice_is_txtime_cfg()
783 * ice_get_xp_from_qid - get ZC XSK buffer pool bound to a queue ID
788 * attached and configured as zero-copy, NULL otherwise.
793 struct xsk_buff_pool *pool = xsk_get_pool_from_qid(vsi->netdev, qid); in ice_get_xp_from_qid()
798 return (pool && pool->dev) ? pool : NULL; in ice_get_xp_from_qid()
802 * ice_rx_xsk_pool - assign XSK buff pool to Rx ring
803 * @ring: Rx ring to use
805 * Sets XSK buff pool pointer on Rx ring.
809 struct ice_vsi *vsi = ring->vsi; in ice_rx_xsk_pool()
810 u16 qid = ring->q_index; in ice_rx_xsk_pool()
812 WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); in ice_rx_xsk_pool()
816 * ice_tx_xsk_pool - assign XSK buff pool to XDP ring
822 * XDP ring is picked from Rx ring, whereas Rx ring is picked based on provided
824 * than one XDP ring, e.g. when user reduced the queue count on netdev; Rx ring
827 * rx_ring->xdp_ring assignment that was done during XDP rings initialization.
833 ring = vsi->rx_rings[qid]->xdp_ring; in ice_tx_xsk_pool()
837 WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); in ice_tx_xsk_pool()
841 * ice_get_main_vsi - Get the PF VSI
844 * returns pf->vsi[0], which by definition is the PF VSI
848 if (pf->vsi) in ice_get_main_vsi()
849 return pf->vsi[0]; in ice_get_main_vsi()
855 * ice_get_netdev_priv_vsi - return VSI associated with netdev priv.
861 if (np->repr) in ice_get_netdev_priv_vsi()
862 return np->repr->src_vsi; in ice_get_netdev_priv_vsi()
864 return np->vsi; in ice_get_netdev_priv_vsi()
868 * ice_get_ctrl_vsi - Get the control VSI
873 /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ in ice_get_ctrl_vsi()
874 if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) in ice_get_ctrl_vsi()
877 return pf->vsi[pf->ctrl_vsi_idx]; in ice_get_ctrl_vsi()
881 * ice_find_vsi - Find the VSI from VSI ID
890 if (pf->vsi[i] && pf->vsi[i]->vsi_num == vsi_num) in ice_find_vsi()
891 return pf->vsi[i]; in ice_find_vsi()
896 * ice_is_switchdev_running - check if switchdev is configured
904 return pf->eswitch.is_running; in ice_is_switchdev_running()
916 * ice_is_adq_active - any active ADQs
932 if (vsi->tc_cfg.numtc > ICE_CHNL_START_TC && in ice_is_adq_active()
933 test_bit(ICE_FLAG_TC_MQPRIO, pf->flags)) in ice_is_adq_active()
968 ICE_XDP_CFG_FULL, /* Fully apply new config in .ndo_bpf() */
969 ICE_XDP_CFG_PART, /* Save/use part of config in VSI rebuild */
1047 * ice_set_rdma_cap - enable RDMA support
1052 if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { in ice_set_rdma_cap()
1053 set_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_set_rdma_cap()
1054 set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_set_rdma_cap()
1059 * ice_clear_rdma_cap - disable RDMA support
1067 clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1068 set_bit(ICE_FLAG_UNPLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1069 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_clear_rdma_cap()
1075 * ice_is_dual - Check if given config is multi-NAC
1078 * Return: true if the device is running in mutli-NAC (Network
1080 * (always false for non-E825 devices).
1084 return hw->mac_type == ICE_MAC_GENERIC_3K_E825 && in ice_is_dual()
1085 (hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M); in ice_is_dual()
1089 * ice_is_primary - Check if given device belongs to the primary complex
1092 * Check if given PF/HW is running on primary complex in multi-NAC
1096 * for non-E825 devices).
1100 return hw->mac_type != ICE_MAC_GENERIC_3K_E825 || in ice_is_primary()
1102 (hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_PRIMARY_M); in ice_is_primary()
1106 * ice_pf_src_tmr_owned - Check if a primary timer is owned by PF
1113 return pf->hw.func_caps.ts_func_info.src_tmr_owned && in ice_pf_src_tmr_owned()
1114 ice_is_primary(&pf->hw); in ice_pf_src_tmr_owned()
1118 * ice_get_primary_hw - Get pointer to primary ice_hw structure
1126 if (!pf->adapter->ctrl_pf) in ice_get_primary_hw()
1127 return &pf->hw; in ice_get_primary_hw()
1129 return &pf->adapter->ctrl_pf->hw; in ice_get_primary_hw()