]> 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)
commitff349d8a9273bc93eb02116ba506f781713ef7c7
tree99b1c97270fc7ec8fd83d0b28d55c6ef9696854b
parent89e52eb4f7ac93554f457917b110c29b61b26d22
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: 51f76ab09241 ("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