From: Yuri Benditovich <yuri.benditovich@daynix.com>
To: qemu-devel@nongnu.org, mst@redhat.com, jasowang@redhat.com,
quintela@redhat.com, dgilbert@redhat.com
Cc: yan@daynix.com
Subject: [PATCH 6/7] virtio-net: add migration support for RSS and hash report
Date: Fri, 8 May 2020 15:54:51 +0300 [thread overview]
Message-ID: <20200508125452.7802-7-yuri.benditovich@daynix.com> (raw)
In-Reply-To: <20200508125452.7802-1-yuri.benditovich@daynix.com>
Save and restore RSS/hash report configuration.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.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 5facd333ce..c263b1511d 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.17.1
next prev parent reply other threads:[~2020-05-08 13:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 12:54 [PATCH 0/7] reference implementation of RSS and hash report Yuri Benditovich
2020-05-08 12:54 ` [PATCH 1/7] virtio-net: implement RSS configuration command Yuri Benditovich
2020-05-08 12:54 ` [PATCH 2/7] virtio-net: implement RX RSS processing Yuri Benditovich
2020-05-08 12:54 ` [PATCH 3/7] tap: allow extended virtio header with hash info Yuri Benditovich
2020-05-08 12:54 ` [PATCH 4/7] virtio-net: reference implementation of hash report Yuri Benditovich
2020-05-08 12:54 ` [PATCH 5/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro Yuri Benditovich
2020-05-08 12:54 ` Yuri Benditovich [this message]
2020-05-08 12:54 ` [PATCH 7/7] virtio-net: align RSC fields with updated virtio-net header Yuri Benditovich
2020-05-08 12:56 ` [PATCH 0/7] reference implementation of RSS and hash report Yuri Benditovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200508125452.7802-7-yuri.benditovich@daynix.com \
--to=yuri.benditovich@daynix.com \
--cc=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=yan@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).