Lines Matching +full:tx +full:- +full:queues +full:- +full:to +full:- +full:use
1 /* SPDX-License-Identifier: GPL-2.0 */
19 #include <linux/dma-mapping.h>
82 #define ICE_RES_MISC_VEC_ID (ICE_RES_VALID_BIT - 1)
92 #define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - ICE_ETH_PKT_HDR_PAD)
98 #define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
99 #define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
100 #define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
101 #define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
105 for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++)
107 /* Macros for each Tx/Rx ring in a VSI */
109 for ((i) = 0; (i) < (vsi)->num_txq; (i)++)
112 for ((i) = 0; (i) < (vsi)->num_rxq; (i)++)
114 /* Macros for each allocated Tx/Rx ring whether used or not in a VSI */
116 for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++)
119 for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++)
122 for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)
141 #define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
144 u32 q_teid; /* Tx-scheduler element identifier */
146 u16 q_handle; /* Relative index of Tx queue within TC */
147 u16 vsi_idx; /* VSI index that Tx queue belongs to */
148 u8 tc; /* TC number that Tx queue belongs to */
160 u8 ena_tc; /* Tx map */
171 struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
204 /* When checking for the PF to be in a nominal operating state, the
205 * bits that are grouped at the beginning of the list need to be
207 * be checked. If you need to add a bit into consideration for nominal
243 struct ice_pf *back; /* back pointer to PF */
244 struct ice_port_info *port_info; /* back pointer to port_info */
246 struct ice_ring **tx_rings; /* Tx ring array */
264 u16 idx; /* software index in pf->vsi[] */
266 s16 vf_id; /* VF ID for SR-IOV VSIs */
274 u16 rss_size; /* Allocated RSS queues */
277 u8 rss_lut_type; /* used to configure Get/Set RSS LUT AQ call */
281 #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
301 struct list_head tmp_sync_list; /* MAC filters to be synced */
302 struct list_head tmp_unsync_list; /* MAC filters to be unsynced */
313 u16 *txq_map; /* index in pf->avail_txqs */
314 u16 *rxq_map; /* index in pf->avail_rxqs */
315 u16 alloc_txq; /* Allocated Tx queues */
316 u16 num_txq; /* Used Tx queues */
317 u16 alloc_rxq; /* Allocated Rx queues */
318 u16 num_rxq; /* Used Rx queues */
319 u16 req_txq; /* User requested Tx queues */
320 u16 req_rxq; /* User requested Rx queues */
326 u16 num_xdp_txq; /* Used XDP queues */
337 u16 v_idx; /* index in the vsi->q_vector array. */
340 u8 num_ring_tx; /* total number of Tx rings in vector */
342 /* in usecs, need to use ice_intrl_to_usecs_reg() before writing this
343 * value to the device
350 struct ice_ring_container tx; member
388 /* First MSIX vector used by SR-IOV VFs. Calculated by subtracting the
389 * number of MSIX vectors needed for all SR-IOV VFs from the number of
394 u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
398 /* Virtchnl/SR-IOV config info */
404 /* used to ratelimit the MDD event logging */
408 unsigned long *avail_txqs; /* bitmap to track PF Tx queue usage */
409 unsigned long *avail_rxqs; /* bitmap to track PF Rx queue usage */
414 struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */
416 struct mutex tc_mutex; /* lock to protect TC changes */
419 /* spinlock to protect the AdminQ wait list */
427 u16 max_pf_txqs; /* Total Tx queues PF wide */
428 u16 max_pf_rxqs; /* Total Rx queues PF wide */
430 u16 num_lan_tx; /* num LAN Tx queues setup */
431 u16 num_lan_rx; /* num LAN Rx queues setup */
432 u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
464 * ice_irq_dynamic_ena - Enable default interrupt generation settings
465 * @hw: pointer to HW struct
466 * @vsi: pointer to VSI struct, can be NULL
467 * @q_vector: pointer to q_vector, can be NULL
473 u32 vector = (vsi && q_vector) ? q_vector->reg_idx : in ice_irq_dynamic_ena()
474 ((struct ice_pf *)hw->back)->oicr_idx; in ice_irq_dynamic_ena()
478 /* clear the PBA here, as this function is meant to clean out all in ice_irq_dynamic_ena()
484 if (test_bit(__ICE_DOWN, vsi->state)) in ice_irq_dynamic_ena()
490 * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev
491 * @netdev: pointer to the netdev struct
497 return np->vsi->back; in ice_netdev_to_pf()
502 return !!vsi->xdp_prog; in ice_is_xdp_ena_vsi()
507 ring->flags |= ICE_TX_FLAGS_RING_XDP; in ice_set_ring_xdp()
511 * ice_xsk_pool - get XSK buffer pool bound to a ring
512 * @ring: ring to use
514 * Returns a pointer to xdp_umem structure if there is a buffer pool present,
519 struct xsk_buff_pool **pools = ring->vsi->xsk_pools; in ice_xsk_pool()
520 u16 qid = ring->q_index; in ice_xsk_pool()
523 qid -= ring->vsi->num_xdp_txq; in ice_xsk_pool()
525 if (qid >= ring->vsi->num_xsk_pools || !pools || !pools[qid] || in ice_xsk_pool()
526 !ice_is_xdp_ena_vsi(ring->vsi)) in ice_xsk_pool()
533 * ice_get_main_vsi - Get the PF VSI
536 * returns pf->vsi[0], which by definition is the PF VSI
540 if (pf->vsi) in ice_get_main_vsi()
541 return pf->vsi[0]; in ice_get_main_vsi()
547 * ice_get_ctrl_vsi - Get the control VSI
552 /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ in ice_get_ctrl_vsi()
553 if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) in ice_get_ctrl_vsi()
556 return pf->vsi[pf->ctrl_vsi_idx]; in ice_get_ctrl_vsi()