Skip to content

Commit 40229b2

Browse files
iveceragregkh
authored andcommitted
ice: Clear default forwarding VSI during VSI release
[ Upstream commit bd8c624 ] VSI is set as default forwarding one when promisc mode is set for PF interface, when PF is switched to switchdev mode or when VF driver asks to enable allmulticast or promisc mode for the VF interface (when vf-true-promisc-support priv flag is off). The third case is buggy because in that case VSI associated with VF remains as default one after VF removal. Reproducer: 1. Create VF echo 1 > sys/class/net/ens7f0/device/sriov_numvfs 2. Enable allmulticast or promisc mode on VF ip link set ens7f0v0 allmulticast on ip link set ens7f0v0 promisc on 3. Delete VF echo 0 > sys/class/net/ens7f0/device/sriov_numvfs 4. Try to enable promisc mode on PF ip link set ens7f0 promisc on Although it looks that promisc mode on PF is enabled the opposite is true because ice_vsi_sync_fltr() responsible for IFF_PROMISC handling first checks if any other VSI is set as default forwarding one and if so the function does not do anything. At this point it is not possible to enable promisc mode on PF without re-probe device. To resolve the issue this patch clear default forwarding VSI during ice_vsi_release() when the VSI to be released is the default one. Fixes: 01b5e89 ("ice: Add VF promiscuous support") Signed-off-by: Ivan Vecera <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Reviewed-by: Maciej Fijalkowski <[email protected]> Signed-off-by: Alice Michael <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent ba965e8 commit 40229b2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,6 +2923,8 @@ int ice_vsi_release(struct ice_vsi *vsi)
29232923
}
29242924
}
29252925

2926+
if (ice_is_vsi_dflt_vsi(pf->first_sw, vsi))
2927+
ice_clear_dflt_vsi(pf->first_sw);
29262928
ice_fltr_remove_all(vsi);
29272929
ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);
29282930
err = ice_rm_vsi_rdma_cfg(vsi->port_info, vsi->idx);

0 commit comments

Comments
 (0)