From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1u02-0001AB-QD for qemu-devel@nongnu.org; Mon, 08 Jun 2015 06:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1tzx-0000HT-Sg for qemu-devel@nongnu.org; Mon, 08 Jun 2015 06:09:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1tzx-0000HI-L6 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 06:09:41 -0400 Date: Mon, 8 Jun 2015 12:09:38 +0200 From: "Michael S. Tsirkin" Message-ID: <20150608120609-mutt-send-email-mst@redhat.com> References: <55701BED.2090802@redhat.com> <1433510652-13866-1-git-send-email-thibaut.collet@6wind.com> <55752E3C.8070700@redhat.com> <55755D0B.2030708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thibaut Collet Cc: Jason Wang , qemu-devel@nongnu.org, Stefan Hajnoczi , quintela@redhat.com On Mon, Jun 08, 2015 at 12:01:38PM +0200, Thibaut Collet wrote: > Hi, >=20 > I agree that my patch is OK only for recent drivers. To have a simple p= atch > with only few modifications I do not implement a solution for old drive= r but I > can be done later. >=20 > For legacy guest without=A0VIRTIO_NET_F_GUEST_ANNOUNCE the problem is m= ore > complex. The RARP must be sent by the vhost client/backend. This compon= ent is > outside QEMU (the reference implementation is snabbswitch:=A0http:// > www.virtualopensystems.com/en/solutions/guides/snabbswitch-qemu/). To d= o that: > - a receive function must be defined for the vhost user. > - a message must be added between QEMU and vapp. This message will be s= ent only > for old guest driver to avoid GARP duplication. > - the added=A0self_announce_disabled must be removed (decision to send = or not the > RARP is done later by the backend and not by the generic migration meth= od) >=20 > Do you agree with this solution ? >=20 >=20 > Regards. I don't get it. Why do you need any extra messages for old drivers? To detect old drivers, simply have backend check whether VIRTIO_NET_F_GUEST_ANNOUNCE is set. But I don't see this as a blocker for this patch, this can be added separately as needed. > On Mon, Jun 8, 2015 at 11:14 AM, Jason Wang wrote= : >=20 > =20 >=20 > On 06/08/2015 04:21 PM, Thibaut Collet wrote: > > Hi, > > > > My understanding of gratuitous packet with virtio for any backend > > (vhost user or other): > > - When the VM is loaded (first start or migration) the virtio net > > interfaces are loaded ( virtio_net_load_device function in > > hw/net/virtio-net.c) > > - If the guest has the VIRTIO_NET_F_GUEST_ANNOUNCE capability, re= quest > > to send gratuitous packet is done. > > > > 1. To enable gratuitous packet through this mechanism I have > > added VIRTIO_NET_F_GUEST_ANNOUNCE capability to hw/net/vhost_net.= c. So > > host and guest can negotiate this feature when vhost-user is used= . > > > > 2. self announce occurs in case of live migration. During a live > > migration a GARP is sent to all net backend through a queue dedic= ated > > to the net backend. > >=A0 =A0 But for vhost-user: > >=A0 =A0 =A0 =A0 - this operation is not possible (vhost-user has n= o queue) > >=A0 =A0 =A0 =A0 - it is already done with the previous mechanism. > >=A0 =A0 Rather to define a queue to vhost user and notify twice th= e guest > > to send gratuitous packet I have disable GARP from self announce = and > > use only the first mechanism for that. > > > > I have tested my modifications with guest that supports > > VIRTIO_NET_F_GUEST_ANNOUNCE and vhost-user on the host. After a l= ive > > migration I have the GARP from the guest. >=20 > Yes, your patch works well for recent drivers. But the problem is l= egacy > guest/driver without VIRTIO_NET_F_GUEST_ANNOUNCE. In this case ther= e > will be no GARP sent after migration. >=20 > Thanks >=20 >=20