]> www.infradead.org Git - users/jedix/linux-maple.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)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 4 May 2021 08:19:59 +0000 (04:19 -0400)
commit4c7d22c55bddb1aa2cc0c37efb6abbaae4eb0b4b
tree7418807b06674aff545f9d7b8138a3ccc32b6e34
parentd7bce85aa7b92b5de8f69b3bcedfe51d7b1aabe1
virtio_net: move tx vq operation under tx queue lock

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>
drivers/net/virtio_net.c