Lines Matching +full:num +full:- +full:tx +full:- +full:queues
1 /* SPDX-License-Identifier: GPL-2.0 */
19 #include <linux/dma-mapping.h>
110 #define ICE_MAX_RXQS_PER_TC 256 /* Used when setting VSI context per TC Rx queues */
120 #define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - ICE_ETH_PKT_HDR_PAD)
128 #define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
129 #define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
130 #define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
131 #define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
157 for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++)
159 /* Macros for each Tx/Xdp/Rx ring in a VSI */
161 for ((i) = 0; (i) < (vsi)->num_txq; (i)++)
164 for ((i) = 0; (i) < (vsi)->num_xdp_txq; (i)++)
167 for ((i) = 0; (i) < (vsi)->num_rxq; (i)++)
169 /* Macros for each allocated Tx/Rx ring whether used or not in a VSI */
171 for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++)
174 for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++)
177 for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)
194 #define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
196 #define ice_pf_src_tmr_owned(pf) ((pf)->hw.func_caps.ts_func_info.src_tmr_owned)
230 u32 q_teid; /* Tx-scheduler element identifier */
232 u16 q_handle; /* Relative index of Tx queue within TC */
233 u16 vsi_idx; /* VSI index that Tx queue belongs to */
234 u8 tc; /* TC number that Tx queue belongs to */
246 u16 ena_tc; /* Tx map */
251 struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
324 struct ice_ring_stats **tx_ring_stats; /* Tx ring stats array */
334 struct ice_tx_ring **tx_rings; /* Tx ring array */
351 u16 idx; /* software index in pf->vsi[] */
358 u16 rss_size; /* Allocated RSS queues */
366 #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
394 u16 *txq_map; /* index in pf->avail_txqs */
395 u16 *rxq_map; /* index in pf->avail_rxqs */
396 u16 alloc_txq; /* Allocated Tx queues */
397 u16 num_txq; /* Used Tx queues */
398 u16 alloc_rxq; /* Allocated Rx queues */
399 u16 num_rxq; /* Used Rx queues */
400 u16 req_txq; /* User requested Tx queues */
401 u16 req_rxq; /* User requested Rx queues */
408 u16 num_xdp_txq; /* Used XDP queues */
426 * it can be used after tc-qdisc delete, to get back RSS setting as
431 * and inclusive of ADQ, vsi->mqprio_opt keeps track of queue
464 u16 v_idx; /* index in the vsi->q_vector array. */
467 u8 num_ring_tx; /* total number of Tx rings in vector */
477 struct ice_ring_container tx; member
564 u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
579 unsigned long *avail_txqs; /* bitmap to track PF Tx queue usage */
585 struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */
610 u16 max_pf_txqs; /* Total Tx queues PF wide */
611 u16 max_pf_rxqs; /* Total Rx queues PF wide */
613 u16 num_lan_tx; /* num LAN Tx queues setup */
614 u16 num_lan_rx; /* num LAN Rx queues setup */
615 u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
693 return !!qv->ch; /* Enable it to run with TC */ in ice_vector_ch_enabled()
697 * ice_ptp_pf_handles_tx_interrupt - Check if PF handles Tx interrupt
700 * Return true if this PF should respond to the Tx timestamp interrupt
705 return pf->ptp.tx_interrupt_mode != ICE_PTP_TX_INTERRUPT_NONE; in ice_ptp_pf_handles_tx_interrupt()
709 * ice_irq_dynamic_ena - Enable default interrupt generation settings
718 u32 vector = (vsi && q_vector) ? q_vector->reg_idx : in ice_irq_dynamic_ena()
719 ((struct ice_pf *)hw->back)->oicr_irq.index; in ice_irq_dynamic_ena()
729 if (test_bit(ICE_VSI_DOWN, vsi->state)) in ice_irq_dynamic_ena()
735 * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev
742 return np->vsi->back; in ice_netdev_to_pf()
747 return !!READ_ONCE(vsi->xdp_prog); in ice_is_xdp_ena_vsi()
752 ring->flags |= ICE_TX_FLAGS_RING_XDP; in ice_set_ring_xdp()
756 * ice_get_xp_from_qid - get ZC XSK buffer pool bound to a queue ID
761 * attached and configured as zero-copy, NULL otherwise.
766 struct xsk_buff_pool *pool = xsk_get_pool_from_qid(vsi->netdev, qid); in ice_get_xp_from_qid()
771 return (pool && pool->dev) ? pool : NULL; in ice_get_xp_from_qid()
775 * ice_rx_xsk_pool - assign XSK buff pool to Rx ring
782 struct ice_vsi *vsi = ring->vsi; in ice_rx_xsk_pool()
783 u16 qid = ring->q_index; in ice_rx_xsk_pool()
785 WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); in ice_rx_xsk_pool()
789 * ice_tx_xsk_pool - assign XSK buff pool to XDP ring
800 * rx_ring->xdp_ring assignment that was done during XDP rings initialization.
806 ring = vsi->rx_rings[qid]->xdp_ring; in ice_tx_xsk_pool()
810 WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); in ice_tx_xsk_pool()
814 * ice_get_main_vsi - Get the PF VSI
817 * returns pf->vsi[0], which by definition is the PF VSI
821 if (pf->vsi) in ice_get_main_vsi()
822 return pf->vsi[0]; in ice_get_main_vsi()
828 * ice_get_netdev_priv_vsi - return VSI associated with netdev priv.
834 if (np->repr) in ice_get_netdev_priv_vsi()
835 return np->repr->src_vsi; in ice_get_netdev_priv_vsi()
837 return np->vsi; in ice_get_netdev_priv_vsi()
841 * ice_get_ctrl_vsi - Get the control VSI
846 /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ in ice_get_ctrl_vsi()
847 if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) in ice_get_ctrl_vsi()
850 return pf->vsi[pf->ctrl_vsi_idx]; in ice_get_ctrl_vsi()
854 * ice_find_vsi - Find the VSI from VSI ID
863 if (pf->vsi[i] && pf->vsi[i]->vsi_num == vsi_num) in ice_find_vsi()
864 return pf->vsi[i]; in ice_find_vsi()
869 * ice_is_switchdev_running - check if switchdev is configured
877 return pf->eswitch.is_running; in ice_is_switchdev_running()
889 * ice_is_adq_active - any active ADQs
905 if (vsi->tc_cfg.numtc > ICE_CHNL_START_TC && in ice_is_adq_active()
906 test_bit(ICE_FLAG_TC_MQPRIO, pf->flags)) in ice_is_adq_active()
1022 * ice_set_rdma_cap - enable RDMA support
1027 if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { in ice_set_rdma_cap()
1028 set_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_set_rdma_cap()
1029 set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_set_rdma_cap()
1034 * ice_clear_rdma_cap - disable RDMA support
1042 clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1043 set_bit(ICE_FLAG_UNPLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1044 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_clear_rdma_cap()