From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2mZZ-0008TJ-RG for qemu-devel@nongnu.org; Wed, 10 Jun 2015 16:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2mZS-0002hc-Dt for qemu-devel@nongnu.org; Wed, 10 Jun 2015 16:26:05 -0400 Received: from mail-ig0-f182.google.com ([209.85.213.182]:32957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2mZR-0002hE-Li for qemu-devel@nongnu.org; Wed, 10 Jun 2015 16:25:58 -0400 Received: by igbpi8 with SMTP id pi8so43456552igb.0 for ; Wed, 10 Jun 2015 13:25:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150610180013-mutt-send-email-mst@redhat.com> References: <1433943783-20125-1-git-send-email-thibaut.collet@6wind.com> <1433943783-20125-3-git-send-email-thibaut.collet@6wind.com> <20150610173321-mutt-send-email-mst@redhat.com> <20150610180013-mutt-send-email-mst@redhat.com> Date: Wed, 10 Jun 2015 22:25:57 +0200 Message-ID: From: Thibaut Collet Content-Type: multipart/alternative; boundary=001a113ed184b4dacd05182faefa Subject: Re: [Qemu-devel] [PATCH v3 2/2] vhost user: Add RARP injection for legacy guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Jason Wang , qemu-devel , Stefan Hajnoczi --001a113ed184b4dacd05182faefa Content-Type: text/plain; charset=UTF-8 Yes backend can save everything to be able to send the rarp alone after a live migration. Main purpose of this patch is to answer to the point raise by Jason on the previous version of my patch: > Yes, your patch works well for recent drivers. But the problem is legacy > guest/driver without VIRTIO_NET_F_GUEST_ANNOUNCE. In this case there > will be no GARP sent after migration. If Jason is OK with this solution this patch can be forgotten. Maybe, to warn user of this issue if the backend does not send the rarp, it can be useful to keep the warn message of the previous patch: > + fprintf(stderr, > + "Warning: Guest with no VIRTIO_NET_F_GUEST_ANNOUNCE support. RARP must be sent by vhost-user backend\n"); > + fflush(stderr); with a static bool to display this message only one time to limit the number of message ? On Wed, Jun 10, 2015 at 6:00 PM, Michael S. Tsirkin wrote: > On Wed, Jun 10, 2015 at 05:48:47PM +0200, Thibaut Collet wrote: > > I have involved QEMU because QEMU prepares the rarp. I agree that > backend has > > probably all the information to do that. > > But backend does not know if the guest supports > the VIRTIO_NET_F_GUEST_ANNOUNCE > > Why not? Backend has the acked feature mask. > > > > and will send a useless rarp. > > Maybe this duplication of requests is not very important and in this > case this > > patch is not mandatory. > > > > On Wed, Jun 10, 2015 at 5:34 PM, Michael S. Tsirkin > wrote: > > > > On Wed, Jun 10, 2015 at 03:43:03PM +0200, Thibaut Collet wrote: > > > In case of live migration with legacy guest (without > > VIRTIO_NET_F_GUEST_ANNOUNCE) > > > a message is added between QEMU and the vhost client/backend. > > > This message provides the RARP content, prepared by QEMU, to the > vhost > > > client/backend. > > > The vhost client/backend is responsible to send the RARP. > > > > > > Signed-off-by: Thibaut Collet > > > --- > > > docs/specs/vhost-user.txt | 16 ++++++++++++++++ > > > hw/net/vhost_net.c | 8 ++++++++ > > > hw/virtio/vhost-user.c | 11 ++++++++++- > > > linux-headers/linux/vhost.h | 9 +++++++++ > > > 4 files changed, 43 insertions(+), 1 deletion(-) > > > > > > diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt > > > index 2c8e934..ef5d475 100644 > > > --- a/docs/specs/vhost-user.txt > > > +++ b/docs/specs/vhost-user.txt > > > @@ -97,6 +97,7 @@ typedef struct VhostUserMsg { > > > uint64_t u64; > > > struct vhost_vring_state state; > > > struct vhost_vring_addr addr; > > > + struct vhost_inject_rarp rarp; > > > VhostUserMemory memory; > > > }; > > > } QEMU_PACKED VhostUserMsg; > > > @@ -132,6 +133,12 @@ Multi queue support > > > The protocol supports multiple queues by setting all index fields > in the > > sent > > > messages to a properly calculated value. > > > > > > +Live migration support > > > +---------------------- > > > +The protocol supports live migration. GARP from the migrated > guest is > > done > > > +through the VIRTIO_NET_F_GUEST_ANNOUNCE mechanism for guest that > > supports it or > > > +through RARP. > > > + > > > Message types > > > ------------- > > > > > > @@ -269,3 +276,12 @@ Message types > > > Bits (0-7) of the payload contain the vring index. Bit 8 is > the > > > invalid FD flag. This flag is set when there is no file > descriptor > > > in the ancillary data. > > > + > > > + * VHOST_USER_NET_INJECT_RARP > > > + > > > + Id: 15 > > > + Master payload: rarp content > > > + > > > + Provide the RARP message to send to the guest after a live > > migration. This > > > + message is sent only for guest that does not support > > > + VIRTIO_NET_F_GUEST_ANNOUNCE. > > > > I don't see why this is needed. > > Can't backend simply send rarp itself? > > Why do we need to involve QEMU? > > > > > > > > > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c > > > index 4a42325..f66d48d 100644 > > > --- a/hw/net/vhost_net.c > > > +++ b/hw/net/vhost_net.c > > > @@ -369,10 +369,18 @@ void vhost_net_stop(VirtIODevice *dev, > > NetClientState *ncs, > > > > > > void vhost_net_inject_rarp(struct vhost_net *net, const uint8_t > *buf, > > size_t size) > > > { > > > + struct vhost_inject_rarp inject_rarp; > > > + memcpy(&inject_rarp.rarp, buf, size); > > > + > > > if ((net->dev.acked_features & (1 << > VIRTIO_NET_F_GUEST_ANNOUNCE)) = > > = 0) { > > > + const VhostOps *vhost_ops = net->dev.vhost_ops; > > > + int r; > > > + > > > fprintf(stderr, > > > "Warning: Guest with no > VIRTIO_NET_F_GUEST_ANNOUNCE > > support. RARP must be sent by vhost-user backend\n"); > > > fflush(stderr); > > > + r = vhost_ops->vhost_call(&net->dev, > VHOST_NET_INJECT_RARP, & > > inject_rarp); > > > + assert(r >= 0); > > > } > > > } > > > > > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > > > index d6f2163..2e752ab 100644 > > > --- a/hw/virtio/vhost-user.c > > > +++ b/hw/virtio/vhost-user.c > > > @@ -41,6 +41,7 @@ typedef enum VhostUserRequest { > > > VHOST_USER_SET_VRING_KICK = 12, > > > VHOST_USER_SET_VRING_CALL = 13, > > > VHOST_USER_SET_VRING_ERR = 14, > > > + VHOST_USER_NET_INJECT_RARP = 15, > > > VHOST_USER_MAX > > > } VhostUserRequest; > > > > > > @@ -70,6 +71,7 @@ typedef struct VhostUserMsg { > > > uint64_t u64; > > > struct vhost_vring_state state; > > > struct vhost_vring_addr addr; > > > + struct vhost_inject_rarp rarp; > > > VhostUserMemory memory; > > > }; > > > } QEMU_PACKED VhostUserMsg; > > > @@ -104,7 +106,8 @@ static unsigned long int > ioctl_to_vhost_user_request > > [VHOST_USER_MAX] = { > > > VHOST_GET_VRING_BASE, /* VHOST_USER_GET_VRING_BASE */ > > > VHOST_SET_VRING_KICK, /* VHOST_USER_SET_VRING_KICK */ > > > VHOST_SET_VRING_CALL, /* VHOST_USER_SET_VRING_CALL */ > > > - VHOST_SET_VRING_ERR /* VHOST_USER_SET_VRING_ERR */ > > > + VHOST_SET_VRING_ERR, /* VHOST_USER_SET_VRING_ERR */ > > > + VHOST_NET_INJECT_RARP /* VHOST_USER_NET_INJECT_RARP */ > > > }; > > > > > > static VhostUserRequest vhost_user_request_translate(unsigned > long int > > request) > > > @@ -287,6 +290,12 @@ static int vhost_user_call(struct vhost_dev > *dev, > > unsigned long int request, > > > msg.u64 |= VHOST_USER_VRING_NOFD_MASK; > > > } > > > break; > > > + > > > + case VHOST_NET_INJECT_RARP: > > > + memcpy(&msg.rarp, arg, sizeof(struct vhost_inject_rarp)); > > > + msg.size = sizeof(struct vhost_inject_rarp); > > > + break; > > > + > > > default: > > > error_report("vhost-user trying to send unhandled ioctl"); > > > return -1; > > > diff --git a/linux-headers/linux/vhost.h > b/linux-headers/linux/vhost.h > > > index c656f61..1920134 100644 > > > --- a/linux-headers/linux/vhost.h > > > +++ b/linux-headers/linux/vhost.h > > > @@ -63,6 +63,10 @@ struct vhost_memory { > > > struct vhost_memory_region regions[0]; > > > }; > > > > > > +struct vhost_inject_rarp { > > > + __u8 rarp[60]; > > > +}; > > > + > > > /* ioctls */ > > > > > > #define VHOST_VIRTIO 0xAF > > > @@ -121,6 +125,11 @@ struct vhost_memory { > > > * device. This can be used to stop the ring (e.g. for > migration). */ > > > #define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct > > vhost_vring_file) > > > > > > +/* Inject a RARP in case of live migration for guest that does not > > support > > > + * VIRTIO_NET_F_GUEST_ANNOUNCE */ > > > +#define VHOST_NET_INJECT_RARP _IOW(VHOST_VIRTIO, 0x31, struct > > vhost_inject_rarp) > > > + > > > + > > > /* Feature bits */ > > > /* Log all write descriptors. Can be changed while device is > active. */ > > > #define VHOST_F_LOG_ALL 26 > > > -- > > > 1.7.10.4 > > > > > --001a113ed184b4dacd05182faefa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes backend can save everything to be able to send the rar= p alone after a live migration.
Main purpose of this patch is to answer= to the point raise by Jason on the previous version of my patch:
> = Yes, your patch works well for recent drivers. But the problem is legacy
> guest/driver without VIRTIO_NET_F_GUEST_ANNOUNCE. In = this case there
> will be no GARP sent after migratio= n.


