[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 7/7] virtio-net: add migration support for RSS and hash report
From: |
Yuri Benditovich |
Subject: |
[PATCH v5 7/7] virtio-net: add migration support for RSS and hash report |
Date: |
Wed, 18 Mar 2020 11:15:25 +0200 |
Save and restore RSS/hash report configuration.
Signed-off-by: Yuri Benditovich <address@hidden>
---
hw/net/virtio-net.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index a0614ad4e6..0b058aae9f 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -2842,6 +2842,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;
}
@@ -3019,6 +3026,24 @@ static const VMStateDescription
vmstate_virtio_net_has_vnet = {
},
};
+static const VMStateDescription vmstate_rss = {
+ .name = "vmstate_rss",
+ .fields = (VMStateField[]) {
+ VMSTATE_BOOL(enabled, VirtioNetRssData),
+ VMSTATE_BOOL(redirect, VirtioNetRssData),
+ VMSTATE_BOOL(populate_hash, VirtioNetRssData),
+ VMSTATE_UINT32(hash_types, VirtioNetRssData),
+ VMSTATE_UINT16(indirections_len, VirtioNetRssData),
+ VMSTATE_UINT16(default_queue, VirtioNetRssData),
+ VMSTATE_UINT8_ARRAY(key, VirtioNetRssData,
+ VIRTIO_NET_RSS_MAX_KEY_SIZE),
+ VMSTATE_VARRAY_UINT16_ALLOC(indirections_table, VirtioNetRssData,
+ 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,
@@ -3067,6 +3092,7 @@ static const VMStateDescription vmstate_virtio_net_device
= {
vmstate_virtio_net_tx_waiting),
VMSTATE_UINT64_TEST(curr_guest_offloads, VirtIONet,
has_ctrl_guest_offloads),
+ VMSTATE_STRUCT(rss_data, VirtIONet, 1, vmstate_rss, VirtioNetRssData),
VMSTATE_END_OF_LIST()
},
};
--
2.17.1
- [PATCH v5 4/7] tap: allow extended virtio header with hash info, (continued)
- [PATCH v5 4/7] tap: allow extended virtio header with hash info, Yuri Benditovich, 2020/03/18
- [PATCH v5 3/7] virtio-net: implement RX RSS processing, Yuri Benditovich, 2020/03/18
- [PATCH v5 6/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro, Yuri Benditovich, 2020/03/18
- Re: [PATCH v5 6/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro, Dr. David Alan Gilbert, 2020/03/18
- Re: [PATCH v5 6/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro, Juan Quintela, 2020/03/18
- [PATCH v5 5/7] virtio-net: reference implementation of hash report, Yuri Benditovich, 2020/03/18
- [PATCH v5 7/7] virtio-net: add migration support for RSS and hash report,
Yuri Benditovich <=
Re: [PATCH v5 0/7] reference implementation of RSS and hash report, Michael S. Tsirkin, 2020/03/18
Re: [PATCH v5 0/7] reference implementation of RSS and hash report, no-reply, 2020/03/18