]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.51/net-hns3-return-0-and-print-warning-when-hit-duplica.patch
Linux 4.19.51
[thirdparty/kernel/stable-queue.git] / releases / 4.19.51 / net-hns3-return-0-and-print-warning-when-hit-duplica.patch
CommitLineData
37554d48
SL
1From 6e49ca3030add16af7c11ee334903db78da19120 Mon Sep 17 00:00:00 2001
2From: Peng Li <lipeng321@huawei.com>
3Date: Thu, 4 Apr 2019 16:17:51 +0800
4Subject: net: hns3: return 0 and print warning when hit duplicate MAC
5
6[ Upstream commit 72110b567479f0282489a9b3747e76d8c67d75f5 ]
7
8When set 2 same MAC to different function of one port, IMP
9will return error as the later one may modify the origin one.
10This will cause bond fail for 2 VFs of one port.
11
12Driver just print warning and return 0 with this patch, so
13if set same MAC address, it will return 0 but do not really
14configure HW.
15
16Signed-off-by: Peng Li <lipeng321@huawei.com>
17Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-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
24diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
25index 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--
432.20.1
44