Skip to content

Commit

Permalink
net: hns3: Fix ping exited problem when doing lp selftest
Browse files Browse the repository at this point in the history
When ping is runnig and user executes the loopback selftest, the
ping cmd will stop and exit.

This patch fixes it by using the hns3_nic_net_open/stop to offline
the netdev when doing loopback selftest.

Fixes: c39c4d9 ("net: hns3: Add mac loopback selftest support in hns3 driver")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yunsheng Lin authored and David S. Miller committed Sep 4, 2018
1 parent 0f29fc2 commit 3f8601f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static void hns3_self_test(struct net_device *ndev,
h->flags & HNAE3_SUPPORT_SERDES_LOOPBACK;

if (if_running)
dev_close(ndev);
ndev->netdev_ops->ndo_stop(ndev);

#if IS_ENABLED(CONFIG_VLAN_8021Q)
/* Disable the vlan filter for selftest does not support it */
Expand Down Expand Up @@ -332,7 +332,7 @@ static void hns3_self_test(struct net_device *ndev,
#endif

if (if_running)
dev_open(ndev);
ndev->netdev_ops->ndo_open(ndev);
}

static int hns3_get_sset_count(struct net_device *netdev, int stringset)
Expand Down

0 comments on commit 3f8601f

Please sign in to comment.