virtio-net: Make tx_timer timeout configurable

Add an option to make the TX mitigation timer adjustable as a device
option.  The 150us hard coded default used currently is reasonable,
but may not be suitable for all workloads, this gives us a way to
adjust it using a single binary.  We can't support any random option
though, so use the "x-" prefix to indicate this is a developer
option.  Usage:

-device virtio-net-pci,x-txtimer=500000,... # .5ms timeout

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Alex Williamson 2010-09-02 09:00:50 -06:00 committed by Michael S. Tsirkin
parent ca736c8e74
commit f0c07c7c7b
7 changed files with 27 additions and 7 deletions

View file

@ -49,6 +49,11 @@
#define TX_TIMER_INTERVAL 150000 /* 150 us */
typedef struct virtio_net_conf
{
uint32_t txtimer;
} virtio_net_conf;
/* Maximum packet size we can receive from tap device: header + 64k */
#define VIRTIO_NET_MAX_BUFSIZE (sizeof(struct virtio_net_hdr) + (64 << 10))