qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <mlureau@redhat.com>
To: Thibaut Collet <thibaut.collet@6wind.com>
Cc: Linhaifeng <haifeng.lin@huawei.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	marcandre lureau <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 15/21] vhost user: add rarp sending after live migration for legacy guest
Date: Thu, 24 Sep 2015 17:53:05 -0400 (EDT)	[thread overview]
Message-ID: <627233075.16911211.1443131585532.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CABUUfwP0nPWq0t-aGLMtwUtzFXvFyK6WuDezGnj-=CiFa81a2g@mail.gmail.com>

Hi

----- Original Message -----
> On Thu, Sep 24, 2015 at 6:22 PM,  <marcandre.lureau@redhat.com> wrote:
> > From: Thibaut Collet <thibaut.collet@6wind.com>
> >
> > A new vhost user message is added to allow QEMU to ask to vhost user
> > backend to
> > broadcast a fake RARP after live migration for guest without GUEST_ANNOUNCE
> > capability.
> >
> > This new message is sent only if the backend supports the new
> > VHOST_USER_PROTOCOL_F_RARP protocol feature.
> > The payload of this new message is the MAC address of the guest (not known
> > by
> > the backend). The MAC address is copied in the first 6 bytes of a u64 to
> > avoid
> > to create a new payload message type.
> >
> > This new message has no equivalent ioctl so a new callback is added in the
> > userOps structure to send the request.
> >
> > Upon reception of this new message the vhost user backend must generate and
> > broadcast a fake RARP request to notify the migration is terminated.
> >
> > Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
> > [Rebased and fixed checkpatch errors - Marc-André]
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  docs/specs/vhost-user.txt         | 15 +++++++++++++++
> >  hw/net/vhost_net.c                | 17 +++++++++++++++++
> >  hw/virtio/vhost-user.c            | 30 ++++++++++++++++++++++++++++++
> >  include/hw/virtio/vhost-backend.h |  3 +++
> >  include/net/vhost_net.h           |  1 +
> >  net/vhost-user.c                  | 24 ++++++++++++++++++++++--
> >  6 files changed, 88 insertions(+), 2 deletions(-)
> >
> > diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
> > index e0292a0..e0d71e2 100644
> > --- a/docs/specs/vhost-user.txt
> > +++ b/docs/specs/vhost-user.txt
> > @@ -194,6 +194,7 @@ Protocol features
> >
> >  #define VHOST_USER_PROTOCOL_F_MQ             0
> >  #define VHOST_USER_PROTOCOL_F_LOG_SHMFD      1
> > +#define VHOST_USER_PROTOCOL_F_RARP           2
> >
> >  Message types
> >  -------------
> > @@ -381,3 +382,17 @@ Message types
> >        Master payload: vring state description
> >
> >        Signal slave to enable or disable corresponding vring.
> > +
> > + * VHOST_USER_SEND_RARP
> > +
> > +      Id: 19
> > +      Equivalent ioctl: N/A
> > +      Master payload: u64
> > +
> > +      Ask vhost user backend to broadcast a fake RARP to notify the
> > migration
> > +      is terminated for guest that does not support GUEST_ANNOUNCE.
> > +      Only legal if feature bit VHOST_USER_F_PROTOCOL_FEATURES is present
> > in
> > +      VHOST_USER_GET_FEATURES and protocol feature bit
> > VHOST_USER_PROTOCOL_F_RARP
> > +      is present in VHOST_USER_GET_PROTOCOL_FEATURES.
> > +      The first 6 bytes of the payload contain the mac address of the
> > guest to
> > +      allow the vhost user backend to construct and broadcast the fake
> > RARP.
> > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> > index 840f443..da66b64 100644
> > --- a/hw/net/vhost_net.c
> > +++ b/hw/net/vhost_net.c
> > @@ -388,6 +388,18 @@ void vhost_net_cleanup(struct vhost_net *net)
> >      g_free(net);
> >  }
> >
> > +int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
> > +{
> > +    const VhostOps *vhost_ops = net->dev.vhost_ops;
> > +    int r = -1;
> > +
> > +    if (vhost_ops->vhost_migration_done) {
> > +        r = vhost_ops->vhost_migration_done(&net->dev, mac_addr);
> > +    }
> > +
> > +    return r;
> > +}
> > +
> >  bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
> >  {
> >      return vhost_virtqueue_pending(&net->dev, idx);
> > @@ -479,6 +491,11 @@ void vhost_net_virtqueue_mask(VHostNetState *net,
> > VirtIODevice *dev,
> >  {
> >  }
> >
> > +int vhost_net_notify_migration_done(struct vhost_net *net)
> > +{
> > +    return -1;
> > +}
> > +
> >  VHostNetState *get_vhost_net(NetClientState *nc)
> >  {
> >      return 0;
> > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> > index 455caba..b7f3699 100644
> > --- a/hw/virtio/vhost-user.c
> > +++ b/hw/virtio/vhost-user.c
> > @@ -10,6 +10,7 @@
> >
> >  #include "hw/virtio/vhost.h"
> >  #include "hw/virtio/vhost-backend.h"
> > +#include "hw/virtio/virtio-net.h"
> >  #include "sysemu/char.h"
> >  #include "sysemu/kvm.h"
> >  #include "qemu/error-report.h"
> > @@ -30,6 +31,7 @@
> >  #define VHOST_USER_PROTOCOL_FEATURE_MASK 0x3ULL
> >  #define VHOST_USER_PROTOCOL_F_MQ         0
> >  #define VHOST_USER_PROTOCOL_F_LOG_SHMFD  1
> > +#define VHOST_USER_PROTOCOL_F_RARP       2
> 
> The VHOST_USER_PROTOCOL_FEATURE_MASK  must be changed and set to 0x7ULL
> 

Good catch (too many rebases, having a test would help to prevent this kind of mistake)

thanks

  reply	other threads:[~2015-09-24 21:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 16:22 [Qemu-devel] [PATCH v5 00/21] vhost-user: add migration support marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 01/21] vhost-user: unit test for new messages marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 02/21] configure: probe for memfd marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 03/21] util: add linux-only memfd fallback marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 04/21] util: add memfd helpers marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 05/21] vhost: alloc shareable log marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 06/21] vhost: document log resizing marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 07/21] vhost: add vhost_set_log_base op marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 08/21] vhost-user: send log shm fd along with log_base marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 09/21] vhost-user: add a migration blocker marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 10/21] vhost: use a function for each call marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 11/21] vhost: only use shared log if in use by backend marcandre.lureau
