提交 47ef6dec 编写于 作者: J Jian Shen 提交者: David S. Miller

net: hns3: fix return value handle issue for hclge_set_loopback()

In current code, it always return 0, even loopback mode setting failed.
It's incorrect. This patch fixes return value handle for loopback test.

Fixes: 0f29fc23 ("net: hns3: Fix for loopback selftest failed problem")
Signed-off-by: NJian Shen <shenjian15@huawei.com>
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1821dce9
......@@ -117,7 +117,7 @@ static int hns3_lp_up(struct net_device *ndev, enum hnae3_loop loop_mode)
ret = hns3_lp_setup(ndev, loop_mode, true);
usleep_range(10000, 20000);
return 0;
return ret;
}
static int hns3_lp_down(struct net_device *ndev, enum hnae3_loop loop_mode)
......@@ -334,10 +334,10 @@ static void hns3_self_test(struct net_device *ndev,
continue;
data[test_index] = hns3_lp_up(ndev, loop_type);
if (!data[test_index]) {
if (!data[test_index])
data[test_index] = hns3_lp_run_test(ndev, loop_type);
hns3_lp_down(ndev, loop_type);
}
hns3_lp_down(ndev, loop_type);
if (data[test_index])
eth_test->flags |= ETH_TEST_FL_FAILED;
......
......@@ -5332,6 +5332,9 @@ static int hclge_set_loopback(struct hnae3_handle *handle,
break;
}
if (ret)
return ret;
kinfo = &vport->nic.kinfo;
for (i = 0; i < kinfo->num_tqps; i++) {
ret = hclge_tqp_enable(hdev, i, 0, en);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册