All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yuri Benditovich <yuri.benditovich@daynix.com>
Cc: Yan Vugenfirer <yan@daynix.com>, Jason Wang <jasowang@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v3 5/6] virtio-net: add migration support for RSS and hast report
Date: Wed, 11 Mar 2020 16:20:53 -0400	[thread overview]
Message-ID: <20200311161924-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAOEp5OdjP4XsSkyCU0n1YGvyWwayOH5D6iTP-8RRLYfwSJd=7Q@mail.gmail.com>

On Wed, Mar 11, 2020 at 04:00:44PM +0200, Yuri Benditovich wrote:
> 
> 
> On Wed, Mar 11, 2020 at 3:48 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> 
>     On Wed, Mar 11, 2020 at 02:35:17PM +0200, Yuri Benditovich wrote:
>     > Save and restore RSS/hash report configuration.
>     >
>     > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
>     > ---
>     >  hw/net/virtio-net.c | 9 +++++++++
>     >  1 file changed, 9 insertions(+)
>     >
>     > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
>     > index 7b6a929e8c..c8d97d45cd 100644
>     > --- a/hw/net/virtio-net.c
>     > +++ b/hw/net/virtio-net.c
>     > @@ -2869,6 +2869,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;
>     >  }
>     > 
>     > @@ -3094,6 +3101,8 @@ static const VMStateDescription
>     vmstate_virtio_net_device = {
>     >                           vmstate_virtio_net_tx_waiting),
>     >          VMSTATE_UINT64_TEST(curr_guest_offloads, VirtIONet,
>     >                              has_ctrl_guest_offloads),
>     > +        VMSTATE_UINT8_ARRAY(rss_data_migration, VirtIONet,
>     > +                            sizeof(VirtioNetRssData)),
>     >          VMSTATE_END_OF_LIST()
>     >     },
> 
> 
>     I think we should migrate the length too. Avoid arbitrary limits.
> 
> 
> The length of what?

Of the tables.
> The structure is fixed-length and the intention is just to
> keep/restore it.
> The length of indirection table and the table itself are part of the structure.


And that's a problem, because
1. we are wasting memory for a rarely used feature
2. if we want to make the table bigger, we'll need to break
   migration compatibility

Just allocate these dynamically as needed, and migrate length.


> 
>     Yes this means we should allocate the indirection arrays on the fly.
>     But that's probably a good idea anyway.
> 
>     >  };
>     > --
>     > 2.17.1
> 
> 



  reply	other threads:[~2020-03-11 20:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 12:35 [PATCH v3 0/6] reference implementation of RSS and hash report Yuri Benditovich
2020-03-11 12:35 ` [PATCH v3 1/6] virtio-net: introduce RSS and hash report features Yuri Benditovich
2020-03-11 13:46   ` Michael S. Tsirkin
2020-03-11 13:57     ` Yuri Benditovich
2020-03-11 20:19       ` Michael S. Tsirkin
2020-03-12  7:02         ` Yuri Benditovich
2020-03-12  7:21           ` Michael S. Tsirkin
2020-03-12  7:42             ` Yuri Benditovich
2020-03-12  8:23               ` Michael S. Tsirkin
2020-03-12  9:08                 ` Yuri Benditovich
2020-03-12 12:39                   ` Michael S. Tsirkin
2020-03-11 12:35 ` [PATCH v3 2/6] virtio-net: implement RSS configuration command Yuri Benditovich
2020-03-11 12:35 ` [PATCH v3 3/6] virtio-net: implement RX RSS processing Yuri Benditovich
2020-03-11 12:35 ` [PATCH v3 4/6] virtio-net: reference implementation of hash report Yuri Benditovich
2020-03-11 12:35 ` [PATCH v3 5/6] virtio-net: add migration support for RSS and hast report Yuri Benditovich
2020-03-11 13:47   ` Michael S. Tsirkin
2020-03-11 14:00     ` Yuri Benditovich
2020-03-11 20:20       ` Michael S. Tsirkin [this message]
2020-03-12  7:37         ` Yuri Benditovich
2020-03-12  8:22           ` Michael S. Tsirkin
2020-03-11 12:35 ` [PATCH v3 6/6] tap: allow extended virtio header with hash info Yuri Benditovich
2020-03-11 13:10 ` [PATCH v3 0/6] reference implementation of RSS and hash report 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=20200311161924-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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.