]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
virtio_net: move tx vq operation under tx queue lock
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 13 Apr 2021 05:35:26 +0000 (01:35 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 20 Sep 2021 13:40:19 +0000 (15:40 +0200)
commit1503b35fb9690f6c0cd231a48b30dff162b05e63
tree30918f62b1a8ceea16a8290fbdad99090a5a7cb8
parentb563c7dd4a36b1434aa63d279de9effda264a066
virtio_net: move tx vq operation under tx queue lock

BugLink: https://bugs.launchpad.net/bugs/1939738
[ Upstream commit 5a2f966d0f3fa0ef6dada7ab9eda74cacee96b8a ]

It's unsafe to operate a vq from multiple threads.
Unfortunately this is exactly what we do when invoking
clean tx poll from rx napi.
Same happens with napi-tx even without the
opportunistic cleaning from the receive interrupt: that races
with processing the vq in start_xmit.

As a fix move everything that deals with the vq to under tx lock.

Fixes: b92f1e6751a6 ("virtio-net: transmit napi")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/virtio_net.c