Lines Matching refs:vsi
126 return vf->pf->vsi[vf->lan_vsi_idx]; in ice_get_vf_vsi()
221 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_clear_counters() local
223 if (vsi) in ice_vf_clear_counters()
224 vsi->num_vlan = 0; in ice_vf_clear_counters()
286 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_vsi() local
289 if (WARN_ON(!vsi)) in ice_vf_rebuild_vsi()
292 if (ice_vsi_rebuild(vsi, ICE_VSI_FLAG_INIT)) { in ice_vf_rebuild_vsi()
300 vsi->vsi_num = ice_get_hw_vsi_num(&pf->hw, vsi->idx); in ice_vf_rebuild_vsi()
301 vf->lan_vsi_num = vsi->vsi_num; in ice_vf_rebuild_vsi()
314 static int ice_vf_rebuild_host_vlan_cfg(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_rebuild_host_vlan_cfg() argument
316 struct ice_vsi_vlan_ops *vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vf_rebuild_host_vlan_cfg()
321 err = vlan_ops->set_port_vlan(vsi, &vf->port_vlan_info); in ice_vf_rebuild_host_vlan_cfg()
328 err = vlan_ops->add_vlan(vsi, &vf->port_vlan_info); in ice_vf_rebuild_host_vlan_cfg()
330 err = ice_vsi_add_vlan_zero(vsi); in ice_vf_rebuild_host_vlan_cfg()
340 err = vlan_ops->ena_rx_filtering(vsi); in ice_vf_rebuild_host_vlan_cfg()
343 vf->vf_id, vsi->idx, err); in ice_vf_rebuild_host_vlan_cfg()
358 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_host_tx_rate_cfg() local
361 if (WARN_ON(!vsi)) in ice_vf_rebuild_host_tx_rate_cfg()
365 err = ice_set_min_bw_limit(vsi, (u64)vf->min_tx_rate * 1000); in ice_vf_rebuild_host_tx_rate_cfg()
374 err = ice_set_max_bw_limit(vsi, (u64)vf->max_tx_rate * 1000); in ice_vf_rebuild_host_tx_rate_cfg()
404 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_host_mac_cfg() local
408 if (WARN_ON(!vsi)) in ice_vf_rebuild_host_mac_cfg()
415 status = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI); in ice_vf_rebuild_host_mac_cfg()
425 status = ice_fltr_add_mac(vsi, vf->hw_lan_addr, in ice_vf_rebuild_host_mac_cfg()
448 static void ice_vf_rebuild_aggregator_node_cfg(struct ice_vsi *vsi) in ice_vf_rebuild_aggregator_node_cfg() argument
450 struct ice_pf *pf = vsi->back; in ice_vf_rebuild_aggregator_node_cfg()
454 if (!vsi->agg_node) in ice_vf_rebuild_aggregator_node_cfg()
458 if (vsi->agg_node->num_vsis == ICE_MAX_VSIS_IN_AGG_NODE) { in ice_vf_rebuild_aggregator_node_cfg()
461 vsi->agg_node->agg_id, vsi->agg_node->num_vsis); in ice_vf_rebuild_aggregator_node_cfg()
465 status = ice_move_vsi_to_agg(pf->hw.port_info, vsi->agg_node->agg_id, in ice_vf_rebuild_aggregator_node_cfg()
466 vsi->idx, vsi->tc_cfg.ena_tc); in ice_vf_rebuild_aggregator_node_cfg()
469 vsi->idx, vsi->agg_node->agg_id); in ice_vf_rebuild_aggregator_node_cfg()
471 vsi->agg_node->num_vsis++; in ice_vf_rebuild_aggregator_node_cfg()
481 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_host_cfg() local
483 if (WARN_ON(!vsi)) in ice_vf_rebuild_host_cfg()
492 if (ice_vf_rebuild_host_vlan_cfg(vf, vsi)) in ice_vf_rebuild_host_cfg()
500 if (ice_vsi_apply_spoofchk(vsi, vf->spoofchk)) in ice_vf_rebuild_host_cfg()
505 ice_vf_rebuild_aggregator_node_cfg(vsi); in ice_vf_rebuild_host_cfg()
590 ice_vf_get_promisc_masks(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vf_get_promisc_masks() argument
594 ice_vsi_has_non_zero_vlans(vsi)) { in ice_vf_get_promisc_masks()
611 ice_vf_clear_all_promisc_modes(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_clear_all_promisc_modes() argument
617 ice_vf_get_promisc_masks(vf, vsi, &ucast_m, &mcast_m); in ice_vf_clear_all_promisc_modes()
620 if (ice_is_dflt_vsi_in_use(vsi->port_info)) in ice_vf_clear_all_promisc_modes()
621 ret = ice_clear_dflt_vsi(vsi); in ice_vf_clear_all_promisc_modes()
623 ret = ice_vf_clear_vsi_promisc(vf, vsi, ucast_m); in ice_vf_clear_all_promisc_modes()
635 ret = ice_vf_clear_vsi_promisc(vf, vsi, mcast_m); in ice_vf_clear_all_promisc_modes()
653 ice_vf_set_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m) in ice_vf_set_vsi_promisc() argument
655 struct ice_hw *hw = &vsi->back->hw; in ice_vf_set_vsi_promisc()
659 status = ice_fltr_set_vsi_promisc(hw, vsi->idx, promisc_m, in ice_vf_set_vsi_promisc()
661 else if (ice_vsi_has_non_zero_vlans(vsi)) in ice_vf_set_vsi_promisc()
662 status = ice_fltr_set_vlan_vsi_promisc(hw, vsi, promisc_m); in ice_vf_set_vsi_promisc()
664 status = ice_fltr_set_vsi_promisc(hw, vsi->idx, promisc_m, 0); in ice_vf_set_vsi_promisc()
667 …dev_err(ice_pf_to_dev(vsi->back), "enable Tx/Rx filter promiscuous mode on VF-%u failed, error: %d… in ice_vf_set_vsi_promisc()
682 ice_vf_clear_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m) in ice_vf_clear_vsi_promisc() argument
684 struct ice_hw *hw = &vsi->back->hw; in ice_vf_clear_vsi_promisc()
688 status = ice_fltr_clear_vsi_promisc(hw, vsi->idx, promisc_m, in ice_vf_clear_vsi_promisc()
690 else if (ice_vsi_has_non_zero_vlans(vsi)) in ice_vf_clear_vsi_promisc()
691 status = ice_fltr_clear_vlan_vsi_promisc(hw, vsi, promisc_m); in ice_vf_clear_vsi_promisc()
693 status = ice_fltr_clear_vsi_promisc(hw, vsi->idx, promisc_m, 0); in ice_vf_clear_vsi_promisc()
696 …dev_err(ice_pf_to_dev(vsi->back), "disable Tx/Rx filter promiscuous mode on VF-%u failed, error: %… in ice_vf_clear_vsi_promisc()
831 struct ice_vsi *vsi; in ice_reset_vf() local
867 vsi = ice_get_vf_vsi(vf); in ice_reset_vf()
868 if (!vsi) { in ice_reset_vf()
873 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id); in ice_reset_vf()
875 if (ice_vsi_is_rx_queue_active(vsi)) in ice_reset_vf()
876 ice_vsi_stop_all_rx_rings(vsi); in ice_reset_vf()
887 vsi = ice_get_vf_vsi(vf); in ice_reset_vf()
888 if (WARN_ON(!vsi)) { in ice_reset_vf()
898 ice_dis_vsi_txq(vsi->port_info, vsi->idx, 0, 0, NULL, NULL, in ice_reset_vf()
918 ice_vf_clear_all_promisc_modes(vf, vsi); in ice_reset_vf()
938 vsi = ice_get_vf_vsi(vf); in ice_reset_vf()
939 if (WARN_ON(!vsi)) { in ice_reset_vf()
944 ice_eswitch_update_repr(vsi); in ice_reset_vf()
1008 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_dis_vf_qs() local
1010 if (WARN_ON(!vsi)) in ice_dis_vf_qs()
1013 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id); in ice_dis_vf_qs()
1014 ice_vsi_stop_all_rx_rings(vsi); in ice_dis_vf_qs()
1074 static int ice_cfg_mac_antispoof(struct ice_vsi *vsi, bool enable) in ice_cfg_mac_antispoof() argument
1083 ctx->info.sec_flags = vsi->info.sec_flags; in ice_cfg_mac_antispoof()
1091 err = ice_update_vsi(&vsi->back->hw, vsi->idx, ctx, NULL); in ice_cfg_mac_antispoof()
1093 …dev_err(ice_pf_to_dev(vsi->back), "Failed to configure Tx MAC anti-spoof %s for VSI %d, error %d\n… in ice_cfg_mac_antispoof()
1094 enable ? "ON" : "OFF", vsi->vsi_num, err); in ice_cfg_mac_antispoof()
1096 vsi->info.sec_flags = ctx->info.sec_flags; in ice_cfg_mac_antispoof()
1107 static int ice_vsi_ena_spoofchk(struct ice_vsi *vsi) in ice_vsi_ena_spoofchk() argument
1112 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vsi_ena_spoofchk()
1115 if (vsi->type != ICE_VSI_VF || ice_vsi_has_non_zero_vlans(vsi)) { in ice_vsi_ena_spoofchk()
1116 err = vlan_ops->ena_tx_filtering(vsi); in ice_vsi_ena_spoofchk()
1121 return ice_cfg_mac_antispoof(vsi, true); in ice_vsi_ena_spoofchk()
1128 static int ice_vsi_dis_spoofchk(struct ice_vsi *vsi) in ice_vsi_dis_spoofchk() argument
1133 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vsi_dis_spoofchk()
1135 err = vlan_ops->dis_tx_filtering(vsi); in ice_vsi_dis_spoofchk()
1139 return ice_cfg_mac_antispoof(vsi, false); in ice_vsi_dis_spoofchk()
1147 int ice_vsi_apply_spoofchk(struct ice_vsi *vsi, bool enable) in ice_vsi_apply_spoofchk() argument
1152 err = ice_vsi_ena_spoofchk(vsi); in ice_vsi_apply_spoofchk()
1154 err = ice_vsi_dis_spoofchk(vsi); in ice_vsi_apply_spoofchk()
1216 ice_vsi_release(vf->pf->vsi[vf->ctrl_vsi_idx]); in ice_vf_ctrl_vsi_release()
1231 struct ice_vsi *vsi; in ice_vf_ctrl_vsi_setup() local
1238 vsi = ice_vsi_setup(pf, ¶ms); in ice_vf_ctrl_vsi_setup()
1239 if (!vsi) { in ice_vf_ctrl_vsi_setup()
1244 return vsi; in ice_vf_ctrl_vsi_setup()
1256 int ice_vf_init_host_cfg(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_init_host_cfg() argument
1266 err = ice_vsi_add_vlan_zero(vsi); in ice_vf_init_host_cfg()
1273 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vf_init_host_cfg()
1274 err = vlan_ops->ena_rx_filtering(vsi); in ice_vf_init_host_cfg()
1282 err = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI); in ice_vf_init_host_cfg()
1291 err = ice_vsi_apply_spoofchk(vsi, vf->spoofchk); in ice_vf_init_host_cfg()
1320 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_vsi_release() local
1322 if (WARN_ON(!vsi)) in ice_vf_vsi_release()
1325 ice_vsi_release(vsi); in ice_vf_vsi_release()
1343 struct ice_vsi *ice_get_vf_ctrl_vsi(struct ice_pf *pf, struct ice_vsi *vsi) in ice_get_vf_ctrl_vsi() argument
1351 if (vf != vsi->vf && vf->ctrl_vsi_idx != ICE_NO_VSI) { in ice_get_vf_ctrl_vsi()
1352 ctrl_vsi = pf->vsi[vf->ctrl_vsi_idx]; in ice_get_vf_ctrl_vsi()