mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
virtio-net: Introduce a new bottom half packet TX
Based on a patch from Mark McLoughlin, this patch introduces a new bottom half packet transmitter that avoids the latency imposed by the tx_timer approach. Rather than scheduling a timer when a TX packet comes in, schedule a bottom half to be run from the iothread. The bottom half handler first attempts to flush the queue with notification disabled (this is where we could race with a guest without txburst). If we flush a full burst, reschedule immediately. If we send short of a full burst, try to re-enable notification. To avoid a race with TXs that may have occurred, we must then flush again. If we find some packets to send, the guest it probably active, so we can reschedule again. tx_timer and tx_bh are mutually exclusive, so we can re-use the tx_waiting flag to indicate one or the other needs to be setup. This allows us to seamlessly migrate between timer and bh TX handling. The bottom half handler becomes the new default and we add a new tx= option to virtio-net-pci. Usage: -device virtio-net-pci,tx=timer # select timer mitigation vs "bh" Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
4b4b8d361c
commit
a697a334b3
5 changed files with 81 additions and 8 deletions
|
@ -60,6 +60,7 @@ typedef struct virtio_net_conf
|
|||
{
|
||||
uint32_t txtimer;
|
||||
int32_t txburst;
|
||||
char *tx;
|
||||
} virtio_net_conf;
|
||||
|
||||
/* Maximum packet size we can receive from tap device: header + 64k */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue