net: hns3: fix failed to add reuse multicast mac addr to hardware when mc mac table...
authorGuangbin Huang <huangguangbin2@huawei.com>
Wed, 10 Nov 2021 13:42:49 +0000 (21:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Nov 2021 14:20:43 +0000 (14:20 +0000)
commit3b4c6566c158e0449d490165c1a64d9e410b3007
tree4e01d9fd65e73f8bd0997801cec14f09d2956b1d
parent8f1bc38bbb516826ede8c96cb73a884221f1a314
net: hns3: fix failed to add reuse multicast mac addr to hardware when mc mac table is full

Currently, when driver is failed to add a new multicast mac address to
hardware due to the multicast mac table is full, it will directly return.
In this case, if the multicast mac list has some reuse addresses after the
new address, those reuse addresses will never be added to hardware.

To fix this problem, if function hclge_add_mc_addr_common() returns
-ENOSPC, hclge_sync_vport_mac_list() should judge whether continue or
stop to add next address.

As function hclge_sync_vport_mac_list() needs parameter mac_type to know
whether is uc or mc, refine this function to add parameter mac_type and
remove parameter sync. So does function hclge_unsync_vport_mac_list().

Fixes: ee4bcd3b7ae4 ("net: hns3: refactor the MAC address configure")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c