]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add existence checking before adding unicast mac address
authorJian Shen <shenjian15@huawei.com>
Sat, 10 Mar 2018 03:29:32 +0000 (11:29 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Mar 2018 02:53:32 +0000 (22:53 -0400)
commit4e8f8d802ee7bc3907fdde5ee8ff4cfb6280f71d
tree3e76c94e0ea9a5b0bcf9eb2ccb9a471adad09a33
parent8099ee38b4edec6581480d2a4f389008d37df133
net: hns3: add existence checking before adding unicast mac address

It's not allowed to add two same unicast mac address entries to the
mac_vlan table. When modify the uc mac address of a VF device to the
same value with the PF device's, the PF device will lose its entry of
the mac_vlan table.

Lookup the mac address in the mac_vlan table, and add it if the entry
is inexistent.

Fixes: 22c0e2ce21dd ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c