Lines Matching +full:num +full:- +full:rx +full:- +full:queues
1 /* SPDX-License-Identifier: GPL-2.0 */
19 #include <linux/dma-mapping.h>
112 #define ICE_MAX_RXQS_PER_TC 256 /* Used when setting VSI context per TC Rx queues */
122 #define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - ICE_ETH_PKT_HDR_PAD)
130 #define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
131 #define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
132 #define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
133 #define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
159 for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++)
161 /* Macros for each Tx/Xdp/Rx ring in a VSI */
163 for ((i) = 0; (i) < (vsi)->num_txq; (i)++)
166 for ((i) = 0; (i) < (vsi)->num_xdp_txq; (i)++)
169 for ((i) = 0; (i) < (vsi)->num_rxq; (i)++)
171 /* Macros for each allocated Tx/Rx ring whether used or not in a VSI */
173 for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++)
176 for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++)
179 for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)
198 #define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
200 #define ice_pf_src_tmr_owned(pf) ((pf)->hw.func_caps.ts_func_info.src_tmr_owned)
232 u32 q_teid; /* Tx-scheduler element identifier */
253 struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
308 ICE_FD_VF_FLUSH_CTX, /* set at FD Rx IRQ or timeout */
327 struct ice_ring_stats **rx_ring_stats; /* Rx ring stats array */
335 struct ice_rx_ring **rx_rings; /* Rx ring array */
353 u16 idx; /* software index in pf->vsi[] */
360 u16 rss_size; /* Allocated RSS queues */
368 #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
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 */
413 u16 num_xdp_txq; /* Used XDP queues */
431 * it can be used after tc-qdisc delete, to get back RSS setting as
436 * and inclusive of ADQ, vsi->mqprio_opt keeps track of queue
469 u16 v_idx; /* index in the vsi->q_vector array. */
471 u8 num_ring_rx; /* total number of Rx rings in vector */
481 struct ice_ring_container rx; member
562 /* First MSIX vector used by SR-IOV VFs. Calculated by subtracting the
563 * number of MSIX vectors needed for all SR-IOV VFs from the number of
570 u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
586 unsigned long *avail_rxqs; /* bitmap to track PF Rx queue usage */
591 struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */
616 u16 max_pf_txqs; /* Total Tx queues PF wide */
617 u16 max_pf_rxqs; /* Total Rx queues PF wide */
619 u16 num_lan_tx; /* num LAN Tx queues setup */
620 u16 num_lan_rx; /* num LAN Rx queues setup */
621 u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
696 return !!qv->ch; /* Enable it to run with TC */ in ice_vector_ch_enabled()
700 * ice_ptp_pf_handles_tx_interrupt - Check if PF handles Tx interrupt
708 return pf->ptp.tx_interrupt_mode != ICE_PTP_TX_INTERRUPT_NONE; in ice_ptp_pf_handles_tx_interrupt()
712 * ice_irq_dynamic_ena - Enable default interrupt generation settings
721 u32 vector = (vsi && q_vector) ? q_vector->reg_idx : in ice_irq_dynamic_ena()
722 ((struct ice_pf *)hw->back)->oicr_irq.index; in ice_irq_dynamic_ena()
732 if (test_bit(ICE_VSI_DOWN, vsi->state)) in ice_irq_dynamic_ena()
738 * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev
745 return np->vsi->back; in ice_netdev_to_pf()
750 return !!READ_ONCE(vsi->xdp_prog); in ice_is_xdp_ena_vsi()
755 ring->flags |= ICE_TX_FLAGS_RING_XDP; in ice_set_ring_xdp()
759 * ice_get_xp_from_qid - get ZC XSK buffer pool bound to a queue ID
764 * attached and configured as zero-copy, NULL otherwise.
769 struct xsk_buff_pool *pool = xsk_get_pool_from_qid(vsi->netdev, qid); in ice_get_xp_from_qid()
774 return (pool && pool->dev) ? pool : NULL; in ice_get_xp_from_qid()
778 * ice_rx_xsk_pool - assign XSK buff pool to Rx ring
779 * @ring: Rx ring to use
781 * Sets XSK buff pool pointer on Rx ring.
785 struct ice_vsi *vsi = ring->vsi; in ice_rx_xsk_pool()
786 u16 qid = ring->q_index; in ice_rx_xsk_pool()
788 WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); in ice_rx_xsk_pool()
792 * ice_tx_xsk_pool - assign XSK buff pool to XDP ring
798 * XDP ring is picked from Rx ring, whereas Rx ring is picked based on provided
800 * than one XDP ring, e.g. when user reduced the queue count on netdev; Rx ring
803 * rx_ring->xdp_ring assignment that was done during XDP rings initialization.
809 ring = vsi->rx_rings[qid]->xdp_ring; in ice_tx_xsk_pool()
813 WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); in ice_tx_xsk_pool()
817 * ice_get_main_vsi - Get the PF VSI
820 * returns pf->vsi[0], which by definition is the PF VSI
824 if (pf->vsi) in ice_get_main_vsi()
825 return pf->vsi[0]; in ice_get_main_vsi()
831 * ice_get_netdev_priv_vsi - return VSI associated with netdev priv.
837 if (np->repr) in ice_get_netdev_priv_vsi()
838 return np->repr->src_vsi; in ice_get_netdev_priv_vsi()
840 return np->vsi; in ice_get_netdev_priv_vsi()
844 * ice_get_ctrl_vsi - Get the control VSI
849 /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ in ice_get_ctrl_vsi()
850 if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) in ice_get_ctrl_vsi()
853 return pf->vsi[pf->ctrl_vsi_idx]; in ice_get_ctrl_vsi()
857 * ice_find_vsi - Find the VSI from VSI ID
866 if (pf->vsi[i] && pf->vsi[i]->vsi_num == vsi_num) in ice_find_vsi()
867 return pf->vsi[i]; in ice_find_vsi()
872 * ice_is_switchdev_running - check if switchdev is configured
880 return pf->eswitch.is_running; in ice_is_switchdev_running()
892 * ice_is_adq_active - any active ADQs
908 if (vsi->tc_cfg.numtc > ICE_CHNL_START_TC && in ice_is_adq_active()
909 test_bit(ICE_FLAG_TC_MQPRIO, pf->flags)) in ice_is_adq_active()
1025 * ice_set_rdma_cap - enable RDMA support
1030 if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { in ice_set_rdma_cap()
1031 set_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_set_rdma_cap()
1032 set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_set_rdma_cap()
1037 * ice_clear_rdma_cap - disable RDMA support
1045 clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1046 set_bit(ICE_FLAG_UNPLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1047 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_clear_rdma_cap()