Lines Matching +full:tcs +full:- +full:wait

1 /* SPDX-License-Identifier: GPL-2.0 */
19 #include <linux/dma-mapping.h>
22 #include <linux/wait.h>
106 #define ICE_RES_MISC_VEC_ID (ICE_RES_VALID_BIT - 1)
107 #define ICE_RES_RDMA_VEC_ID (ICE_RES_MISC_VEC_ID - 1)
109 #define ICE_RES_VF_CTRL_VEC_ID (ICE_RES_RDMA_VEC_ID - 1)
122 #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]))
142 for ((i) = 0; (i) < (pf)->num_alloc_vsi; (i)++)
146 for ((i) = 0; (i) < (vsi)->num_txq; (i)++)
149 for ((i) = 0; (i) < (vsi)->num_xdp_txq; (i)++)
152 for ((i) = 0; (i) < (vsi)->num_rxq; (i)++)
156 for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++)
159 for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++)
162 for ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)
181 #define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
210 u32 q_teid; /* Tx-scheduler element identifier */
225 u8 numtc; /* Total number of enabled TCs */
237 struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
331 u16 idx; /* software index in pf->vsi[] */
348 #define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
377 u16 *txq_map; /* index in pf->avail_txqs */
378 u16 *rxq_map; /* index in pf->avail_rxqs */
409 * it can be used after tc-qdisc delete, to get back RSS setting as
414 * and inclusive of ADQ, vsi->mqprio_opt keeps track of queue
436 u16 v_idx; /* index in the vsi->q_vector array. */
519 /* First MSIX vector used by SR-IOV VFs. Calculated by subtracting the
520 * number of MSIX vectors needed for all SR-IOV VFs from the number of
525 u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
552 /* spinlock to protect the AdminQ wait list */
569 u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
633 return !!qv->ch; /* Enable it to run with TC */ in ice_vector_ch_enabled()
637 * ice_irq_dynamic_ena - Enable default interrupt generation settings
646 u32 vector = (vsi && q_vector) ? q_vector->reg_idx : in ice_irq_dynamic_ena()
647 ((struct ice_pf *)hw->back)->oicr_idx; in ice_irq_dynamic_ena()
657 if (test_bit(ICE_VSI_DOWN, vsi->state)) in ice_irq_dynamic_ena()
663 * ice_netdev_to_pf - Retrieve the PF struct associated with a netdev
670 return np->vsi->back; in ice_netdev_to_pf()
675 return !!READ_ONCE(vsi->xdp_prog); in ice_is_xdp_ena_vsi()
680 ring->flags |= ICE_TX_FLAGS_RING_XDP; in ice_set_ring_xdp()
684 * ice_xsk_pool - get XSK buffer pool bound to a ring
692 struct ice_vsi *vsi = ring->vsi; in ice_xsk_pool()
693 u16 qid = ring->q_index; in ice_xsk_pool()
695 if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps)) in ice_xsk_pool()
698 return xsk_get_pool_from_qid(vsi->netdev, qid); in ice_xsk_pool()
702 * ice_tx_xsk_pool - assign XSK buff pool to XDP ring
713 * rx_ring->xdp_ring assignment that was done during XDP rings initialization.
719 ring = vsi->rx_rings[qid]->xdp_ring; in ice_tx_xsk_pool()
723 if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps)) { in ice_tx_xsk_pool()
724 ring->xsk_pool = NULL; in ice_tx_xsk_pool()
728 ring->xsk_pool = xsk_get_pool_from_qid(vsi->netdev, qid); in ice_tx_xsk_pool()
732 * ice_get_main_vsi - Get the PF VSI
735 * returns pf->vsi[0], which by definition is the PF VSI
739 if (pf->vsi) in ice_get_main_vsi()
740 return pf->vsi[0]; in ice_get_main_vsi()
746 * ice_get_netdev_priv_vsi - return VSI associated with netdev priv.
752 if (np->repr) in ice_get_netdev_priv_vsi()
753 return np->repr->src_vsi; in ice_get_netdev_priv_vsi()
755 return np->vsi; in ice_get_netdev_priv_vsi()
759 * ice_get_ctrl_vsi - Get the control VSI
764 /* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */ in ice_get_ctrl_vsi()
765 if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI) in ice_get_ctrl_vsi()
768 return pf->vsi[pf->ctrl_vsi_idx]; in ice_get_ctrl_vsi()
772 * ice_find_vsi - Find the VSI from VSI ID
781 if (pf->vsi[i] && pf->vsi[i]->vsi_num == vsi_num) in ice_find_vsi()
782 return pf->vsi[i]; in ice_find_vsi()
787 * ice_is_switchdev_running - check if switchdev is configured
795 return pf->switchdev.is_running; in ice_is_switchdev_running()
799 * ice_set_sriov_cap - enable SRIOV in PF flags
804 if (pf->hw.func_caps.common_cap.sr_iov_1_1) in ice_set_sriov_cap()
805 set_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags); in ice_set_sriov_cap()
809 * ice_clear_sriov_cap - disable SRIOV in PF flags
814 clear_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags); in ice_clear_sriov_cap()
826 * ice_is_adq_active - any active ADQs
842 if (vsi->tc_cfg.numtc > ICE_CHNL_START_TC && in ice_is_adq_active()
843 test_bit(ICE_FLAG_TC_MQPRIO, pf->flags)) in ice_is_adq_active()
912 * ice_set_rdma_cap - enable RDMA support
917 if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) { in ice_set_rdma_cap()
918 set_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_set_rdma_cap()
919 set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags); in ice_set_rdma_cap()
924 * ice_clear_rdma_cap - disable RDMA support
936 if (!test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags)) in ice_clear_rdma_cap()
939 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_clear_rdma_cap()