]>
Commit | Line | Data |
---|---|---|
37554d48 SL |
1 | From 6e49ca3030add16af7c11ee334903db78da19120 Mon Sep 17 00:00:00 2001 |
2 | From: Peng Li <lipeng321@huawei.com> | |
3 | Date: Thu, 4 Apr 2019 16:17:51 +0800 | |
4 | Subject: net: hns3: return 0 and print warning when hit duplicate MAC | |
5 | ||
6 | [ Upstream commit 72110b567479f0282489a9b3747e76d8c67d75f5 ] | |
7 | ||
8 | When set 2 same MAC to different function of one port, IMP | |
9 | will return error as the later one may modify the origin one. | |
10 | This will cause bond fail for 2 VFs of one port. | |
11 | ||
12 | Driver just print warning and return 0 with this patch, so | |
13 | if set same MAC address, it will return 0 but do not really | |
14 | configure HW. | |
15 | ||
16 | Signed-off-by: Peng Li <lipeng321@huawei.com> | |
17 | Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> | |
18 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
19 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
20 | --- | |
21 | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++++-- | |
22 | 1 file changed, 5 insertions(+), 2 deletions(-) | |
23 | ||
24 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | |
25 | index 340baf6a470c..4648c6a9d9e8 100644 | |
26 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | |
27 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | |
28 | @@ -4300,8 +4300,11 @@ int hclge_add_uc_addr_common(struct hclge_vport *vport, | |
29 | return hclge_add_mac_vlan_tbl(vport, &req, NULL); | |
30 | ||
31 | /* check if we just hit the duplicate */ | |
32 | - if (!ret) | |
33 | - ret = -EINVAL; | |
34 | + if (!ret) { | |
35 | + dev_warn(&hdev->pdev->dev, "VF %d mac(%pM) exists\n", | |
36 | + vport->vport_id, addr); | |
37 | + return 0; | |
38 | + } | |
39 | ||
40 | dev_err(&hdev->pdev->dev, | |
41 | "PF failed to add unicast entry(%pM) in the MAC table\n", | |
42 | -- | |
43 | 2.20.1 | |
44 |