]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hv_netvsc: fix race that may miss tx queue wakeup
authorHaiyang Zhang <haiyangz@microsoft.com>
Tue, 30 Apr 2019 19:29:07 +0000 (19:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:44:53 +0000 (06:44 -0700)
commit787e73c289891e60ba4005a323e6dc9b74055434
treef13625bb26a4dabfd4982be15e66e112633b1d5d
parent80f2adc0ff0c72a9c2a7e32b2dcd40f7f7059a3c
hv_netvsc: fix race that may miss tx queue wakeup

[ Upstream commit 93aa4792c3908eac87ddd368ee0fe0564148232b ]

When the ring buffer is almost full due to RX completion messages, a
TX packet may reach the "low watermark" and cause the queue stopped.
If the TX completion arrives earlier than queue stopping, the wakeup
may be missed.

This patch moves the check for the last pending packet to cover both
EAGAIN and success cases, so the queue will be reliably waked up when
necessary.

Reported-and-tested-by: Stephan Klein <stephan.klein@wegfinder.at>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/hyperv/netvsc.c