Lines Matching refs:vsi
128 return vf->pf->vsi[vf->lan_vsi_idx]; in ice_get_vf_vsi()
223 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_clear_counters() local
225 if (vsi) in ice_vf_clear_counters()
226 vsi->num_vlan = 0; in ice_vf_clear_counters()
262 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_reconfig_vsi() local
266 if (WARN_ON(!vsi)) in ice_vf_reconfig_vsi()
269 vsi->flags = ICE_VSI_FLAG_NO_INIT; in ice_vf_reconfig_vsi()
271 ice_vsi_decfg(vsi); in ice_vf_reconfig_vsi()
272 ice_fltr_remove_all(vsi); in ice_vf_reconfig_vsi()
274 err = ice_vsi_cfg(vsi); in ice_vf_reconfig_vsi()
296 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_vsi() local
299 if (WARN_ON(!vsi)) in ice_vf_rebuild_vsi()
302 if (ice_vsi_rebuild(vsi, ICE_VSI_FLAG_INIT)) { in ice_vf_rebuild_vsi()
310 vsi->vsi_num = ice_get_hw_vsi_num(&pf->hw, vsi->idx); in ice_vf_rebuild_vsi()
323 static int ice_vf_rebuild_host_vlan_cfg(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_rebuild_host_vlan_cfg() argument
325 struct ice_vsi_vlan_ops *vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vf_rebuild_host_vlan_cfg()
330 err = vlan_ops->set_port_vlan(vsi, &vf->port_vlan_info); in ice_vf_rebuild_host_vlan_cfg()
337 err = vlan_ops->add_vlan(vsi, &vf->port_vlan_info); in ice_vf_rebuild_host_vlan_cfg()
340 err = ice_vsi_clear_port_vlan(vsi); in ice_vf_rebuild_host_vlan_cfg()
346 err = ice_vsi_add_vlan_zero(vsi); in ice_vf_rebuild_host_vlan_cfg()
356 err = vlan_ops->ena_rx_filtering(vsi); in ice_vf_rebuild_host_vlan_cfg()
359 vf->vf_id, vsi->idx, err); in ice_vf_rebuild_host_vlan_cfg()
374 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_host_tx_rate_cfg() local
377 if (WARN_ON(!vsi)) in ice_vf_rebuild_host_tx_rate_cfg()
381 err = ice_set_min_bw_limit(vsi, (u64)vf->min_tx_rate * 1000); in ice_vf_rebuild_host_tx_rate_cfg()
390 err = ice_set_max_bw_limit(vsi, (u64)vf->max_tx_rate * 1000); in ice_vf_rebuild_host_tx_rate_cfg()
420 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_host_mac_cfg() local
424 if (WARN_ON(!vsi)) in ice_vf_rebuild_host_mac_cfg()
431 status = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI); in ice_vf_rebuild_host_mac_cfg()
441 status = ice_fltr_add_mac(vsi, vf->hw_lan_addr, in ice_vf_rebuild_host_mac_cfg()
464 static void ice_vf_rebuild_aggregator_node_cfg(struct ice_vsi *vsi) in ice_vf_rebuild_aggregator_node_cfg() argument
466 struct ice_pf *pf = vsi->back; in ice_vf_rebuild_aggregator_node_cfg()
470 if (!vsi->agg_node) in ice_vf_rebuild_aggregator_node_cfg()
474 if (vsi->agg_node->num_vsis == ICE_MAX_VSIS_IN_AGG_NODE) { in ice_vf_rebuild_aggregator_node_cfg()
477 vsi->agg_node->agg_id, vsi->agg_node->num_vsis); in ice_vf_rebuild_aggregator_node_cfg()
481 status = ice_move_vsi_to_agg(pf->hw.port_info, vsi->agg_node->agg_id, in ice_vf_rebuild_aggregator_node_cfg()
482 vsi->idx, vsi->tc_cfg.ena_tc); in ice_vf_rebuild_aggregator_node_cfg()
485 vsi->idx, vsi->agg_node->agg_id); in ice_vf_rebuild_aggregator_node_cfg()
487 vsi->agg_node->num_vsis++; in ice_vf_rebuild_aggregator_node_cfg()
497 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_rebuild_host_cfg() local
499 if (WARN_ON(!vsi)) in ice_vf_rebuild_host_cfg()
508 if (ice_vf_rebuild_host_vlan_cfg(vf, vsi)) in ice_vf_rebuild_host_cfg()
516 if (ice_vsi_apply_spoofchk(vsi, vf->spoofchk)) in ice_vf_rebuild_host_cfg()
521 ice_vf_rebuild_aggregator_node_cfg(vsi); in ice_vf_rebuild_host_cfg()
606 ice_vf_get_promisc_masks(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vf_get_promisc_masks() argument
610 ice_vsi_has_non_zero_vlans(vsi)) { in ice_vf_get_promisc_masks()
627 ice_vf_clear_all_promisc_modes(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_clear_all_promisc_modes() argument
633 ice_vf_get_promisc_masks(vf, vsi, &ucast_m, &mcast_m); in ice_vf_clear_all_promisc_modes()
636 if (ice_is_dflt_vsi_in_use(vsi->port_info)) in ice_vf_clear_all_promisc_modes()
637 ret = ice_clear_dflt_vsi(vsi); in ice_vf_clear_all_promisc_modes()
639 ret = ice_vf_clear_vsi_promisc(vf, vsi, ucast_m); in ice_vf_clear_all_promisc_modes()
651 ret = ice_vf_clear_vsi_promisc(vf, vsi, mcast_m); in ice_vf_clear_all_promisc_modes()
669 ice_vf_set_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m) in ice_vf_set_vsi_promisc() argument
671 struct ice_hw *hw = &vsi->back->hw; in ice_vf_set_vsi_promisc()
675 status = ice_fltr_set_vsi_promisc(hw, vsi->idx, promisc_m, in ice_vf_set_vsi_promisc()
677 else if (ice_vsi_has_non_zero_vlans(vsi)) in ice_vf_set_vsi_promisc()
678 status = ice_fltr_set_vlan_vsi_promisc(hw, vsi, promisc_m); in ice_vf_set_vsi_promisc()
680 status = ice_fltr_set_vsi_promisc(hw, vsi->idx, promisc_m, 0); in ice_vf_set_vsi_promisc()
683 …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()
698 ice_vf_clear_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m) in ice_vf_clear_vsi_promisc() argument
700 struct ice_hw *hw = &vsi->back->hw; in ice_vf_clear_vsi_promisc()
704 status = ice_fltr_clear_vsi_promisc(hw, vsi->idx, promisc_m, in ice_vf_clear_vsi_promisc()
706 else if (ice_vsi_has_non_zero_vlans(vsi)) in ice_vf_clear_vsi_promisc()
707 status = ice_fltr_clear_vlan_vsi_promisc(hw, vsi, promisc_m); in ice_vf_clear_vsi_promisc()
709 status = ice_fltr_clear_vsi_promisc(hw, vsi->idx, promisc_m, 0); in ice_vf_clear_vsi_promisc()
712 …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()
862 struct ice_vsi *vsi; in ice_reset_vf() local
888 vsi = ice_get_vf_vsi(vf); in ice_reset_vf()
889 if (!vsi) { in ice_reset_vf()
894 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id); in ice_reset_vf()
896 if (ice_vsi_is_rx_queue_active(vsi)) in ice_reset_vf()
897 ice_vsi_stop_all_rx_rings(vsi); in ice_reset_vf()
908 vsi = ice_get_vf_vsi(vf); in ice_reset_vf()
909 if (WARN_ON(!vsi)) { in ice_reset_vf()
919 ice_dis_vsi_txq(vsi->port_info, vsi->idx, 0, 0, NULL, NULL, in ice_reset_vf()
939 ice_vf_clear_all_promisc_modes(vf, vsi); in ice_reset_vf()
959 vsi = ice_get_vf_vsi(vf); in ice_reset_vf()
960 if (WARN_ON(!vsi)) { in ice_reset_vf()
965 ice_eswitch_update_repr(&vf->repr_id, vsi); in ice_reset_vf()
1044 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_dis_vf_qs() local
1046 if (WARN_ON(!vsi)) in ice_dis_vf_qs()
1049 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id); in ice_dis_vf_qs()
1050 ice_vsi_stop_all_rx_rings(vsi); in ice_dis_vf_qs()
1110 static int ice_cfg_mac_antispoof(struct ice_vsi *vsi, bool enable) in ice_cfg_mac_antispoof() argument
1119 ctx->info.sec_flags = vsi->info.sec_flags; in ice_cfg_mac_antispoof()
1127 err = ice_update_vsi(&vsi->back->hw, vsi->idx, ctx, NULL); in ice_cfg_mac_antispoof()
1129 …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()
1130 enable ? "ON" : "OFF", vsi->vsi_num, err); in ice_cfg_mac_antispoof()
1132 vsi->info.sec_flags = ctx->info.sec_flags; in ice_cfg_mac_antispoof()
1143 static int ice_vsi_ena_spoofchk(struct ice_vsi *vsi) in ice_vsi_ena_spoofchk() argument
1148 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vsi_ena_spoofchk()
1151 if (vsi->type != ICE_VSI_VF || ice_vsi_has_non_zero_vlans(vsi)) { in ice_vsi_ena_spoofchk()
1152 err = vlan_ops->ena_tx_filtering(vsi); in ice_vsi_ena_spoofchk()
1157 return ice_cfg_mac_antispoof(vsi, true); in ice_vsi_ena_spoofchk()
1164 static int ice_vsi_dis_spoofchk(struct ice_vsi *vsi) in ice_vsi_dis_spoofchk() argument
1169 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vsi_dis_spoofchk()
1171 err = vlan_ops->dis_tx_filtering(vsi); in ice_vsi_dis_spoofchk()
1175 return ice_cfg_mac_antispoof(vsi, false); in ice_vsi_dis_spoofchk()
1183 int ice_vsi_apply_spoofchk(struct ice_vsi *vsi, bool enable) in ice_vsi_apply_spoofchk() argument
1188 err = ice_vsi_ena_spoofchk(vsi); in ice_vsi_apply_spoofchk()
1190 err = ice_vsi_dis_spoofchk(vsi); in ice_vsi_apply_spoofchk()
1252 ice_vsi_release(vf->pf->vsi[vf->ctrl_vsi_idx]); in ice_vf_ctrl_vsi_release()
1267 struct ice_vsi *vsi; in ice_vf_ctrl_vsi_setup() local
1274 vsi = ice_vsi_setup(pf, ¶ms); in ice_vf_ctrl_vsi_setup()
1275 if (!vsi) { in ice_vf_ctrl_vsi_setup()
1280 return vsi; in ice_vf_ctrl_vsi_setup()
1292 int ice_vf_init_host_cfg(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_init_host_cfg() argument
1302 err = ice_vsi_add_vlan_zero(vsi); in ice_vf_init_host_cfg()
1309 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi); in ice_vf_init_host_cfg()
1310 err = vlan_ops->ena_rx_filtering(vsi); in ice_vf_init_host_cfg()
1318 err = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI); in ice_vf_init_host_cfg()
1327 err = ice_vsi_apply_spoofchk(vsi, vf->spoofchk); in ice_vf_init_host_cfg()
1355 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_vsi_release() local
1357 if (WARN_ON(!vsi)) in ice_vf_vsi_release()
1360 ice_vsi_release(vsi); in ice_vf_vsi_release()
1378 struct ice_vsi *ice_get_vf_ctrl_vsi(struct ice_pf *pf, struct ice_vsi *vsi) in ice_get_vf_ctrl_vsi() argument
1386 if (vf != vsi->vf && vf->ctrl_vsi_idx != ICE_NO_VSI) { in ice_get_vf_ctrl_vsi()
1387 ctrl_vsi = pf->vsi[vf->ctrl_vsi_idx]; in ice_get_vf_ctrl_vsi()
1402 void ice_vf_update_mac_lldp_num(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vf_update_mac_lldp_num() argument
1405 bool lldp_by_fw = test_bit(ICE_FLAG_FW_LLDP_AGENT, vsi->back->flags); in ice_vf_update_mac_lldp_num()
1409 if (WARN_ON(!vsi)) { in ice_vf_update_mac_lldp_num()
1418 ice_vsi_cfg_sw_lldp(vsi, false, is_ena); in ice_vf_update_mac_lldp_num()