net: hns3: use netif_tx_disable to stop the transmit queue
authorPeng Li <lipeng321@huawei.com>
Fri, 30 Apr 2021 09:06:20 +0000 (17:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:13:05 +0000 (10:13 +0200)
commit5aa957e2b5fce76c1e8c845cf5ea1022fe1fd178
tree83d1d8bfd3554166c321a3b87f653451bd182d86
parent90120c475dd7267541db416ce9490257f0bb15f7
net: hns3: use netif_tx_disable to stop the transmit queue

[ Upstream commit b416e872be06fdace3c36cf5210130509d0f0e72 ]

Currently, netif_tx_stop_all_queues() is used to ensure that
the xmit is not running, but for the concurrent case it will
not take effect, since netif_tx_stop_all_queues() just sets
a flag without locking to indicate that the xmit queue(s)
should not be run.

So use netif_tx_disable() to replace netif_tx_stop_all_queues(),
it takes the xmit queue lock while marking the queue stopped.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c