summary refs log tree commit diff stats
path: root/include/hw/virtio/virtio-net.h
diff options
context:
space:
mode:
authorJason Baron <jbaron@akamai.com>2018-03-07 22:25:41 -0500
committerMichael S. Tsirkin <mst@redhat.com>2018-03-13 23:09:49 +0200
commit9473939ed7addcaaeb8fde5c093918fb7fa0919c (patch)
treec11ed76a0835dc9ea9cd90e9ad12a0dcc75dbdac /include/hw/virtio/virtio-net.h
parent127833eeea798b0863806341893cf575d2d29cf2 (diff)
downloadfocaccia-qemu-9473939ed7addcaaeb8fde5c093918fb7fa0919c.tar.gz
focaccia-qemu-9473939ed7addcaaeb8fde5c093918fb7fa0919c.zip
virtio-net: add linkspeed and duplex settings to virtio-net
Although linkspeed and duplex can be set in a linux guest via 'ethtool -s',
this requires custom ethtool commands for virtio-net by default.

Introduce a new feature flag, VIRTIO_NET_F_SPEED_DUPLEX, which allows
the hypervisor to export a linkspeed and duplex setting. The user can
subsequently overwrite it later if desired via: 'ethtool -s'.

Linkspeed and duplex settings can be set as:
'-device virtio-net,speed=10000,duplex=full'

where speed is [0...INT_MAX], and duplex is ["half"|"full"].

Signed-off-by: Jason Baron <jbaron@akamai.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: virtio-dev@lists.oasis-open.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio/virtio-net.h')
-rw-r--r--include/hw/virtio/virtio-net.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index e7634c9044..02484dc94c 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -38,6 +38,9 @@ typedef struct virtio_net_conf
     uint16_t rx_queue_size;
     uint16_t tx_queue_size;
     uint16_t mtu;
+    int32_t speed;
+    char *duplex_str;
+    uint8_t duplex;
 } virtio_net_conf;
 
 /* Maximum packet size we can receive from tap device: header + 64k */