]> git.itanic.dy.fi Git - linux-stable/commit
net: hns3: fix for TX queue not restarted problem
authorYunsheng Lin <linyunsheng@huawei.com>
Thu, 5 Dec 2019 02:12:27 +0000 (10:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Dec 2019 22:42:43 +0000 (14:42 -0800)
commit2a597eff2437d21841a1e87ffa536ab69dbffdcf
tree77f525bc175fc602837123c0c416de117eb16d36
parentaacf6578ef7704d8df252bbc146b1a35ca131248
net: hns3: fix for TX queue not restarted problem

There is timing window between ring_space checking and
netif_stop_subqueue when transmiting a SKB, and the TX BD
cleaning may be executed during the time window, which may
caused TX queue not restarted problem.

This patch fixes it by rechecking the ring_space after
netif_stop_subqueue to make sure TX queue is restarted.

Also, the ring->next_to_clean is updated even when pkts is
zero, because all the TX BD cleaned may be non-SKB, so it
needs to check if TX queue need to be restarted.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c