提交 fcbdd770 编写于 作者: N Nick Nunley 提交者: Zheng Zengkai

ice: update dev_addr in ice_set_mac_address even if HW filter exists

stable inclusion
from stable-5.10.13
commit 55717a10a6b837355bf0dc3346346782f9302869
bugzilla: 47995

--------------------------------

[ Upstream commit 13ed5e8a ]

Fix the driver to copy the MAC address configured in ndo_set_mac_address
into dev_addr, even if the MAC filter already exists in HW. In some
situations (e.g. bonding) the netdev's dev_addr could have been modified
outside of the driver, with no change to the HW filter, so the driver
cannot assume that they match.

Fixes: 757976ab ("ice: Fix check for removing/adding mac filters")
Signed-off-by: NNick Nunley <nicholas.d.nunley@intel.com>
Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 d40e0a80
...@@ -4887,9 +4887,15 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi) ...@@ -4887,9 +4887,15 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
goto err_update_filters; goto err_update_filters;
} }
/* Add filter for new MAC. If filter exists, just return success */ /* Add filter for new MAC. If filter exists, return success */
status = ice_fltr_add_mac(vsi, mac, ICE_FWD_TO_VSI); status = ice_fltr_add_mac(vsi, mac, ICE_FWD_TO_VSI);
if (status == ICE_ERR_ALREADY_EXISTS) { if (status == ICE_ERR_ALREADY_EXISTS) {
/* Although this MAC filter is already present in hardware it's
* possible in some cases (e.g. bonding) that dev_addr was
* modified outside of the driver and needs to be restored back
* to this value.
*/
memcpy(netdev->dev_addr, mac, netdev->addr_len);
netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac); netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册