qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Yuri Benditovich <yuri.benditovich@daynix.com>,
	qemu-devel@nongnu.org, mst@redhat.com
Cc: yan@daynix.com
Subject: Re: [PATCH v2 4/4] virtio-net: block migration if RSS feature negotiated
Date: Tue, 10 Mar 2020 11:12:05 +0800	[thread overview]
Message-ID: <32451b9c-f10d-d683-24b4-29497e73ca65@redhat.com> (raw)
In-Reply-To: <20200309083438.2389-5-yuri.benditovich@daynix.com>


On 2020/3/9 下午4:34, Yuri Benditovich wrote:
> Block migration for reference implementation of
> RSS feature in QEMU. When we add support for RSS
> on backend side, we'll implement migration of
> current RSS settings.
>
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> ---
>   hw/net/virtio-net.c            | 18 ++++++++++++++++++
>   include/hw/virtio/virtio-net.h |  1 +
>   2 files changed, 19 insertions(+)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index abc41fdb16..943d1931a2 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -37,6 +37,7 @@
>   #include "qapi/qapi-events-migration.h"
>   #include "hw/virtio/virtio-access.h"
>   #include "migration/misc.h"
> +#include "migration/blocker.h"
>   #include "standard-headers/linux/ethtool.h"
>   #include "sysemu/sysemu.h"
>   #include "trace.h"
> @@ -627,6 +628,12 @@ static void virtio_net_reset(VirtIODevice *vdev)
>       n->announce_timer.round = 0;
>       n->status &= ~VIRTIO_NET_S_ANNOUNCE;
>   
> +    if (n->migration_blocker) {
> +        migrate_del_blocker(n->migration_blocker);
> +        error_free(n->migration_blocker);
> +        n->migration_blocker = NULL;
> +    }
> +
>       /* Flush any MAC and VLAN filter table state */
>       n->mac_table.in_use = 0;
>       n->mac_table.first_multi = 0;
> @@ -1003,6 +1010,17 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)
>           vhost_net_ack_features(get_vhost_net(nc->peer), features);
>       }
>   
> +    if (virtio_has_feature(features, VIRTIO_NET_F_RSS)) {
> +        if (!n->migration_blocker) {
> +            error_setg(&n->migration_blocker, "virtio-net: RSS negotiated");
> +            migrate_add_blocker(n->migration_blocker, &err);
> +            if (err) {
> +                error_report_err(err);
> +                err = NULL;
> +            }
> +        }
> +    }


It looks to me we should add the blocker unconditionally based on 
virtio_host_has_feature() instead of depending the negotiated feature here.

Thanks


> +
>       if (virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {
>           memset(n->vlans, 0, MAX_VLAN >> 3);
>       } else {
> diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
> index 45670dd054..fba768ba9b 100644
> --- a/include/hw/virtio/virtio-net.h
> +++ b/include/hw/virtio/virtio-net.h
> @@ -180,6 +180,7 @@ struct VirtIONet {
>       virtio_net_conf net_conf;
>       NICConf nic_conf;
>       DeviceState *qdev;
> +    Error *migration_blocker;
>       int multiqueue;
>       uint16_t max_queues;
>       uint16_t curr_queues;



  reply	other threads:[~2020-03-10  3:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09  8:34 [PATCH v2 0/4] reference implementation of RSS Yuri Benditovich
2020-03-09  8:34 ` [PATCH v2 1/4] virtio-net: introduce RSS and hash report features Yuri Benditovich
2020-03-09  8:34 ` [PATCH v2 2/4] virtio-net: implement RSS configuration command Yuri Benditovich
2020-03-10  3:02   ` Jason Wang
2020-03-10 10:29     ` Yuri Benditovich
2020-03-09  8:34 ` [PATCH v2 3/4] virtio-net: implement RX RSS processing Yuri Benditovich
2020-03-10  3:10   ` Jason Wang
2020-03-10 10:18     ` Yuri Benditovich
2020-03-10  6:13   ` Michael S. Tsirkin
2020-03-09  8:34 ` [PATCH v2 4/4] virtio-net: block migration if RSS feature negotiated Yuri Benditovich
2020-03-10  3:12   ` Jason Wang [this message]
2020-03-10  6:17     ` Michael S. Tsirkin
2020-03-10 10:26       ` Yuri Benditovich
2020-03-09  8:59 ` [PATCH v2 0/4] reference implementation of RSS 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=32451b9c-f10d-d683-24b4-29497e73ca65@redhat.com \
    --to=jasowang@redhat.com \
    --cc=mst@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 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).