1 |
From 3d89a98755ba6d5296d6c9ac85598b034586a373 Mon Sep 17 00:00:00 2001 |
2 |
From: Yunsheng Lin <linyunsheng@huawei.com> |
3 |
Date: Mon, 3 Sep 2018 11:21:51 +0100 |
4 |
Subject: [PATCH 069/145] net: hns3: Fix ping exited problem when doing lp |
5 |
selftest |
6 |
|
7 |
[ Upstream commit 3f8601f0f5716c4e63a9f215bbc581df42859d61 ] |
8 |
|
9 |
When ping is runnig and user executes the loopback selftest, the |
10 |
ping cmd will stop and exit. |
11 |
|
12 |
This patch fixes it by using the hns3_nic_net_open/stop to offline |
13 |
the netdev when doing loopback selftest. |
14 |
|
15 |
Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver") |
16 |
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> |
17 |
Signed-off-by: Peng Li <lipeng321@huawei.com> |
18 |
Signed-off-by: Salil Mehta <salil.mehta@huawei.com> |
19 |
Signed-off-by: David S. Miller <davem@davemloft.net> |
20 |
Signed-off-by: Sasha Levin <sashal@kernel.org> |
21 |
--- |
22 |
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 ++-- |
23 |
1 file changed, 2 insertions(+), 2 deletions(-) |
24 |
|
25 |
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |
26 |
index f70ee6910ee2..9684ad015c42 100644 |
27 |
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |
28 |
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |
29 |
@@ -309,7 +309,7 @@ static void hns3_self_test(struct net_device *ndev, |
30 |
h->flags & HNAE3_SUPPORT_SERDES_LOOPBACK; |
31 |
|
32 |
if (if_running) |
33 |
- dev_close(ndev); |
34 |
+ ndev->netdev_ops->ndo_stop(ndev); |
35 |
|
36 |
#if IS_ENABLED(CONFIG_VLAN_8021Q) |
37 |
/* Disable the vlan filter for selftest does not support it */ |
38 |
@@ -347,7 +347,7 @@ static void hns3_self_test(struct net_device *ndev, |
39 |
#endif |
40 |
|
41 |
if (if_running) |
42 |
- dev_open(ndev); |
43 |
+ ndev->netdev_ops->ndo_open(ndev); |
44 |
} |
45 |
|
46 |
static int hns3_get_sset_count(struct net_device *netdev, int stringset) |
47 |
-- |
48 |
2.19.1 |
49 |
|