From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Yuri Benditovich <yuri.benditovich@daynix.com>
Cc: Yan Vugenfirer <yan@daynix.com>, Jason Wang <jasowang@redhat.com>,
quintela@redhat.com, qemu-devel@nongnu.org,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v5 7/7] virtio-net: add migration support for RSS and hash report
Date: Thu, 19 Mar 2020 18:09:10 +0000 [thread overview]
Message-ID: <20200319180910.GD2833@work-vm> (raw)
In-Reply-To: <CAOEp5Odhjr6h7erYz_VchjRF98-SNt27RW_T_ao7P0nwc-0ebg@mail.gmail.com>
* Yuri Benditovich (yuri.benditovich@daynix.com) wrote:
> On Wed, Mar 18, 2020 at 12:48 PM Dr. David Alan Gilbert <dgilbert@redhat.com>
> wrote:
>
> > * Yuri Benditovich (yuri.benditovich@daynix.com) wrote:
> > > Save and restore RSS/hash report configuration.
> > >
> > > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> > > ---
> > > 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",
> >
> > You need to do something to avoid breaking migration compatibility
> > from/to old QEMU's and from/to QEMU's on hosts without the new virtio
> > features.
> > Probably adding a .needed = here pointing to a function that
> > checks 'enabled' might do it.
> >
> > Does VMSTATE_STRUCT_TEST(..,..,checker_procedure,...) result the same
> thing?
>
> Another question about migration support:
> What is expected/required behavior?
> Possible cases:
> old qemu -> new qemu
> new qemu (new feature off) -> old qemu
Just works.
Also be careful about the definition of 'new feature off'; normally we
tie these things to machine types, so that with the old machine type the
guest doesn't even see the feature; it can't turn it on.
> new qemu (new feature on) -> old qemu
Fails; hopefully nicely.
Dave
>
>
> > Dave
> >
> >
> > > + .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
> > >
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> >
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2020-03-19 18:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 9:15 [PATCH v5 0/7] reference implementation of RSS and hash report Yuri Benditovich
2020-03-18 9:15 ` [PATCH v5 1/7] virtio-net: introduce RSS and hash report features Yuri Benditovich
2020-03-18 9:15 ` [PATCH v5 2/7] virtio-net: implement RSS configuration command Yuri Benditovich
2020-03-18 9:15 ` [PATCH v5 3/7] virtio-net: implement RX RSS processing Yuri Benditovich
2020-03-18 9:15 ` [PATCH v5 4/7] tap: allow extended virtio header with hash info Yuri Benditovich
2020-03-18 9:15 ` [PATCH v5 5/7] virtio-net: reference implementation of hash report Yuri Benditovich
2020-03-18 9:15 ` [PATCH v5 6/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro Yuri Benditovich
2020-03-18 9:42 ` Michael S. Tsirkin
2020-03-19 17:12 ` Yuri Benditovich
2020-03-19 17:55 ` Michael S. Tsirkin
2020-03-18 11:00 ` Dr. David Alan Gilbert
2020-03-18 13:02 ` Juan Quintela
2020-03-18 15:19 ` Michael S. Tsirkin
2020-03-18 9:15 ` [PATCH v5 7/7] virtio-net: add migration support for RSS and hash report Yuri Benditovich
2020-03-18 10:48 ` Dr. David Alan Gilbert
2020-03-19 17:19 ` Yuri Benditovich
2020-03-19 17:23 ` Michael S. Tsirkin
2020-03-19 17:58 ` Juan Quintela
2020-03-19 18:09 ` Dr. David Alan Gilbert [this message]
2020-03-18 9:43 ` [PATCH v5 0/7] reference implementation of " Michael S. Tsirkin
2020-03-18 9:53 ` no-reply
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=20200319180910.GD2833@work-vm \
--to=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=yan@daynix.com \
--cc=yuri.benditovich@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.