[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/33] virtio-net: add migration support for RSS and hash report
From: |
Jason Wang |
Subject: |
[PULL 06/33] virtio-net: add migration support for RSS and hash report |
Date: |
Tue, 16 Jun 2020 14:45:17 +0800 |
From: Yuri Benditovich <yuri.benditovich@daynix.com>
Save and restore RSS/hash report configuration.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/virtio-net.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6ff3cc3..2a5da29 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -2777,6 +2777,13 @@ static int virtio_net_post_load_device(void *opaque, int
version_id)
}
}
+ if (n->rss_data.enabled) {
+ trace_virtio_net_rss_enable(n->rss_data.hash_types,
+ n->rss_data.indirections_len,
+ sizeof(n->rss_data.key));
+ } else {
+ trace_virtio_net_rss_disable();
+ }
return 0;
}
@@ -2954,6 +2961,32 @@ static const VMStateDescription
vmstate_virtio_net_has_vnet = {
},
};
+static bool virtio_net_rss_needed(void *opaque)
+{
+ return VIRTIO_NET(opaque)->rss_data.enabled;
+}
+
+static const VMStateDescription vmstate_virtio_net_rss = {
+ .name = "virtio-net-device/rss",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = virtio_net_rss_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_BOOL(rss_data.enabled, VirtIONet),
+ VMSTATE_BOOL(rss_data.redirect, VirtIONet),
+ VMSTATE_BOOL(rss_data.populate_hash, VirtIONet),
+ VMSTATE_UINT32(rss_data.hash_types, VirtIONet),
+ VMSTATE_UINT16(rss_data.indirections_len, VirtIONet),
+ VMSTATE_UINT16(rss_data.default_queue, VirtIONet),
+ VMSTATE_UINT8_ARRAY(rss_data.key, VirtIONet,
+ VIRTIO_NET_RSS_MAX_KEY_SIZE),
+ VMSTATE_VARRAY_UINT16_ALLOC(rss_data.indirections_table, VirtIONet,
+ rss_data.indirections_len, 0,
+ vmstate_info_uint16, uint16_t),
+ VMSTATE_END_OF_LIST()
+ },
+};
+
static const VMStateDescription vmstate_virtio_net_device = {
.name = "virtio-net-device",
.version_id = VIRTIO_NET_VM_VERSION,
@@ -3004,6 +3037,10 @@ static const VMStateDescription
vmstate_virtio_net_device = {
has_ctrl_guest_offloads),
VMSTATE_END_OF_LIST()
},
+ .subsections = (const VMStateDescription * []) {
+ &vmstate_virtio_net_rss,
+ NULL
+ }
};
static NetClientInfo net_virtio_info = {
--
2.5.0
- [PULL 00/33] Net patches, Jason Wang, 2020/06/16
- [PULL 01/33] virtio-net: implement RSS configuration command, Jason Wang, 2020/06/16
- [PULL 04/33] virtio-net: reference implementation of hash report, Jason Wang, 2020/06/16
- [PULL 05/33] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro, Jason Wang, 2020/06/16
- [PULL 03/33] tap: allow extended virtio header with hash info, Jason Wang, 2020/06/16
- [PULL 02/33] virtio-net: implement RX RSS processing, Jason Wang, 2020/06/16
- [PULL 06/33] virtio-net: add migration support for RSS and hash report,
Jason Wang <=
- [PULL 07/33] virtio-net: align RSC fields with updated virtio-net header, Jason Wang, 2020/06/16
- [PULL 09/33] hw/net/tulip: Fix 'Descriptor Error' definition, Jason Wang, 2020/06/16
- [PULL 10/33] hw/net/tulip: Log descriptor overflows, Jason Wang, 2020/06/16
- [PULL 08/33] Fix tulip breakage, Jason Wang, 2020/06/16
- [PULL 11/33] net: cadence_gem: Fix debug statements, Jason Wang, 2020/06/16
- [PULL 16/33] net: cadence_gem: Move tx/rx packet buffert to CadenceGEMState, Jason Wang, 2020/06/16
- [PULL 14/33] net: cadence_gem: Define access permission for interrupt registers, Jason Wang, 2020/06/16
- [PULL 12/33] net: cadence_gem: Fix the queue address update during wrap around, Jason Wang, 2020/06/16
- [PULL 13/33] net: cadence_gem: Fix irq update w.r.t queue, Jason Wang, 2020/06/16
- [PULL 15/33] net: cadence_gem: Set ISR according to queue in use, Jason Wang, 2020/06/16