2015-09-29 14:59   ` Michael S. Tsirkin
2015-09-29 15:26     ` Marc-André Lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 12/21] vhost-user: document migration log marcandre.lureau
2015-09-24 16:38   ` Eric Blake
2015-09-24 16:41     ` Marc-André Lureau
2015-09-24 16:47       ` Eric Blake
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 13/21] net: add trace_vhost_user_event marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 14/21] vhost user: add support of live migration marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 15/21] vhost user: add rarp sending after live migration for legacy guest marcandre.lureau
2015-09-24 17:24   ` Thibaut Collet
2015-09-24 21:53     ` Marc-André Lureau [this message]
2015-09-27 13:12       ` Michael S. Tsirkin
2015-09-27 15:13         ` Marc-André Lureau
2015-09-27 15:49           ` Thibaut Collet
2015-09-27 18:04             ` Marc-André Lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 16/21] vhost-user-test: move wait_for_fds() out marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 17/21] vhost-user-test: remove useless static check marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 18/21] vhost-user-test: wrap server in TestServer struct marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 19/21] vhost-user-test: learn to tweak various qemu arguments marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 20/21] vhost-user-test: add live-migration test marcandre.lureau
2015-09-24 16:22 ` [Qemu-devel] [PATCH v5 21/21] vhost-user-test: check ownership during migration marcandre.lureau
2015-09-27 13:19 ` [Qemu-devel] [PATCH v5 00/21] vhost-user: add migration support Michael S. Tsirkin
2015-09-29 15:07 ` Michael S. Tsirkin

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=627233075.16911211.1443131585532.JavaMail.zimbra@redhat.com \
    --to=mlureau@redhat.com \
    --cc=haifeng.lin@huawei.com \
    --cc=jasowang@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thibaut.collet@6wind.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).