If Jaso= n is OK with this solution=C2=A0this patch can be forgotten.

Maybe, to warn user of this issue i= f the backend does not send the rarp, it can be useful to keep the warn mes= sage of the previous patch:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 fp= rintf(stderr,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "Warning: Guest with no VIRTIO_NET_F_GUEST_ANNOUN= CE support. RARP must be sent by vhost-user backend\n");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 fflush(stderr);

with a static = bool to display this message only one time to limit the number of message ?=

On We= d, Jun 10, 2015 at 6:00 PM, Michael S. Tsirkin <mst@redhat.com>= wrote:
On Wed, Jun 10, = 2015 at 05:48:47PM +0200, Thibaut Collet wrote:
> I have involved QEMU because QEMU prepares the rarp. I agree that back= end has
> probably all the information to do that.
> But backend does not know if the guest supports the=C2=A0VIRTIO_NET_F_= GUEST_ANNOUNCE

Why not?=C2=A0 Backend has the acked feature mask.


> and will send a useless rarp.
> Maybe this duplication of requests is not very important and in this c= ase this
> patch is not mandatory.
>
> On Wed, Jun 10, 2015 at 5:34 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
>
>=C2=A0 =C2=A0 =C2=A0On Wed, Jun 10, 2015 at 03:43:03PM +0200, Thibaut C= ollet wrote:
>=C2=A0 =C2=A0 =C2=A0> In case of live migration with legacy guest (w= ithout
>=C2=A0 =C2=A0 =C2=A0VIRTIO_NET_F_GUEST_ANNOUNCE)
>=C2=A0 =C2=A0 =C2=A0> a message is added between QEMU and the vhost = client/backend.
>=C2=A0 =C2=A0 =C2=A0> This message provides the RARP content, prepar= ed by QEMU, to the vhost
>=C2=A0 =C2=A0 =C2=A0> client/backend.
>=C2=A0 =C2=A0 =C2=A0> The vhost client/backend is responsible to sen= d the RARP.
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
>=C2=A0 =C2=A0 =C2=A0> ---
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 docs/specs/vhost-user.txt=C2=A0 =C2=A0|= =C2=A0 =C2=A016 ++++++++++++++++
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 hw/net/vhost_net.c=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 |=C2=A0 =C2=A0 8 ++++++++
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 hw/virtio/vhost-user.c=C2=A0 =C2=A0 =C2= =A0 |=C2=A0 =C2=A011 ++++++++++-
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 linux-headers/linux/vhost.h |=C2=A0 =C2= =A0 9 +++++++++
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 4 files changed, 43 insertions(+), 1 del= etion(-)
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> diff --git a/docs/specs/vhost-user.txt b/docs/= specs/vhost-user.txt
>=C2=A0 =C2=A0 =C2=A0> index 2c8e934..ef5d475 100644
>=C2=A0 =C2=A0 =C2=A0> --- a/docs/specs/vhost-user.txt
>=C2=A0 =C2=A0 =C2=A0> +++ b/docs/specs/vhost-user.txt
>=C2=A0 =C2=A0 =C2=A0> @@ -97,6 +97,7 @@ typedef struct VhostUserMsg = {
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint64_t u64= ;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct vhost= _vring_state state;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct vhost= _vring_addr addr;
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct vhost_inje= ct_rarp rarp;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 VhostUserMem= ory memory;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 };
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 } QEMU_PACKED VhostUserMsg;
>=C2=A0 =C2=A0 =C2=A0> @@ -132,6 +133,12 @@ Multi queue support
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 The protocol supports multiple queues by= setting all index fields in the
>=C2=A0 =C2=A0 =C2=A0sent
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 messages to a properly calculated value.=
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> +Live migration support
>=C2=A0 =C2=A0 =C2=A0> +----------------------
>=C2=A0 =C2=A0 =C2=A0> +The protocol supports live migration. GARP fr= om the migrated guest is
>=C2=A0 =C2=A0 =C2=A0done
>=C2=A0 =C2=A0 =C2=A0> +through the VIRTIO_NET_F_GUEST_ANNOUNCE mecha= nism for guest that
>=C2=A0 =C2=A0 =C2=A0supports it or
>=C2=A0 =C2=A0 =C2=A0> +through RARP.
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 Message types
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 -------------
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> @@ -269,3 +276,12 @@ Message types
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 Bits (0-7) of the p= ayload contain the vring index. Bit 8 is the
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 invalid FD flag. Th= is flag is set when there is no file descriptor
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 in the ancillary da= ta.
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0> + * VHOST_USER_NET_INJECT_RARP
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 Id: 15
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 Master payload: rarp con= tent
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 Provide the RARP message= to send to the guest after a live
>=C2=A0 =C2=A0 =C2=A0migration. This
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 message is sent only for= guest that does not support
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 VIRTIO_NET_F_GUEST_ANNOU= NCE.
>
>=C2=A0 =C2=A0 =C2=A0I don't see why this is needed.
>=C2=A0 =C2=A0 =C2=A0Can't backend simply send rarp itself?
>=C2=A0 =C2=A0 =C2=A0Why do we need to involve QEMU?
>
>
>
>=C2=A0 =C2=A0 =C2=A0> diff --git a/hw/net/vhost_net.c b/hw/net/vhost= _net.c
>=C2=A0 =C2=A0 =C2=A0> index 4a42325..f66d48d 100644
>=C2=A0 =C2=A0 =C2=A0> --- a/hw/net/vhost_net.c
>=C2=A0 =C2=A0 =C2=A0> +++ b/hw/net/vhost_net.c
>=C2=A0 =C2=A0 =C2=A0> @@ -369,10 +369,18 @@ void vhost_net_stop(Virt= IODevice *dev,
>=C2=A0 =C2=A0 =C2=A0NetClientState *ncs,
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 void vhost_net_inject_rarp(struct vhost_= net *net, const uint8_t *buf,
>=C2=A0 =C2=A0 =C2=A0size_t size)
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 {
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 struct vhost_inject_rarp inject= _rarp;
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 memcpy(&inject_rarp.rarp, b= uf, size);
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 if ((net->dev.acked_fea= tures & (1 << VIRTIO_NET_F_GUEST_ANNOUNCE)) =3D
>=C2=A0 =C2=A0 =C2=A0=3D 0) {
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 const VhostOps *v= host_ops =3D net->dev.vhost_ops;
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 int r;
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stde= rr,
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "Warning: Guest with no VIRTIO_NET_F_GUEST_ANNOUNCE<= br> >=C2=A0 =C2=A0 =C2=A0support. RARP must be sent by vhost-user backend\n&= quot;);
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fflush(stder= r);
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 r =3D vhost_ops-&= gt;vhost_call(&net->dev, VHOST_NET_INJECT_RARP, &
>=C2=A0 =C2=A0 =C2=A0inject_rarp);
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 assert(r >=3D = 0);
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 }
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> diff --git a/hw/virtio/vhost-user.c b/hw/virti= o/vhost-user.c
>=C2=A0 =C2=A0 =C2=A0> index d6f2163..2e752ab 100644
>=C2=A0 =C2=A0 =C2=A0> --- a/hw/virtio/vhost-user.c
>=C2=A0 =C2=A0 =C2=A0> +++ b/hw/virtio/vhost-user.c
>=C2=A0 =C2=A0 =C2=A0> @@ -41,6 +41,7 @@ typedef enum VhostUserReques= t {
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_USER_SET_VRING_KICK = =3D 12,
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_USER_SET_VRING_CALL = =3D 13,
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_USER_SET_VRING_ERR = =3D 14,
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 VHOST_USER_NET_INJECT_RARP =3D = 15,
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_USER_MAX
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 } VhostUserRequest;
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> @@ -70,6 +71,7 @@ typedef struct VhostUserMsg = {
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint64_t u64= ;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct vhost= _vring_state state;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct vhost= _vring_addr addr;
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct vhost_inje= ct_rarp rarp;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 VhostUserMem= ory memory;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 };
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 } QEMU_PACKED VhostUserMsg;
>=C2=A0 =C2=A0 =C2=A0> @@ -104,7 +106,8 @@ static unsigned long int i= octl_to_vhost_user_request
>=C2=A0 =C2=A0 =C2=A0[VHOST_USER_MAX] =3D {
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_GET_VRING_BASE,=C2= =A0 =C2=A0/* VHOST_USER_GET_VRING_BASE */
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_SET_VRING_KICK,=C2= =A0 =C2=A0/* VHOST_USER_SET_VRING_KICK */
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 VHOST_SET_VRING_CALL,=C2= =A0 =C2=A0/* VHOST_USER_SET_VRING_CALL */
>=C2=A0 =C2=A0 =C2=A0> -=C2=A0 =C2=A0 VHOST_SET_VRING_ERR=C2=A0 =C2= =A0 =C2=A0/* VHOST_USER_SET_VRING_ERR */
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 VHOST_SET_VRING_ERR,=C2=A0 =C2= =A0 /* VHOST_USER_SET_VRING_ERR */
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 VHOST_NET_INJECT_RARP=C2=A0 =C2= =A0/* VHOST_USER_NET_INJECT_RARP */
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 };
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 static VhostUserRequest vhost_user_reque= st_translate(unsigned long int
>=C2=A0 =C2=A0 =C2=A0request)
>=C2=A0 =C2=A0 =C2=A0> @@ -287,6 +290,12 @@ static int vhost_user_cal= l(struct vhost_dev *dev,
>=C2=A0 =C2=A0 =C2=A0unsigned long int request,
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 msg.u64 |=3D VHOST_USER_VRING_NOFD_MASK;
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 case VHOST_NET_INJECT_RARP:
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 memcpy(&msg.r= arp, arg, sizeof(struct vhost_inject_rarp));
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 msg.size =3D size= of(struct vhost_inject_rarp);
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 default:
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error_report= ("vhost-user trying to send unhandled ioctl");
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1; >=C2=A0 =C2=A0 =C2=A0> diff --git a/linux-headers/linux/vhost.h b/lin= ux-headers/linux/vhost.h
>=C2=A0 =C2=A0 =C2=A0> index c656f61..1920134 100644
>=C2=A0 =C2=A0 =C2=A0> --- a/linux-headers/linux/vhost.h
>=C2=A0 =C2=A0 =C2=A0> +++ b/linux-headers/linux/vhost.h
>=C2=A0 =C2=A0 =C2=A0> @@ -63,6 +63,10 @@ struct vhost_memory {
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0 =C2=A0struct vhost_memory_= region regions[0];
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 };
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> +struct vhost_inject_rarp {
>=C2=A0 =C2=A0 =C2=A0> +=C2=A0 =C2=A0 =C2=A0__u8 rarp[60];
>=C2=A0 =C2=A0 =C2=A0> +};
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 /* ioctls */
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 #define VHOST_VIRTIO 0xAF
>=C2=A0 =C2=A0 =C2=A0> @@ -121,6 +125,11 @@ struct vhost_memory {
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0* device.=C2=A0 This can be used t= o stop the ring (e.g. for migration). */
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 #define VHOST_NET_SET_BACKEND _IOW(VHOST= _VIRTIO, 0x30, struct
>=C2=A0 =C2=A0 =C2=A0vhost_vring_file)
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> +/* Inject a RARP in case of live migration fo= r guest that does not
>=C2=A0 =C2=A0 =C2=A0support
>=C2=A0 =C2=A0 =C2=A0> + * VIRTIO_NET_F_GUEST_ANNOUNCE */
>=C2=A0 =C2=A0 =C2=A0> +#define VHOST_NET_INJECT_RARP _IOW(VHOST_VIRT= IO, 0x31, struct
>=C2=A0 =C2=A0 =C2=A0vhost_inject_rarp)
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0> +
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 /* Feature bits */
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 /* Log all write descriptors. Can be cha= nged while device is active. */
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 #define VHOST_F_LOG_ALL 26
>=C2=A0 =C2=A0 =C2=A0> --
>=C2=A0 =C2=A0 =C2=A0> 1.7.10.4
>
>

--001a113ed184b4dacd05182faefa--