]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix show wrong state when add existing uc mac address
authorJian Shen <shenjian15@huawei.com>
Wed, 29 Sep 2021 09:35:53 +0000 (17:35 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Sep 2021 10:03:54 +0000 (11:03 +0100)
commit7640c137ead2ab416714e258c150ef62df98476e
tree99b1c97270fc7ec8fd83d0b28d55c6ef9696854b
parent725d28c2c88c73fa218bf6db4b202e4c39891d9f
net: hns3: fix show wrong state when add existing uc mac address

Currently, if function adds an existing unicast mac address, eventhough
driver will not add this address into hardware, but it will return 0 in
function hclge_add_uc_addr_common(). It will cause the state of this
unicast mac address is ACTIVE in driver, but it should be in TO-ADD state.

To fix this problem, function hclge_add_uc_addr_common() returns -EEXIST
if mac address is existing, and delete two error log to avoid printing
them all the time after this modification.

Fixes: a460c712be76 ("net: hns3: return 0 and print warning when hit duplicate MAC")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
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