Lines Matching refs:vsi

128 	return vf->pf->vsi[vf->lan_vsi_idx];
223 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
225 if (vsi)
226 vsi->num_vlan = 0;
261 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
266 if (WARN_ON(!vsi))
269 params = ice_vsi_to_params(vsi);
272 ice_vsi_decfg(vsi);
273 ice_fltr_remove_all(vsi);
275 err = ice_vsi_cfg(vsi, &params);
297 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
300 if (WARN_ON(!vsi))
303 if (ice_vsi_rebuild(vsi, ICE_VSI_FLAG_INIT)) {
308 /* vsi->idx will remain the same in this case so don't update
311 vsi->vsi_num = ice_get_hw_vsi_num(&pf->hw, vsi->idx);
319 * @vsi: Pointer to VSI
324 static int ice_vf_rebuild_host_vlan_cfg(struct ice_vf *vf, struct ice_vsi *vsi)
326 struct ice_vsi_vlan_ops *vlan_ops = ice_get_compat_vsi_vlan_ops(vsi);
331 err = vlan_ops->set_port_vlan(vsi, &vf->port_vlan_info);
338 err = vlan_ops->add_vlan(vsi, &vf->port_vlan_info);
340 err = ice_vsi_add_vlan_zero(vsi);
350 err = vlan_ops->ena_rx_filtering(vsi);
353 vf->vf_id, vsi->idx, err);
368 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
371 if (WARN_ON(!vsi))
375 err = ice_set_min_bw_limit(vsi, (u64)vf->min_tx_rate * 1000);
384 err = ice_set_max_bw_limit(vsi, (u64)vf->max_tx_rate * 1000);
414 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
418 if (WARN_ON(!vsi))
425 status = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI);
435 status = ice_fltr_add_mac(vsi, vf->hw_lan_addr,
453 * @vsi: Pointer to VSI
458 static void ice_vf_rebuild_aggregator_node_cfg(struct ice_vsi *vsi)
460 struct ice_pf *pf = vsi->back;
464 if (!vsi->agg_node)
468 if (vsi->agg_node->num_vsis == ICE_MAX_VSIS_IN_AGG_NODE) {
471 vsi->agg_node->agg_id, vsi->agg_node->num_vsis);
475 status = ice_move_vsi_to_agg(pf->hw.port_info, vsi->agg_node->agg_id,
476 vsi->idx, vsi->tc_cfg.ena_tc);
479 vsi->idx, vsi->agg_node->agg_id);
481 vsi->agg_node->num_vsis++;
491 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
493 if (WARN_ON(!vsi))
502 if (ice_vf_rebuild_host_vlan_cfg(vf, vsi))
510 if (ice_vsi_apply_spoofchk(vsi, vf->spoofchk))
515 ice_vf_rebuild_aggregator_node_cfg(vsi);
592 * @vsi: the VSI to configure
600 ice_vf_get_promisc_masks(struct ice_vf *vf, struct ice_vsi *vsi,
604 ice_vsi_has_non_zero_vlans(vsi)) {
616 * @vsi: the VSI to configure
621 ice_vf_clear_all_promisc_modes(struct ice_vf *vf, struct ice_vsi *vsi)
627 ice_vf_get_promisc_masks(vf, vsi, &ucast_m, &mcast_m);
630 if (ice_is_dflt_vsi_in_use(vsi->port_info))
631 ret = ice_clear_dflt_vsi(vsi);
633 ret = ice_vf_clear_vsi_promisc(vf, vsi, ucast_m);
645 ret = ice_vf_clear_vsi_promisc(vf, vsi, mcast_m);
659 * @vsi: the VF's VSI
663 ice_vf_set_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m)
665 struct ice_hw *hw = &vsi->back->hw;
669 status = ice_fltr_set_vsi_promisc(hw, vsi->idx, promisc_m,
671 else if (ice_vsi_has_non_zero_vlans(vsi))
672 status = ice_fltr_set_vlan_vsi_promisc(hw, vsi, promisc_m);
674 status = ice_fltr_set_vsi_promisc(hw, vsi->idx, promisc_m, 0);
677 dev_err(ice_pf_to_dev(vsi->back), "enable Tx/Rx filter promiscuous mode on VF-%u failed, error: %d\n",
688 * @vsi: the VF's VSI
692 ice_vf_clear_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m)
694 struct ice_hw *hw = &vsi->back->hw;
698 status = ice_fltr_clear_vsi_promisc(hw, vsi->idx, promisc_m,
700 else if (ice_vsi_has_non_zero_vlans(vsi))
701 status = ice_fltr_clear_vlan_vsi_promisc(hw, vsi, promisc_m);
703 status = ice_fltr_clear_vsi_promisc(hw, vsi->idx, promisc_m, 0);
706 dev_err(ice_pf_to_dev(vsi->back), "disable Tx/Rx filter promiscuous mode on VF-%u failed, error: %d\n",
840 struct ice_vsi *vsi;
876 vsi = ice_get_vf_vsi(vf);
877 if (!vsi) {
882 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id);
884 if (ice_vsi_is_rx_queue_active(vsi))
885 ice_vsi_stop_all_rx_rings(vsi);
896 vsi = ice_get_vf_vsi(vf);
897 if (WARN_ON(!vsi)) {
907 ice_dis_vsi_txq(vsi->port_info, vsi->idx, 0, 0, NULL, NULL,
927 ice_vf_clear_all_promisc_modes(vf, vsi);
947 vsi = ice_get_vf_vsi(vf);
948 if (WARN_ON(!vsi)) {
953 ice_eswitch_update_repr(vf->repr_id, vsi);
1017 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
1019 if (WARN_ON(!vsi))
1022 ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id);
1023 ice_vsi_stop_all_rx_rings(vsi);
1078 * @vsi: the VSI to configure
1083 static int ice_cfg_mac_antispoof(struct ice_vsi *vsi, bool enable)
1092 ctx->info.sec_flags = vsi->info.sec_flags;
1100 err = ice_update_vsi(&vsi->back->hw, vsi->idx, ctx, NULL);
1102 dev_err(ice_pf_to_dev(vsi->back), "Failed to configure Tx MAC anti-spoof %s for VSI %d, error %d\n",
1103 enable ? "ON" : "OFF", vsi->vsi_num, err);
1105 vsi->info.sec_flags = ctx->info.sec_flags;
1114 * @vsi: VSI to enable Tx spoof checking for
1116 static int ice_vsi_ena_spoofchk(struct ice_vsi *vsi)
1121 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi);
1124 if (vsi->type != ICE_VSI_VF || ice_vsi_has_non_zero_vlans(vsi)) {
1125 err = vlan_ops->ena_tx_filtering(vsi);
1130 return ice_cfg_mac_antispoof(vsi, true);
1135 * @vsi: VSI to disable Tx spoof checking for
1137 static int ice_vsi_dis_spoofchk(struct ice_vsi *vsi)
1142 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi);
1144 err = vlan_ops->dis_tx_filtering(vsi);
1148 return ice_cfg_mac_antispoof(vsi, false);
1153 * @vsi: VSI associated to the VF
1156 int ice_vsi_apply_spoofchk(struct ice_vsi *vsi, bool enable)
1161 err = ice_vsi_ena_spoofchk(vsi);
1163 err = ice_vsi_dis_spoofchk(vsi);
1225 ice_vsi_release(vf->pf->vsi[vf->ctrl_vsi_idx]);
1240 struct ice_vsi *vsi;
1247 vsi = ice_vsi_setup(pf, &params);
1248 if (!vsi) {
1253 return vsi;
1259 * @vsi: the VSI created at initialization
1265 int ice_vf_init_host_cfg(struct ice_vf *vf, struct ice_vsi *vsi)
1275 err = ice_vsi_add_vlan_zero(vsi);
1282 vlan_ops = ice_get_compat_vsi_vlan_ops(vsi);
1283 err = vlan_ops->ena_rx_filtering(vsi);
1291 err = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI);
1300 err = ice_vsi_apply_spoofchk(vsi, vf->spoofchk);
1328 struct ice_vsi *vsi = ice_get_vf_vsi(vf);
1330 if (WARN_ON(!vsi))
1333 ice_vsi_release(vsi);
1340 * @vsi: pointer to the VSI
1342 * Return first found VF control VSI other than the vsi
1351 struct ice_vsi *ice_get_vf_ctrl_vsi(struct ice_pf *pf, struct ice_vsi *vsi)
1359 if (vf != vsi->vf && vf->ctrl_vsi_idx != ICE_NO_VSI) {
1360 ctrl_vsi = pf->vsi[vf->ctrl_vsi_idx];