
From: Chiqijun <chiqijun@huawei.com> driver inclusion category: bugfix bugzilla: 4472 ----------------------------------------------------------------------- During the loopback test, it cannot be guaranteed that the protocol stack will completely stop sending packets, which causes the loopback test packets and protocol stack packets to be sent at the same time, causing the loopback test to fail. This patch corrects it. Signed-off-by: Chiqijun <chiqijun@huawei.com> Reviewed-by: Wangxiaoyun <cloud.wangxiaoyun@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/net/ethernet/huawei/hinic/hinic_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c index aca9bd9a6624..ff6a3d7fe9ad 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c @@ -1928,6 +1928,7 @@ void hinic_lp_test(struct net_device *netdev, struct ethtool_test *eth_test, test_time = LP_DEFAULT_TIME; netif_carrier_off(netdev); + netif_tx_disable(netdev); if (!(test.flags & ETH_TEST_FL_EXTERNAL_LB)) { test_index = INTERNAL_LP_TEST; @@ -1977,6 +1978,7 @@ void hinic_lp_test(struct net_device *netdev, struct ethtool_test *eth_test, data[test_index] = 1; } + netif_tx_wake_all_queues(netdev); err = hinic_get_link_state(nic_dev->hwdev, &link_status); if (!err && link_status) netif_carrier_on(netdev); -- 2.25.1