Lines Matching refs:vsi

102 static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx)  in ice_vsi_alloc_q_vector()  argument
104 struct ice_pf *pf = vsi->back; in ice_vsi_alloc_q_vector()
113 q_vector->vsi = vsi; in ice_vsi_alloc_q_vector()
123 if (vsi->type == ICE_VSI_VF) { in ice_vsi_alloc_q_vector()
124 q_vector->reg_idx = ice_calc_vf_reg_idx(vsi->vf, q_vector); in ice_vsi_alloc_q_vector()
126 } else if (vsi->type == ICE_VSI_CTRL && vsi->vf) { in ice_vsi_alloc_q_vector()
127 struct ice_vsi *ctrl_vsi = ice_get_vf_ctrl_vsi(pf, vsi); in ice_vsi_alloc_q_vector()
140 q_vector->irq = ice_alloc_irq(pf, vsi->irq_dyn_alloc); in ice_vsi_alloc_q_vector()
157 if (vsi->netdev) in ice_vsi_alloc_q_vector()
158 netif_napi_add(vsi->netdev, &q_vector->napi, ice_napi_poll); in ice_vsi_alloc_q_vector()
162 vsi->q_vectors[v_idx] = q_vector; in ice_vsi_alloc_q_vector()
177 static void ice_free_q_vector(struct ice_vsi *vsi, int v_idx) in ice_free_q_vector() argument
180 struct ice_pf *pf = vsi->back; in ice_free_q_vector()
186 if (!vsi->q_vectors[v_idx]) { in ice_free_q_vector()
190 q_vector = vsi->q_vectors[v_idx]; in ice_free_q_vector()
198 if (vsi->netdev) in ice_free_q_vector()
206 if (vsi->type == ICE_VSI_CTRL && vsi->vf && in ice_free_q_vector()
207 ice_get_vf_ctrl_vsi(pf, vsi)) in ice_free_q_vector()
214 vsi->q_vectors[v_idx] = NULL; in ice_free_q_vector()
254 static u16 ice_calc_txq_handle(struct ice_vsi *vsi, struct ice_tx_ring *ring, u8 tc) in ice_calc_txq_handle() argument
265 return ring->q_index - vsi->tc_cfg.tc_info[tc].qoffset; in ice_calc_txq_handle()
281 struct ice_vsi *vsi = ring->vsi; in ice_eswitch_calc_txq_handle() local
284 ice_for_each_txq(vsi, i) { in ice_eswitch_calc_txq_handle()
285 if (vsi->tx_rings[i] == ring) in ice_eswitch_calc_txq_handle()
323 struct ice_vsi *vsi = ring->vsi; in ice_setup_tx_ctx() local
324 struct ice_hw *hw = &vsi->back->hw; in ice_setup_tx_ctx()
328 tlan_ctx->port_num = vsi->port_info->lport; in ice_setup_tx_ctx()
344 switch (vsi->type) { in ice_setup_tx_ctx()
355 tlan_ctx->vmvf_num = hw->func_caps.vf_base_id + vsi->vf->vf_id; in ice_setup_tx_ctx()
369 tlan_ctx->src_vsi = ice_get_hw_vsi_num(hw, vsi->idx); in ice_setup_tx_ctx()
372 switch (vsi->type) { in ice_setup_tx_ctx()
411 struct ice_vsi *vsi = ring->vsi; in ice_setup_rx_ctx() local
418 hw = &vsi->back->hw; in ice_setup_rx_ctx()
421 pf_q = vsi->rxq_map[ring->q_index]; in ice_setup_rx_ctx()
457 if (vsi->type == ICE_VSI_VF && in ice_setup_rx_ctx()
458 ice_vf_is_port_vlan_ena(vsi->vf)) in ice_setup_rx_ctx()
478 rlan_ctx.rxmax = min_t(u32, vsi->max_frame, in ice_setup_rx_ctx()
490 if (vsi->type != ICE_VSI_VF) in ice_setup_rx_ctx()
499 …dev_err(ice_pf_to_dev(vsi->back), "Failed to set LAN Rx queue context for absolute Rx queue %d err… in ice_setup_rx_ctx()
504 if (vsi->type == ICE_VSI_VF) in ice_setup_rx_ctx()
508 if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) in ice_setup_rx_ctx()
549 struct device *dev = ice_pf_to_dev(ring->vsi->back); in ice_vsi_cfg_rxq()
553 ring->rx_buf_len = ring->vsi->rx_buf_len; in ice_vsi_cfg_rxq()
555 if (ring->vsi->type == ICE_VSI_PF) { in ice_vsi_cfg_rxq()
626 u16 pf_q = ring->vsi->rxq_map[ring->q_index]; in ice_vsi_cfg_rxq()
674 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
676 int pf_q = vsi->rxq_map[rxq_idx]; in ice_vsi_ctrl_one_rx_ring()
677 struct ice_pf *pf = vsi->back; in ice_vsi_ctrl_one_rx_ring()
712 int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx) in ice_vsi_wait_one_rx_ring() argument
714 int pf_q = vsi->rxq_map[rxq_idx]; in ice_vsi_wait_one_rx_ring()
715 struct ice_pf *pf = vsi->back; in ice_vsi_wait_one_rx_ring()
727 int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi) in ice_vsi_alloc_q_vectors() argument
729 struct device *dev = ice_pf_to_dev(vsi->back); in ice_vsi_alloc_q_vectors()
733 if (vsi->q_vectors[0]) { in ice_vsi_alloc_q_vectors()
734 dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num); in ice_vsi_alloc_q_vectors()
738 for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) { in ice_vsi_alloc_q_vectors()
739 err = ice_vsi_alloc_q_vector(vsi, v_idx); in ice_vsi_alloc_q_vectors()
748 ice_free_q_vector(vsi, v_idx); in ice_vsi_alloc_q_vectors()
751 vsi->num_q_vectors, vsi->vsi_num, err); in ice_vsi_alloc_q_vectors()
752 vsi->num_q_vectors = 0; in ice_vsi_alloc_q_vectors()
764 void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi) in ice_vsi_map_rings_to_vectors() argument
766 int q_vectors = vsi->num_q_vectors; in ice_vsi_map_rings_to_vectors()
771 tx_rings_rem = vsi->num_txq; in ice_vsi_map_rings_to_vectors()
772 rx_rings_rem = vsi->num_rxq; in ice_vsi_map_rings_to_vectors()
775 struct ice_q_vector *q_vector = vsi->q_vectors[v_id]; in ice_vsi_map_rings_to_vectors()
785 q_base = vsi->num_txq - tx_rings_rem; in ice_vsi_map_rings_to_vectors()
788 struct ice_tx_ring *tx_ring = vsi->tx_rings[q_id]; in ice_vsi_map_rings_to_vectors()
802 q_base = vsi->num_rxq - rx_rings_rem; in ice_vsi_map_rings_to_vectors()
805 struct ice_rx_ring *rx_ring = vsi->rx_rings[q_id]; in ice_vsi_map_rings_to_vectors()
819 void ice_vsi_free_q_vectors(struct ice_vsi *vsi) in ice_vsi_free_q_vectors() argument
823 ice_for_each_q_vector(vsi, v_idx) in ice_vsi_free_q_vectors()
824 ice_free_q_vector(vsi, v_idx); in ice_vsi_free_q_vectors()
826 vsi->num_q_vectors = 0; in ice_vsi_free_q_vectors()
836 ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, in ice_vsi_cfg_txq() argument
843 struct ice_pf *pf = vsi->back; in ice_vsi_cfg_txq()
872 if (vsi->type == ICE_VSI_SWITCHDEV_CTRL) { in ice_vsi_cfg_txq()
878 ring->q_handle = ice_calc_txq_handle(vsi, ring, tc); in ice_vsi_cfg_txq()
882 status = ice_ena_vsi_txq(vsi->port_info, ch->ch_vsi->idx, 0, in ice_vsi_cfg_txq()
886 status = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc, in ice_vsi_cfg_txq()
938 ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx) in ice_cfg_txq_interrupt() argument
940 struct ice_pf *pf = vsi->back; in ice_cfg_txq_interrupt()
949 wr32(hw, QINT_TQCTL(vsi->txq_map[txq]), val); in ice_cfg_txq_interrupt()
950 if (ice_is_xdp_ena_vsi(vsi)) { in ice_cfg_txq_interrupt()
951 u32 xdp_txq = txq + vsi->num_xdp_txq; in ice_cfg_txq_interrupt()
953 wr32(hw, QINT_TQCTL(vsi->txq_map[xdp_txq]), in ice_cfg_txq_interrupt()
970 ice_cfg_rxq_interrupt(struct ice_vsi *vsi, u16 rxq, u16 msix_idx, u16 itr_idx) in ice_cfg_rxq_interrupt() argument
972 struct ice_pf *pf = vsi->back; in ice_cfg_rxq_interrupt()
981 wr32(hw, QINT_RQCTL(vsi->rxq_map[rxq]), val); in ice_cfg_rxq_interrupt()
1008 ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, in ice_vsi_stop_tx_ring() argument
1012 struct ice_pf *pf = vsi->back; in ice_vsi_stop_tx_ring()
1030 if (q_vector && !(vsi->vf && ice_is_vf_disabled(vsi->vf))) in ice_vsi_stop_tx_ring()
1033 status = ice_dis_vsi_txq(vsi->port_info, txq_meta->vsi_idx, in ice_vsi_stop_tx_ring()
1044 dev_dbg(ice_pf_to_dev(vsi->back), "Reset in progress. LAN Tx queues already disabled\n"); in ice_vsi_stop_tx_ring()
1046 dev_dbg(ice_pf_to_dev(vsi->back), "LAN Tx queues do not exist, nothing to disable\n"); in ice_vsi_stop_tx_ring()
1048 dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %d\n", in ice_vsi_stop_tx_ring()
1066 ice_fill_txq_meta(struct ice_vsi *vsi, struct ice_tx_ring *ring, in ice_fill_txq_meta() argument
1084 txq_meta->vsi_idx = vsi->idx; in ice_fill_txq_meta()