Lines Matching +full:rx +full:- +full:queues +full:- +full:to +full:- +full:use

1 /* SPDX-License-Identifier: GPL-2.0 */
19 #include <linux/dma-mapping.h>
111 #define ICE_MAX_RXQS_PER_TC 256 /* Used when setting VSI context per TC Rx queues */
121 #define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - ICE_ETH_PKT_HDR_PAD)
129 #define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
130 #define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
131 #define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
132 #define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
137 * use it to convert user specified BW limit into Kbps
143 * filters need new recipe to be created for specified extraction sequence
148 /* prio 6 is reserved for future use (e.g. switch filter with L3 fields +
158 for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++)
160 /* Macros for each Tx/Xdp/Rx ring in a VSI */
162 for ((i) = 0; (i) < (vsi)->num_txq; (i)++)
165 for ((i) = 0; (i) < (vsi)->num_xdp_txq; (i)++)
168 for ((i) = 0; (i) < (vsi)->num_rxq; (i)++)
170 /* Macros for each allocated Tx/Rx ring whether used or not in a VSI */
172 for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++)
175 for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++)
178 for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)
197 #define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
199 #define ice_pf_src_tmr_owned(pf) ((pf)->hw.func_caps.ts_func_info.src_tmr_owned)
231 u32 q_teid; /* Tx-scheduler element identifier */
234 u16 vsi_idx; /* VSI index that Tx queue belongs to */
235 u8 tc; /* TC number that Tx queue belongs to */
252 struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
282 /* When checking for the PF to be in a nominal operating state, the
283 * bits that are grouped at the beginning of the list need to be
285 * be checked. If you need to add a bit into consideration for nominal
307 ICE_FD_VF_FLUSH_CTX, /* set at FD Rx IRQ or timeout */
325 struct ice_ring_stats **rx_ring_stats; /* Rx ring stats array */
332 struct ice_pf *back; /* back pointer to PF */
333 struct ice_port_info *port_info; /* back pointer to port_info */
334 struct ice_rx_ring **rx_rings; /* Rx ring array */
353 u16 idx; /* software index in pf->vsi[] */
362 u16 rss_size; /* Allocated RSS queues */
366 u8 rss_lut_type; /* used to configure Get/Set RSS LUT AQ call */
370 #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
380 struct ice_vsi_vlan_info vlan_info; /* vlan config to be restored */
388 struct list_head tmp_sync_list; /* MAC filters to be synced */
389 struct list_head tmp_unsync_list; /* MAC filters to be unsynced */
401 u16 *txq_map; /* index in pf->avail_txqs */
402 u16 *rxq_map; /* index in pf->avail_rxqs */
403 u16 alloc_txq; /* Allocated Tx queues */
404 u16 num_txq; /* Used Tx queues */
405 u16 alloc_rxq; /* Allocated Rx queues */
406 u16 num_rxq; /* Used Rx queues */
407 u16 req_txq; /* User requested Tx queues */
408 u16 req_rxq; /* User requested Rx queues */
416 u16 num_xdp_txq; /* Used XDP queues */
426 u16 next_base_q; /* next queue to be used for channel setup */
433 * it can be used after tc-qdisc delete, to get back RSS setting as
438 * and inclusive of ADQ, vsi->mqprio_opt keeps track of queue
444 /* store away TC info, to be used for rebuild logic */
450 /* setup back reference, to which aggregator node this VSI
451 * corresponds to
460 u16 v_idx; /* index in the vsi->q_vector array. */
462 u8 num_ring_rx; /* total number of Rx rings in vector */
465 /* in usecs, need to use ice_intrl_to_usecs_reg() before writing this
466 * value to the device
472 struct ice_ring_container rx; member
531 /* struct to allow cp queues management optimization */
559 /* First MSIX vector used by SR-IOV VFs. Calculated by subtracting the
560 * number of MSIX vectors needed for all SR-IOV VFs from the number of
564 unsigned long *sriov_irq_bm; /* bitmap to track irq usage */
567 u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
582 unsigned long *avail_txqs; /* bitmap to track PF Tx queue usage */
583 unsigned long *avail_rxqs; /* bitmap to track PF Rx queue usage */
588 struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */
590 struct mutex tc_mutex; /* lock to protect TC changes */
591 struct mutex adev_mutex; /* lock to protect aux device access */
600 /* spinlock to protect the AdminQ wait list */
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! */
640 /* count of tc_flower filters specific to channel (aka where filter
675 * tc_indr_block_cb_priv_list is used to look up indirect callback
683 * @qv: pointer to q_vector, can be NULL
689 return !!qv->ch; /* Enable it to run with TC */ in ice_vector_ch_enabled()
693 * ice_ptp_pf_handles_tx_interrupt - Check if PF handles Tx interrupt
696 * Return true if this PF should respond to the Tx timestamp interrupt
701 return pf->ptp.tx_interrupt_mode != ICE_PTP_TX_INTERRUPT_NONE; in ice_ptp_pf_handles_tx_interrupt()
705 * ice_irq_dynamic_ena - Enable default interrupt generation settings
706 * @hw: pointer to HW struct
707 * @vsi: pointer to VSI struct, can be NULL
708 * @q_vector: pointer to q_vector, can be NULL
714 u32 vector = (vsi && q_vector) ? q_vector->reg_idx : in ice_irq_dynamic_ena()
715 ((struct ice_pf *)hw->back)->oicr_irq.index; in ice_irq_dynamic_ena()
719 /* clear the PBA here, as this function is meant to clean out all in ice_irq_dynamic_ena()
725 if (test_bit(ICE_VSI_DOWN, vsi->state)) in ice_irq_dynamic_ena()
731 * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev
732 * @netdev: pointer to the netdev struct
738 return np->vsi->back; in ice_netdev_to_pf()
743 return !!READ_ONCE(vsi->xdp_prog); in ice_is_xdp_ena_vsi()
748 ring->flags |= ICE_TX_FLAGS_RING_XDP; in ice_set_ring_xdp()
752 * ice_xsk_pool - get XSK buffer pool bound to a ring
753 * @ring: Rx ring to use
755 * Returns a pointer to xsk_buff_pool structure if there is a buffer pool
760 struct ice_vsi *vsi = ring->vsi; in ice_xsk_pool()
761 u16 qid = ring->q_index; in ice_xsk_pool()
763 if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps)) in ice_xsk_pool()
766 return xsk_get_pool_from_qid(vsi->netdev, qid); in ice_xsk_pool()
770 * ice_tx_xsk_pool - assign XSK buff pool to XDP ring
771 * @vsi: pointer to VSI
772 * @qid: index of a queue to look at XSK buff pool presence
776 * XDP ring is picked from Rx ring, whereas Rx ring is picked based on provided
778 * than one XDP ring, e.g. when user reduced the queue count on netdev; Rx ring
779 * carries a pointer to one of these XDP rings for its own purposes, such as
781 * rx_ring->xdp_ring assignment that was done during XDP rings initialization.
787 ring = vsi->rx_rings[qid]->xdp_ring; in ice_tx_xsk_pool()
791 if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps)) { in ice_tx_xsk_pool()
792 ring->xsk_pool = NULL; in ice_tx_xsk_pool()
796 ring->xsk_pool = xsk_get_pool_from_qid(vsi->netdev, qid); in ice_tx_xsk_pool()
800 * ice_get_main_vsi - Get the PF VSI
803 * returns pf->vsi[0], which by definition is the PF VSI
807 if (pf->vsi) in ice_get_main_vsi()
808 return pf->vsi[0]; in ice_get_main_vsi()
814 * ice_get_netdev_priv_vsi - return VSI associated with netdev priv.
820 if (np->repr) in ice_get_netdev_priv_vsi()
821 return np->repr->src_vsi; in ice_get_netdev_priv_vsi()
823 return np->vsi; in ice_get_netdev_priv_vsi()
827 * ice_get_ctrl_vsi - Get the control VSI
832 /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ in ice_get_ctrl_vsi()
833 if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) in ice_get_ctrl_vsi()
836 return pf->vsi[pf->ctrl_vsi_idx]; in ice_get_ctrl_vsi()
840 * ice_find_vsi - Find the VSI from VSI ID
841 * @pf: The PF pointer to search in
842 * @vsi_num: The VSI ID to search for
849 if (pf->vsi[i] && pf->vsi[i]->vsi_num == vsi_num) in ice_find_vsi()
850 return pf->vsi[i]; in ice_find_vsi()
855 * ice_is_switchdev_running - check if switchdev is configured
856 * @pf: pointer to PF structure
858 * Returns true if eswitch mode is set to DEVLINK_ESWITCH_MODE_SWITCHDEV
863 return pf->eswitch.is_running; in ice_is_switchdev_running()
875 * ice_is_adq_active - any active ADQs
876 * @pf: pointer to PF
891 if (vsi->tc_cfg.numtc > ICE_CHNL_START_TC && in ice_is_adq_active()
892 test_bit(ICE_FLAG_TC_MQPRIO, pf->flags)) in ice_is_adq_active()
988 * ice_set_rdma_cap - enable RDMA support
993 if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { in ice_set_rdma_cap()
994 set_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_set_rdma_cap()
995 set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_set_rdma_cap()
1000 * ice_clear_rdma_cap - disable RDMA support
1005 /* defer unplug to service task to avoid RTNL lock and in ice_clear_rdma_cap()
1008 clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1009 set_bit(ICE_FLAG_UNPLUG_AUX_DEV, pf->flags); in ice_clear_rdma_cap()
1010 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_clear_rdma_cap()