diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2010-09-02 09:00:50 -0600 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-09-07 20:29:24 +0300 |
commit | f0c07c7c7b4fe4f9b63c88341fd32707def5a058 (patch) | |
tree | 189a2c3e3a0a4877cf5e18c9e5968443eb3482c9 /hw/syborg_virtio.c | |
parent | ca736c8e748e3bf77abe401231a412b9cdccb9d3 (diff) |
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>
Diffstat (limited to 'hw/syborg_virtio.c')
-rw-r--r-- | hw/syborg_virtio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/syborg_virtio.c b/hw/syborg_virtio.c index abf0370107..5665189aad 100644 --- a/hw/syborg_virtio.c +++ b/hw/syborg_virtio.c @@ -68,6 +68,7 @@ typedef struct { uint32_t id; NICConf nic; uint32_t host_features; + virtio_net_conf net; } SyborgVirtIOProxy; static uint32_t syborg_virtio_readl(void *opaque, target_phys_addr_t offset) @@ -284,7 +285,7 @@ static int syborg_virtio_net_init(SysBusDevice *dev) VirtIODevice *vdev; SyborgVirtIOProxy *proxy = FROM_SYSBUS(SyborgVirtIOProxy, dev); - vdev = virtio_net_init(&dev->qdev, &proxy->nic); + vdev = virtio_net_init(&dev->qdev, &proxy->nic, &proxy->net); return syborg_virtio_init(proxy, vdev); } @@ -295,6 +296,8 @@ static SysBusDeviceInfo syborg_virtio_net_info = { .qdev.props = (Property[]) { DEFINE_NIC_PROPERTIES(SyborgVirtIOProxy, nic), DEFINE_VIRTIO_NET_FEATURES(SyborgVirtIOProxy, host_features), + DEFINE_PROP_UINT32("x-txtimer", SyborgVirtIOProxy, + net.txtimer, TX_TIMER_INTERVAL), DEFINE_PROP_END_OF_LIST(), } }; |