Skip to content

Commit c79bb28

Browse files
Marcin Szycikanguy11
authored andcommitted
ice: Clear synchronized addrs when adding VFs in switchdev mode
When spawning VFs in switchdev mode, internal filter list of VSIs is cleared, which includes MAC rules. However MAC entries stay on netdev's multicast list, which causes error message when bringing link up after spawning VFs ("Failed to delete MAC filters"). __dev_mc_sync() is called and tries to unsync addresses that were already removed internally when adding VFs. This can be reproduced with: 1) Load ice driver 2) Change PF to switchdev mode 3) Bring PF link up 4) Bring PF link down 5) Create a VF on PF 6) Bring PF link up Added clearing of netdev's multicast (and also unicast) list when spawning VFs in switchdev mode, so the state of internal rule list and netdev's MAC list is consistent. Fixes: 1a1c40d ("ice: set and release switchdev environment") Signed-off-by: Marcin Szycik <[email protected]> Tested-by: Sandeep Penigalapati <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 29e71f4 commit c79bb28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
static int ice_eswitch_setup_env(struct ice_pf *pf)
2020
{
2121
struct ice_vsi *uplink_vsi = pf->switchdev.uplink_vsi;
22+
struct net_device *uplink_netdev = uplink_vsi->netdev;
2223
struct ice_vsi *ctrl_vsi = pf->switchdev.control_vsi;
2324
struct ice_port_info *pi = pf->hw.port_info;
2425
bool rule_added = false;
@@ -27,6 +28,11 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
2728

2829
ice_remove_vsi_fltr(&pf->hw, uplink_vsi->idx);
2930

31+
netif_addr_lock_bh(uplink_netdev);
32+
__dev_uc_unsync(uplink_netdev, NULL);
33+
__dev_mc_unsync(uplink_netdev, NULL);
34+
netif_addr_unlock_bh(uplink_netdev);
35+
3036
if (ice_vsi_add_vlan(uplink_vsi, 0, ICE_FWD_TO_VSI))
3137
goto err_def_rx;
3238

0 commit comments

Comments
 (0)