Lines Matching refs:vsi
101 static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx) in ice_vsi_alloc_q_vector() argument
103 struct ice_pf *pf = vsi->back; in ice_vsi_alloc_q_vector()
112 q_vector->vsi = vsi; in ice_vsi_alloc_q_vector()
116 if (vsi->type == ICE_VSI_VF) in ice_vsi_alloc_q_vector()
126 if (vsi->netdev) in ice_vsi_alloc_q_vector()
127 netif_napi_add(vsi->netdev, &q_vector->napi, ice_napi_poll, in ice_vsi_alloc_q_vector()
132 vsi->q_vectors[v_idx] = q_vector; in ice_vsi_alloc_q_vector()
142 static void ice_free_q_vector(struct ice_vsi *vsi, int v_idx) in ice_free_q_vector() argument
145 struct ice_pf *pf = vsi->back; in ice_free_q_vector()
150 if (!vsi->q_vectors[v_idx]) { in ice_free_q_vector()
154 q_vector = vsi->q_vectors[v_idx]; in ice_free_q_vector()
162 if (vsi->netdev) in ice_free_q_vector()
166 vsi->q_vectors[v_idx] = NULL; in ice_free_q_vector()
206 static u16 ice_calc_q_handle(struct ice_vsi *vsi, struct ice_ring *ring, u8 tc) in ice_calc_q_handle() argument
214 return ring->q_index - vsi->tc_cfg.tc_info[tc].qoffset; in ice_calc_q_handle()
228 struct ice_vsi *vsi = ring->vsi; in ice_setup_tx_ctx() local
229 struct ice_hw *hw = &vsi->back->hw; in ice_setup_tx_ctx()
233 tlan_ctx->port_num = vsi->port_info->lport; in ice_setup_tx_ctx()
249 switch (vsi->type) { in ice_setup_tx_ctx()
257 tlan_ctx->vmvf_num = hw->func_caps.vf_base_id + vsi->vf_id; in ice_setup_tx_ctx()
265 tlan_ctx->src_vsi = ice_get_hw_vsi_num(hw, vsi->idx); in ice_setup_tx_ctx()
285 struct device *dev = ice_pf_to_dev(ring->vsi->back); in ice_setup_rx_ctx()
288 struct ice_vsi *vsi = ring->vsi; in ice_setup_rx_ctx() local
295 hw = &vsi->back->hw; in ice_setup_rx_ctx()
298 pf_q = vsi->rxq_map[ring->q_index]; in ice_setup_rx_ctx()
303 ring->rx_buf_len = vsi->rx_buf_len; in ice_setup_rx_ctx()
305 if (ring->vsi->type == ICE_VSI_PF) { in ice_setup_rx_ctx()
383 rlan_ctx.rxmax = min_t(u32, vsi->max_frame, in ice_setup_rx_ctx()
395 if (vsi->type != ICE_VSI_VF) in ice_setup_rx_ctx()
408 if (vsi->type == ICE_VSI_VF) in ice_setup_rx_ctx()
412 if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) in ice_setup_rx_ctx()
476 ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait) in ice_vsi_ctrl_one_rx_ring() argument
478 int pf_q = vsi->rxq_map[rxq_idx]; in ice_vsi_ctrl_one_rx_ring()
479 struct ice_pf *pf = vsi->back; in ice_vsi_ctrl_one_rx_ring()
514 int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx) in ice_vsi_wait_one_rx_ring() argument
516 int pf_q = vsi->rxq_map[rxq_idx]; in ice_vsi_wait_one_rx_ring()
517 struct ice_pf *pf = vsi->back; in ice_vsi_wait_one_rx_ring()
529 int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi) in ice_vsi_alloc_q_vectors() argument
531 struct device *dev = ice_pf_to_dev(vsi->back); in ice_vsi_alloc_q_vectors()
535 if (vsi->q_vectors[0]) { in ice_vsi_alloc_q_vectors()
536 dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num); in ice_vsi_alloc_q_vectors()
540 for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) { in ice_vsi_alloc_q_vectors()
541 err = ice_vsi_alloc_q_vector(vsi, v_idx); in ice_vsi_alloc_q_vectors()
550 ice_free_q_vector(vsi, v_idx); in ice_vsi_alloc_q_vectors()
553 vsi->num_q_vectors, vsi->vsi_num, err); in ice_vsi_alloc_q_vectors()
554 vsi->num_q_vectors = 0; in ice_vsi_alloc_q_vectors()
566 void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi) in ice_vsi_map_rings_to_vectors() argument
568 int q_vectors = vsi->num_q_vectors; in ice_vsi_map_rings_to_vectors()
573 tx_rings_rem = vsi->num_txq; in ice_vsi_map_rings_to_vectors()
574 rx_rings_rem = vsi->num_rxq; in ice_vsi_map_rings_to_vectors()
577 struct ice_q_vector *q_vector = vsi->q_vectors[v_id]; in ice_vsi_map_rings_to_vectors()
587 q_base = vsi->num_txq - tx_rings_rem; in ice_vsi_map_rings_to_vectors()
590 struct ice_ring *tx_ring = vsi->tx_rings[q_id]; in ice_vsi_map_rings_to_vectors()
604 q_base = vsi->num_rxq - rx_rings_rem; in ice_vsi_map_rings_to_vectors()
607 struct ice_ring *rx_ring = vsi->rx_rings[q_id]; in ice_vsi_map_rings_to_vectors()
621 void ice_vsi_free_q_vectors(struct ice_vsi *vsi) in ice_vsi_free_q_vectors() argument
625 ice_for_each_q_vector(vsi, v_idx) in ice_vsi_free_q_vectors()
626 ice_free_q_vector(vsi, v_idx); in ice_vsi_free_q_vectors()
636 ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_ring *ring, in ice_vsi_cfg_txq() argument
642 struct ice_pf *pf = vsi->back; in ice_vsi_cfg_txq()
668 ring->q_handle = ice_calc_q_handle(vsi, ring, tc); in ice_vsi_cfg_txq()
670 status = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc, ring->q_handle, in ice_vsi_cfg_txq()
733 ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx) in ice_cfg_txq_interrupt() argument
735 struct ice_pf *pf = vsi->back; in ice_cfg_txq_interrupt()
744 wr32(hw, QINT_TQCTL(vsi->txq_map[txq]), val); in ice_cfg_txq_interrupt()
745 if (ice_is_xdp_ena_vsi(vsi)) { in ice_cfg_txq_interrupt()
746 u32 xdp_txq = txq + vsi->num_xdp_txq; in ice_cfg_txq_interrupt()
748 wr32(hw, QINT_TQCTL(vsi->txq_map[xdp_txq]), in ice_cfg_txq_interrupt()
765 ice_cfg_rxq_interrupt(struct ice_vsi *vsi, u16 rxq, u16 msix_idx, u16 itr_idx) in ice_cfg_rxq_interrupt() argument
767 struct ice_pf *pf = vsi->back; in ice_cfg_rxq_interrupt()
776 wr32(hw, QINT_RQCTL(vsi->rxq_map[rxq]), val); in ice_cfg_rxq_interrupt()
803 ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, in ice_vsi_stop_tx_ring() argument
807 struct ice_pf *pf = vsi->back; in ice_vsi_stop_tx_ring()
828 status = ice_dis_vsi_txq(vsi->port_info, txq_meta->vsi_idx, in ice_vsi_stop_tx_ring()
839 dev_dbg(ice_pf_to_dev(vsi->back), "Reset in progress. LAN Tx queues already disabled\n"); in ice_vsi_stop_tx_ring()
841 dev_dbg(ice_pf_to_dev(vsi->back), "LAN Tx queues do not exist, nothing to disable\n"); in ice_vsi_stop_tx_ring()
843 dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %s\n", in ice_vsi_stop_tx_ring()
861 ice_fill_txq_meta(struct ice_vsi *vsi, struct ice_ring *ring, in ice_fill_txq_meta() argument
874 txq_meta->vsi_idx = vsi->idx; in ice_fill_txq_meta()