diff options
author | Laurent Vivier <lvivier@redhat.com> | 2022-10-20 11:58:45 +0200 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2022-10-28 13:28:52 +0800 |
commit | df8d07081718c29d04d106583d9c300128686cda (patch) | |
tree | da62b2f1d1af95335c773d1ce06243a3192c15bf /scripts/symlink-install-tree.py | |
parent | 344744e148e6e865f5a57e745b02a87e5ea534ad (diff) | |
download | qemu-df8d07081718c29d04d106583d9c300128686cda.zip qemu-df8d07081718c29d04d106583d9c300128686cda.tar.gz qemu-df8d07081718c29d04d106583d9c300128686cda.tar.bz2 |
virtio-net: fix bottom-half packet TX on asynchronous completion
When virtio-net is used with the socket netdev backend, the backend
can be busy and not able to collect new packets.
In this case, net_socket_receive() returns 0 and registers a poll function
to detect when the socket is ready again.
In virtio_net_tx_bh(), virtio_net_flush_tx() forwards the 0, the virtio
notifications are disabled and the function is not re-scheduled, waiting
for the backend to be ready.
When the socket netdev backend is again able to send packets, the poll
function re-starts to flush remaining packets. This is done by
calling virtio_net_tx_complete(). It re-enables notifications and calls
again virtio_net_flush_tx().
But it seems if virtio_net_flush_tx() reaches the tx_burst value all
the queue is not flushed and no new notification is sent to re-schedule
virtio_net_tx_bh(). Nothing re-start to flush the queue and remaining
packets are stuck in the queue.
To fix that, detect in virtio_net_tx_complete() if virtio_net_flush_tx()
has been stopped by tx_burst and if yes re-schedule the bottom half
function virtio_net_tx_bh() to flush the remaining packets.
This is what is done in virtio_net_tx_bh() when the virtio_net_flush_tx()
is synchronous, and completly by-passed when the operation needs to be
asynchronous.
Fixes: a697a334b3c4 ("virtio-net: Introduce a new bottom half packet TX")
Cc: alex.williamson@redhat.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'scripts/symlink-install-tree.py')
0 files changed, 0 insertions, 0 deletions