From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id CD3C328EE for ; Thu, 30 Nov 2017 03:44:19 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2017 18:44:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,339,1508828400"; d="scan'208";a="179382738" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 29 Nov 2017 18:44:18 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 29 Nov 2017 18:43:39 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Thu, 30 Nov 2017 10:41:13 +0800 From: "Wang, Xiao W" To: Yuanhan Liu CC: "dev@dpdk.org" , "Bie, Tiwei" Thread-Topic: [PATCH 2/2] net/virtio: support GUEST ANNOUNCE Thread-Index: AQHTZMus26sILOCs1UaNjcS7nwRD2KMnrHeAgASSgUA= Date: Thu, 30 Nov 2017 02:41:12 +0000 Message-ID: References: <1511521440-57724-1-git-send-email-xiao.w.wang@intel.com> <1511521440-57724-3-git-send-email-xiao.w.wang@intel.com> <20171127124855.GB23415@yliu-home> In-Reply-To: <20171127124855.GB23415@yliu-home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTFjNDk4NWEtODBlOC00ZTFlLTg1ZTQtYjQ5YzhiZTk0MDc0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJMc25cL1V4VURDZlwvdFJaK2lES3A1cDl3NkVBbDc0MGhSRHJ0enBpMm1vSmxlRFBYQlwvdkczRWY0WHgyTjlKSVA2In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] net/virtio: support GUEST ANNOUNCE X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Nov 2017 02:44:20 -0000 > -----Original Message----- > From: Yuanhan Liu [mailto:yliu@fridaylinux.org] > Sent: Monday, November 27, 2017 8:49 PM > To: Wang, Xiao W > Cc: dev@dpdk.org > Subject: Re: [PATCH 2/2] net/virtio: support GUEST ANNOUNCE >=20 > On Fri, Nov 24, 2017 at 03:04:00AM -0800, Xiao Wang wrote: > > When live migration is done, for the backup VM, either the virtio > > frontend or the vhost backend needs to send out gratuitous RARP packet > > to announce its new network location. > > > > This patch enables VIRTIO_NET_F_GUEST_ANNOUNCE feature to support > live > > migration scenario where the vhost backend doesn't have the ability to > > generate RARP packet. >=20 > Yes, it's a feature good to have. >=20 > > +static int > > +virtio_dev_pause(struct rte_eth_dev *dev) > > +{ > > + struct virtio_hw *hw =3D dev->data->dev_private; > > + > > + if (hw->started =3D=3D 0) > > + return -1; > > + hw->started =3D 0; > > + /* > > + * Prevent the worker thread from touching queues to avoid condition, > > + * 1 ms should be enough for the ongoing Tx function to finish. > > + */ > > + rte_delay_ms(1); > > + return 0; > > +} > > + > > +static void > > +virtio_dev_resume(struct rte_eth_dev *dev) > > +{ > > + struct virtio_hw *hw =3D dev->data->dev_private; > > + > > + hw->started =3D 1; > > +} >=20 > However, the implementation (stop first, pause for 1ms, duplicate another > Tx function, resume) doesn't seem elegant. >=20 > You probably could try something like DPDK vhost does: >=20 > - set a flag when S_ANNOUCE is received > - inject a pkt when such flag is set in the xmit function >=20 > You then should be able to get rid of all of above stuffs. >=20 > --yliu The difference is that the virtio port may just receive packet, without xmi= t. Thanks for the comments, Xiao