]> www.infradead.org Git - users/jedix/linux-maple.git/commit
virtio_net: move txq wakeups under tx q lock
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 13 Apr 2021 05:38:08 +0000 (01:38 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 4 May 2021 08:19:59 +0000 (04:19 -0400)
commit0c077be4da36d1a1110b7f3184de0662aeaafe44
tree2c7ef5f49075a7233f25ef756a463185c0381791
parent4c7d22c55bddb1aa2cc0c37efb6abbaae4eb0b4b
virtio_net: move txq wakeups under tx q lock

We currently check num_free outside tx q lock
which is unsafe: new packets can arrive meanwhile
and there won't be space in the queue.
Thus a spurious queue wakeup causing overhead
and even packet drops.

Move the check under the lock to fix that.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/net/virtio_net.c