Lines Matching refs:vsi
34 return ((np->vsi->alloc_txq + np->vsi->alloc_rxq) * in ice_q_stats_len()
177 struct ice_vsi *vsi = np->vsi; in ice_get_drvinfo() local
178 struct ice_pf *pf = vsi->back; in ice_get_drvinfo()
209 struct ice_pf *pf = np->vsi->back; in ice_get_regs()
223 struct ice_pf *pf = np->vsi->back; in ice_get_msglevel()
237 struct ice_pf *pf = np->vsi->back; in ice_set_msglevel()
252 struct ice_pf *pf = np->vsi->back; in ice_get_eeprom_len()
262 struct ice_vsi *vsi = np->vsi; in ice_get_eeprom() local
263 struct ice_pf *pf = vsi->back; in ice_get_eeprom()
341 status = ice_get_link_status(np->vsi->port_info, &link_up); in ice_link_test()
364 struct ice_pf *pf = np->vsi->back; in ice_eeprom_test()
421 struct ice_hw *hw = np->vsi->port_info->hw; in ice_reg_test()
467 static int ice_lbtest_prepare_rings(struct ice_vsi *vsi) in ice_lbtest_prepare_rings() argument
471 status = ice_vsi_setup_tx_rings(vsi); in ice_lbtest_prepare_rings()
475 status = ice_vsi_setup_rx_rings(vsi); in ice_lbtest_prepare_rings()
479 status = ice_vsi_cfg(vsi); in ice_lbtest_prepare_rings()
483 status = ice_vsi_start_all_rx_rings(vsi); in ice_lbtest_prepare_rings()
490 ice_vsi_free_rx_rings(vsi); in ice_lbtest_prepare_rings()
492 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, 0); in ice_lbtest_prepare_rings()
494 ice_vsi_free_tx_rings(vsi); in ice_lbtest_prepare_rings()
506 static int ice_lbtest_disable_rings(struct ice_vsi *vsi) in ice_lbtest_disable_rings() argument
510 status = ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, 0); in ice_lbtest_disable_rings()
512 netdev_err(vsi->netdev, "Failed to stop Tx rings, VSI %d error %d\n", in ice_lbtest_disable_rings()
513 vsi->vsi_num, status); in ice_lbtest_disable_rings()
515 status = ice_vsi_stop_all_rx_rings(vsi); in ice_lbtest_disable_rings()
517 netdev_err(vsi->netdev, "Failed to stop Rx rings, VSI %d error %d\n", in ice_lbtest_disable_rings()
518 vsi->vsi_num, status); in ice_lbtest_disable_rings()
520 ice_vsi_free_tx_rings(vsi); in ice_lbtest_disable_rings()
521 ice_vsi_free_rx_rings(vsi); in ice_lbtest_disable_rings()
679 struct ice_vsi *orig_vsi = np->vsi, *test_vsi; in ice_loopback_test()
773 struct ice_pf *pf = np->vsi->back; in ice_intr_test()
803 struct ice_pf *pf = np->vsi->back; in ice_self_test()
874 struct ice_vsi *vsi = np->vsi; in ice_get_strings() local
886 ice_for_each_alloc_txq(vsi, i) { in ice_get_strings()
894 ice_for_each_alloc_rxq(vsi, i) { in ice_get_strings()
902 if (vsi->type != ICE_VSI_PF) in ice_get_strings()
960 if (ice_aq_set_port_id_led(np->vsi->port_info, !led_active, NULL)) in ice_set_phys_id()
975 struct ice_vsi *vsi = np->vsi; in ice_set_fec_cfg() local
978 pi = vsi->port_info; in ice_set_fec_cfg()
983 if (vsi->type != ICE_VSI_PF) { in ice_set_fec_cfg()
1019 struct ice_vsi *vsi = np->vsi; in ice_set_fecparam() local
1037 dev_warn(ice_pf_to_dev(vsi->back), "Unsupported FEC mode: %d\n", in ice_set_fecparam()
1056 struct ice_vsi *vsi = np->vsi; in ice_get_fecparam() local
1061 pi = vsi->port_info; in ice_get_fecparam()
1119 struct ice_vsi *vsi = np->vsi; in ice_nway_reset() local
1123 pi = vsi->port_info; in ice_nway_reset()
1125 if (!test_bit(__ICE_DOWN, vsi->back->state)) in ice_nway_reset()
1153 struct ice_vsi *vsi = np->vsi; in ice_get_priv_flags() local
1154 struct ice_pf *pf = vsi->back; in ice_get_priv_flags()
1179 struct ice_vsi *vsi = np->vsi; in ice_set_priv_flags() local
1180 struct ice_pf *pf = vsi->back; in ice_set_priv_flags()
1281 ice_cfg_sw_lldp(vsi, false, false); in ice_set_priv_flags()
1296 ice_down(vsi); in ice_set_priv_flags()
1297 ice_up(vsi); in ice_set_priv_flags()
1351 struct ice_vsi *vsi = np->vsi; in ice_get_ethtool_stats() local
1352 struct ice_pf *pf = vsi->back; in ice_get_ethtool_stats()
1359 ice_update_vsi_stats(vsi); in ice_get_ethtool_stats()
1362 p = (char *)vsi + ice_gstrings_vsi_stats[j].stat_offset; in ice_get_ethtool_stats()
1370 ice_for_each_alloc_txq(vsi, j) { in ice_get_ethtool_stats()
1371 ring = READ_ONCE(vsi->tx_rings[j]); in ice_get_ethtool_stats()
1381 ice_for_each_alloc_rxq(vsi, j) { in ice_get_ethtool_stats()
1382 ring = READ_ONCE(vsi->rx_rings[j]); in ice_get_ethtool_stats()
1394 if (vsi->type != ICE_VSI_PF) in ice_get_ethtool_stats()
1495 struct ice_vsi *vsi = np->vsi; in ice_phy_type_to_ethtool() local
1496 struct ice_pf *pf = vsi->back; in ice_phy_type_to_ethtool()
1505 req_speeds = vsi->port_info->phy.link_info.req_speeds; in ice_phy_type_to_ethtool()
1540 phy_types_low = vsi->port_info->phy.phy_type_low; in ice_phy_type_to_ethtool()
1541 phy_types_high = vsi->port_info->phy.phy_type_high; in ice_phy_type_to_ethtool()
1548 adv_phy_type_lo = vsi->port_info->phy.phy_type_low; in ice_phy_type_to_ethtool()
1549 adv_phy_type_hi = vsi->port_info->phy.phy_type_high; in ice_phy_type_to_ethtool()
1817 struct ice_port_info *pi = np->vsi->port_info; in ice_get_settings_link_up()
1819 struct ice_vsi *vsi = np->vsi; in ice_get_settings_link_up() local
1821 link_info = &vsi->port_info->phy.link_info; in ice_get_settings_link_up()
1926 struct ice_vsi *vsi = np->vsi; in ice_get_link_ksettings() local
1933 hw_link_info = &vsi->port_info->phy.link_info; in ice_get_link_ksettings()
1946 switch (vsi->port_info->phy.media_type) { in ice_get_link_ksettings()
1979 status = ice_aq_get_phy_caps(vsi->port_info, false, in ice_get_link_ksettings()
2016 status = ice_aq_get_phy_caps(vsi->port_info, false, in ice_get_link_ksettings()
2231 struct ice_pf *pf = np->vsi->back; in ice_set_link_ksettings()
2240 pi = np->vsi->port_info; in ice_set_link_ksettings()
2401 ice_print_link_msg(np->vsi, false); in ice_set_link_ksettings()
2545 ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc) in ice_set_rss_hash_opt() argument
2547 struct ice_pf *pf = vsi->back; in ice_set_rss_hash_opt()
2556 vsi->vsi_num); in ice_set_rss_hash_opt()
2563 vsi->vsi_num); in ice_set_rss_hash_opt()
2570 vsi->vsi_num); in ice_set_rss_hash_opt()
2574 status = ice_add_rss_cfg(&pf->hw, vsi->idx, hashed_flds, hdrs); in ice_set_rss_hash_opt()
2577 vsi->vsi_num, ice_stat_str(status)); in ice_set_rss_hash_opt()
2590 ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc) in ice_get_rss_hash_opt() argument
2592 struct ice_pf *pf = vsi->back; in ice_get_rss_hash_opt()
2602 vsi->vsi_num); in ice_get_rss_hash_opt()
2609 vsi->vsi_num); in ice_get_rss_hash_opt()
2613 hash_flds = ice_get_rss_cfg(&pf->hw, vsi->idx, hdrs); in ice_get_rss_hash_opt()
2616 vsi->vsi_num); in ice_get_rss_hash_opt()
2649 struct ice_vsi *vsi = np->vsi; in ice_set_rxnfc() local
2653 return ice_add_fdir_ethtool(vsi, cmd); in ice_set_rxnfc()
2655 return ice_del_fdir_ethtool(vsi, cmd); in ice_set_rxnfc()
2657 return ice_set_rss_hash_opt(vsi, cmd); in ice_set_rxnfc()
2677 struct ice_vsi *vsi = np->vsi; in ice_get_rxnfc() local
2681 hw = &vsi->back->hw; in ice_get_rxnfc()
2685 cmd->data = vsi->rss_size; in ice_get_rxnfc()
2701 ice_get_rss_hash_opt(vsi, cmd); in ice_get_rxnfc()
2715 struct ice_vsi *vsi = np->vsi; in ice_get_ringparam() local
2719 ring->rx_pending = vsi->rx_rings[0]->count; in ice_get_ringparam()
2720 ring->tx_pending = vsi->tx_rings[0]->count; in ice_get_ringparam()
2735 struct ice_vsi *vsi = np->vsi; in ice_set_ringparam() local
2736 struct ice_pf *pf = vsi->back; in ice_set_ringparam()
2761 if (new_tx_cnt == vsi->tx_rings[0]->count && in ice_set_ringparam()
2762 new_rx_cnt == vsi->rx_rings[0]->count) { in ice_set_ringparam()
2771 if (ice_xsk_any_rx_ring_ena(vsi)) in ice_set_ringparam()
2782 if (!netif_running(vsi->netdev)) { in ice_set_ringparam()
2783 for (i = 0; i < vsi->alloc_txq; i++) in ice_set_ringparam()
2784 vsi->tx_rings[i]->count = new_tx_cnt; in ice_set_ringparam()
2785 for (i = 0; i < vsi->alloc_rxq; i++) in ice_set_ringparam()
2786 vsi->rx_rings[i]->count = new_rx_cnt; in ice_set_ringparam()
2787 if (ice_is_xdp_ena_vsi(vsi)) in ice_set_ringparam()
2788 for (i = 0; i < vsi->num_xdp_txq; i++) in ice_set_ringparam()
2789 vsi->xdp_rings[i]->count = new_tx_cnt; in ice_set_ringparam()
2790 vsi->num_tx_desc = (u16)new_tx_cnt; in ice_set_ringparam()
2791 vsi->num_rx_desc = (u16)new_rx_cnt; in ice_set_ringparam()
2796 if (new_tx_cnt == vsi->tx_rings[0]->count) in ice_set_ringparam()
2801 vsi->tx_rings[0]->count, new_tx_cnt); in ice_set_ringparam()
2803 tx_rings = kcalloc(vsi->num_txq, sizeof(*tx_rings), GFP_KERNEL); in ice_set_ringparam()
2809 ice_for_each_txq(vsi, i) { in ice_set_ringparam()
2811 tx_rings[i] = *vsi->tx_rings[i]; in ice_set_ringparam()
2824 if (!ice_is_xdp_ena_vsi(vsi)) in ice_set_ringparam()
2829 vsi->xdp_rings[0]->count, new_tx_cnt); in ice_set_ringparam()
2831 xdp_rings = kcalloc(vsi->num_xdp_txq, sizeof(*xdp_rings), GFP_KERNEL); in ice_set_ringparam()
2837 for (i = 0; i < vsi->num_xdp_txq; i++) { in ice_set_ringparam()
2839 xdp_rings[i] = *vsi->xdp_rings[i]; in ice_set_ringparam()
2854 if (new_rx_cnt == vsi->rx_rings[0]->count) in ice_set_ringparam()
2859 vsi->rx_rings[0]->count, new_rx_cnt); in ice_set_ringparam()
2861 rx_rings = kcalloc(vsi->num_rxq, sizeof(*rx_rings), GFP_KERNEL); in ice_set_ringparam()
2867 ice_for_each_rxq(vsi, i) { in ice_set_ringparam()
2869 rx_rings[i] = *vsi->rx_rings[i]; in ice_set_ringparam()
2876 rx_rings[i].tail = vsi->back->hw.hw_addr + PRTGEN_STATUS; in ice_set_ringparam()
2901 if (!test_and_set_bit(__ICE_DOWN, vsi->state)) { in ice_set_ringparam()
2902 ice_down(vsi); in ice_set_ringparam()
2905 ice_for_each_txq(vsi, i) { in ice_set_ringparam()
2906 ice_free_tx_ring(vsi->tx_rings[i]); in ice_set_ringparam()
2907 *vsi->tx_rings[i] = tx_rings[i]; in ice_set_ringparam()
2913 ice_for_each_rxq(vsi, i) { in ice_set_ringparam()
2914 ice_free_rx_ring(vsi->rx_rings[i]); in ice_set_ringparam()
2916 rx_rings[i].tail = vsi->rx_rings[i]->tail; in ice_set_ringparam()
2925 *vsi->rx_rings[i] = rx_rings[i]; in ice_set_ringparam()
2931 for (i = 0; i < vsi->num_xdp_txq; i++) { in ice_set_ringparam()
2932 ice_free_tx_ring(vsi->xdp_rings[i]); in ice_set_ringparam()
2933 *vsi->xdp_rings[i] = xdp_rings[i]; in ice_set_ringparam()
2938 vsi->num_tx_desc = new_tx_cnt; in ice_set_ringparam()
2939 vsi->num_rx_desc = new_rx_cnt; in ice_set_ringparam()
2940 ice_up(vsi); in ice_set_ringparam()
2947 ice_for_each_txq(vsi, i) in ice_set_ringparam()
2971 struct ice_port_info *pi = np->vsi->port_info; in ice_get_pauseparam()
3019 struct ice_pf *pf = np->vsi->back; in ice_set_pauseparam()
3021 struct ice_vsi *vsi = np->vsi; in ice_set_pauseparam() local
3030 pi = vsi->port_info; in ice_set_pauseparam()
3038 if (vsi->type != ICE_VSI_PF) { in ice_set_pauseparam()
3137 return np->vsi->rss_table_size; in ice_get_rxfh_indir_size()
3153 struct ice_vsi *vsi = np->vsi; in ice_get_rxfh() local
3154 struct ice_pf *pf = vsi->back; in ice_get_rxfh()
3170 lut = kzalloc(vsi->rss_table_size, GFP_KERNEL); in ice_get_rxfh()
3174 if (ice_get_rss(vsi, key, lut, vsi->rss_table_size)) { in ice_get_rxfh()
3179 for (i = 0; i < vsi->rss_table_size; i++) in ice_get_rxfh()
3202 struct ice_vsi *vsi = np->vsi; in ice_set_rxfh() local
3203 struct ice_pf *pf = vsi->back; in ice_set_rxfh()
3218 if (!vsi->rss_hkey_user) { in ice_set_rxfh()
3219 vsi->rss_hkey_user = in ice_set_rxfh()
3222 if (!vsi->rss_hkey_user) in ice_set_rxfh()
3225 memcpy(vsi->rss_hkey_user, key, ICE_VSIQF_HKEY_ARRAY_SIZE); in ice_set_rxfh()
3226 seed = vsi->rss_hkey_user; in ice_set_rxfh()
3229 if (!vsi->rss_lut_user) { in ice_set_rxfh()
3230 vsi->rss_lut_user = devm_kzalloc(dev, vsi->rss_table_size, in ice_set_rxfh()
3232 if (!vsi->rss_lut_user) in ice_set_rxfh()
3240 for (i = 0; i < vsi->rss_table_size; i++) in ice_set_rxfh()
3241 vsi->rss_lut_user[i] = (u8)(indir[i]); in ice_set_rxfh()
3243 ice_fill_rss_lut(vsi->rss_lut_user, vsi->rss_table_size, in ice_set_rxfh()
3244 vsi->rss_size); in ice_set_rxfh()
3247 if (ice_set_rss(vsi, seed, vsi->rss_lut_user, vsi->rss_table_size)) in ice_set_rxfh()
3280 static u32 ice_get_combined_cnt(struct ice_vsi *vsi) in ice_get_combined_cnt() argument
3285 ice_for_each_q_vector(vsi, q_idx) { in ice_get_combined_cnt()
3286 struct ice_q_vector *q_vector = vsi->q_vectors[q_idx]; in ice_get_combined_cnt()
3304 struct ice_vsi *vsi = np->vsi; in ice_get_channels() local
3305 struct ice_pf *pf = vsi->back; in ice_get_channels()
3313 ch->combined_count = ice_get_combined_cnt(vsi); in ice_get_channels()
3314 ch->rx_count = vsi->num_rxq - ch->combined_count; in ice_get_channels()
3315 ch->tx_count = vsi->num_txq - ch->combined_count; in ice_get_channels()
3341 static int ice_vsi_set_dflt_rss_lut(struct ice_vsi *vsi, int req_rss_size) in ice_vsi_set_dflt_rss_lut() argument
3343 struct ice_pf *pf = vsi->back; in ice_vsi_set_dflt_rss_lut()
3356 lut = kzalloc(vsi->rss_table_size, GFP_KERNEL); in ice_vsi_set_dflt_rss_lut()
3362 vsi->rss_size = 1; in ice_vsi_set_dflt_rss_lut()
3364 vsi->rss_size = ice_get_valid_rss_size(hw, req_rss_size); in ice_vsi_set_dflt_rss_lut()
3367 ice_fill_rss_lut(lut, vsi->rss_table_size, vsi->rss_size); in ice_vsi_set_dflt_rss_lut()
3368 status = ice_aq_set_rss_lut(hw, vsi->idx, vsi->rss_lut_type, lut, in ice_vsi_set_dflt_rss_lut()
3369 vsi->rss_table_size); in ice_vsi_set_dflt_rss_lut()
3389 struct ice_vsi *vsi = np->vsi; in ice_set_channels() local
3390 struct ice_pf *pf = vsi->back; in ice_set_channels()
3408 curr_combined = ice_get_combined_cnt(vsi); in ice_set_channels()
3415 if (ch->rx_count == vsi->num_rxq - curr_combined) in ice_set_channels()
3417 if (ch->tx_count == vsi->num_txq - curr_combined) in ice_set_channels()
3441 ice_vsi_recfg_qs(vsi, new_rx, new_tx); in ice_set_channels()
3444 return ice_vsi_set_dflt_rss_lut(vsi, new_rx); in ice_set_channels()
3447 vsi->rss_size = ice_get_valid_rss_size(&pf->hw, new_rx); in ice_set_channels()
3460 struct ice_pf *pf = np->vsi->back; in ice_get_wol()
3462 if (np->vsi->type != ICE_VSI_PF) in ice_get_wol()
3483 struct ice_vsi *vsi = np->vsi; in ice_set_wol() local
3484 struct ice_pf *pf = vsi->back; in ice_set_wol()
3486 if (vsi->type != ICE_VSI_PF || !ice_is_wol_supported(&pf->hw)) in ice_set_wol()
3539 dev_dbg(ice_pf_to_dev(rc->ring->vsi->back), "Invalid c_type %d\n", c_type); in ice_get_rc_coalesce()
3557 ice_get_q_coalesce(struct ice_vsi *vsi, struct ethtool_coalesce *ec, int q_num) in ice_get_q_coalesce() argument
3559 if (q_num < vsi->num_rxq && q_num < vsi->num_txq) { in ice_get_q_coalesce()
3561 &vsi->rx_rings[q_num]->q_vector->rx)) in ice_get_q_coalesce()
3564 &vsi->tx_rings[q_num]->q_vector->tx)) in ice_get_q_coalesce()
3566 } else if (q_num < vsi->num_rxq) { in ice_get_q_coalesce()
3568 &vsi->rx_rings[q_num]->q_vector->rx)) in ice_get_q_coalesce()
3570 } else if (q_num < vsi->num_txq) { in ice_get_q_coalesce()
3572 &vsi->tx_rings[q_num]->q_vector->tx)) in ice_get_q_coalesce()
3595 struct ice_vsi *vsi = np->vsi; in __ice_get_coalesce() local
3600 if (ice_get_q_coalesce(vsi, ec, q_num)) in __ice_get_coalesce()
3634 struct ice_ring_container *rc, struct ice_vsi *vsi) in ice_set_rc_coalesce() argument
3638 struct ice_pf *pf = vsi->back; in ice_set_rc_coalesce()
3649 netdev_info(vsi->netdev, "Invalid value, %s-usecs-high valid values are 0 (disabled), %d-%d\n", in ice_set_rc_coalesce()
3678 netdev_info(vsi->netdev, "%s interrupt throttling cannot be changed if adaptive-%s is enabled\n", in ice_set_rc_coalesce()
3684 netdev_info(vsi->netdev, "Invalid value, %s-usecs range is 0-%d\n", in ice_set_rc_coalesce()
3712 ice_set_q_coalesce(struct ice_vsi *vsi, struct ethtool_coalesce *ec, int q_num) in ice_set_q_coalesce() argument
3714 if (q_num < vsi->num_rxq && q_num < vsi->num_txq) { in ice_set_q_coalesce()
3716 &vsi->rx_rings[q_num]->q_vector->rx, in ice_set_q_coalesce()
3717 vsi)) in ice_set_q_coalesce()
3721 &vsi->tx_rings[q_num]->q_vector->tx, in ice_set_q_coalesce()
3722 vsi)) in ice_set_q_coalesce()
3724 } else if (q_num < vsi->num_rxq) { in ice_set_q_coalesce()
3726 &vsi->rx_rings[q_num]->q_vector->rx, in ice_set_q_coalesce()
3727 vsi)) in ice_set_q_coalesce()
3729 } else if (q_num < vsi->num_txq) { in ice_set_q_coalesce()
3731 &vsi->tx_rings[q_num]->q_vector->tx, in ice_set_q_coalesce()
3732 vsi)) in ice_set_q_coalesce()
3779 struct ice_vsi *vsi = np->vsi; in __ice_set_coalesce() local
3782 struct ice_q_vector *q_vector = vsi->q_vectors[0]; in __ice_set_coalesce()
3795 ice_for_each_q_vector(vsi, v_idx) { in __ice_set_coalesce()
3800 if (v_idx >= vsi->num_rxq && v_idx >= vsi->num_txq) in __ice_set_coalesce()
3803 if (ice_set_q_coalesce(vsi, ec, v_idx)) in __ice_set_coalesce()
3809 if (ice_set_q_coalesce(vsi, ec, q_num)) in __ice_set_coalesce()
3852 struct ice_vsi *vsi = np->vsi; in ice_get_module_info() local
3853 struct ice_pf *pf = vsi->back; in ice_get_module_info()
3927 struct ice_vsi *vsi = np->vsi; in ice_get_module_eeprom() local
3928 struct ice_pf *pf = vsi->back; in ice_get_module_eeprom()