diff mbox series

[10/11] net/hns3: fix link status when failure in issuing command

Message ID 20200109031559.63194-11-huwei013@chinasoftinc.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series misc updates and fixes for hns3 PMD driver | expand


Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Wei Hu (Xavier) Jan. 9, 2020, 3:15 a.m. UTC
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>

Currently, the hns3 PMD driver issues command to the firmware and gets link
status information.

When the driver fails to call internal interface function named
hns3_cmd_send to query the status from firmware for some reason, the link
status queried by the driver should be down.

Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 drivers/net/hns3/hns3_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index b05a55781..9866d147b 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3836,7 +3836,7 @@  hns3_get_mac_link_status(struct hns3_hw *hw)
 	ret = hns3_cmd_send(hw, &desc, 1);
 	if (ret) {
 		hns3_err(hw, "get link status cmd failed %d", ret);
-		return ret;
+		return ETH_LINK_DOWN;
 	req = (struct hns3_link_status_cmd *)desc.data;