]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit878d937e3474f70d3383d9079fbfe795da8e6a87
tree187f8bdd2826b8391610d7d0e83681c3de3d1bc8
parentfbe4285da2359234c030b5c0377ca8bc0663e341
hv_netvsc: fix race that may miss tx queue wakeup

BugLink: https://bugs.launchpad.net/bugs/1838700
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/hyperv/netvsc.c