diff options
author | Dmitry Fleytman <dfleytma@redhat.com> | 2013-05-20 11:18:14 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-05-22 07:40:10 -0500 |
commit | 644c98587d4ccc09e7592e1688e4e7fa363c5a75 (patch) | |
tree | 48e373419e0ab0570d48778567194a827354cf49 /include/hw/virtio/virtio-net.h | |
parent | 2b220025993e76d4116781ca91a4fabc5ad9c722 (diff) | |
download | qemu-644c98587d4ccc09e7592e1688e4e7fa363c5a75.zip qemu-644c98587d4ccc09e7592e1688e4e7fa363c5a75.tar.gz qemu-644c98587d4ccc09e7592e1688e4e7fa363c5a75.tar.bz2 |
virtio-net: dynamic network offloads configuration
Virtio-net driver currently negotiates network offloads
on startup via features mechanism and have no ability to
disable and re-enable offloads later.
This patch introduced a new control command that allows
to configure device network offloads state dynamically.
The patch also introduces a new feature flag
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20130520081814.GA8162@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/hw/virtio/virtio-net.h')
-rw-r--r-- | include/hw/virtio/virtio-net.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index beeead7..b315ac9 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -31,6 +31,8 @@ /* The feature bitmap for virtio net */ #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ +#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Control channel offload + * configuration support */ #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ @@ -190,6 +192,7 @@ typedef struct VirtIONet { size_t config_size; char *netclient_name; char *netclient_type; + uint64_t curr_guest_offloads; } VirtIONet; #define VIRTIO_NET_CTRL_MAC 1 @@ -229,6 +232,15 @@ struct virtio_net_ctrl_mq { #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000 +/* + * Control network offloads + * + * Dynamic offloads are available with the + * VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit. + */ +#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 + #define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 + #define DEFINE_VIRTIO_NET_FEATURES(_state, _field) \ DEFINE_VIRTIO_COMMON_FEATURES(_state, _field), \ DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \ @@ -249,6 +261,7 @@ struct virtio_net_ctrl_mq { DEFINE_PROP_BIT("ctrl_vlan", _state, _field, VIRTIO_NET_F_CTRL_VLAN, true), \ DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field, VIRTIO_NET_F_CTRL_RX_EXTRA, true), \ DEFINE_PROP_BIT("ctrl_mac_addr", _state, _field, VIRTIO_NET_F_CTRL_MAC_ADDR, true), \ + DEFINE_PROP_BIT("ctrl_guest_offloads", _state, _field, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), \ DEFINE_PROP_BIT("mq", _state, _field, VIRTIO_NET_F_MQ, false) #define DEFINE_VIRTIO_NET_PROPERTIES(_state, _field) \ |