提交 108b3c78 编写于 作者: J Jian Shen 提交者: David S. Miller

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: 72110b56 ("net: hns3: return 0 and print warning when hit duplicate MAC")
Signed-off-by: NJian Shen <shenjian15@huawei.com>
Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0472e95f
...@@ -8708,15 +8708,8 @@ int hclge_add_uc_addr_common(struct hclge_vport *vport, ...@@ -8708,15 +8708,8 @@ int hclge_add_uc_addr_common(struct hclge_vport *vport,
} }
/* check if we just hit the duplicate */ /* check if we just hit the duplicate */
if (!ret) { if (!ret)
dev_warn(&hdev->pdev->dev, "VF %u mac(%pM) exists\n", return -EEXIST;
vport->vport_id, addr);
return 0;
}
dev_err(&hdev->pdev->dev,
"PF failed to add unicast entry(%pM) in the MAC table\n",
addr);
return ret; return ret;
} }
...@@ -8868,7 +8861,13 @@ static void hclge_sync_vport_mac_list(struct hclge_vport *vport, ...@@ -8868,7 +8861,13 @@ static void hclge_sync_vport_mac_list(struct hclge_vport *vport,
} else { } else {
set_bit(HCLGE_VPORT_STATE_MAC_TBL_CHANGE, set_bit(HCLGE_VPORT_STATE_MAC_TBL_CHANGE,
&vport->state); &vport->state);
break;
/* If one unicast mac address is existing in hardware,
* we need to try whether other unicast mac addresses
* are new addresses that can be added.
*/
if (ret != -EEXIST)
break;
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册