From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 576B49A99 for ; Tue, 17 Mar 2015 10:09:06 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 17 Mar 2015 02:07:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,415,1422950400"; d="scan'208";a="541980655" Received: from pgsmsx105.gar.corp.intel.com ([10.221.44.96]) by orsmga003.jf.intel.com with ESMTP; 17 Mar 2015 02:08:00 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX105.gar.corp.intel.com (10.221.44.96) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 17 Mar 2015 17:08:27 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.36]) by shsmsx102.ccr.corp.intel.com ([169.254.2.198]) with mapi id 14.03.0224.002; Tue, 17 Mar 2015 17:08:26 +0800 From: "Xie, Huawei" To: =?iso-8859-1?Q?Beno=EEt_Canet?= , "dev@dpdk.org" Thread-Topic: [PATCH] vhost: Add a hint on how to add or remove the device to a data core Thread-Index: AdBgke04w/U4QASVSGCfoxS19C2KzA== Date: Tue, 17 Mar 2015 09:08:26 +0000 Message-ID: References: <1425032565-497-1-git-send-email-benoit.canet@nodalink.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: Add a hint on how to add or remove the device to a data core X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2015 09:09:06 -0000 Acked-by Huawei Xie =0A= =0A= =0A= On 2/27/2015 6:22 PM, Beno=EEt Canet wrote:=0A= > Let's make sure people will not forget to set and unset VIRTIO_DEV_RUNNIN= G.=0A= >=0A= > Signed-off-by: Beno=EEt Canet =0A= > ---=0A= > doc/guides/prog_guide/vhost_lib.rst | 3 ++-=0A= > lib/librte_vhost/rte_virtio_net.h | 4 ++++=0A= > 2 files changed, 6 insertions(+), 1 deletion(-)=0A= >=0A= > diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/= vhost_lib.rst=0A= > index 0b6eda7..ba6065d 100644=0A= > --- a/doc/guides/prog_guide/vhost_lib.rst=0A= > +++ b/doc/guides/prog_guide/vhost_lib.rst=0A= > @@ -58,7 +58,8 @@ Vhost API Overview=0A= > register two callbacks, new_destory and destroy_device.=0A= > When virtio device is activated or deactivated by guest virtual ma= chine,=0A= > the callback will be called, then vSwitch could put the device ont= o data=0A= > - core or remove the device from data core.=0A= > + core or remove the device from data core by setting or unsetting= =0A= > + VIRTIO_DEV_RUNNING on the device flags.=0A= > =0A= > * Read/write packets from/to guest virtual machine=0A= > =0A= > diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_vir= tio_net.h=0A= > index 611a3d4..b9d34c7 100644=0A= > --- a/lib/librte_vhost/rte_virtio_net.h=0A= > +++ b/lib/librte_vhost/rte_virtio_net.h=0A= > @@ -130,6 +130,10 @@ struct virtio_memory {=0A= > =0A= > /**=0A= > * Device operations to add/remove device.=0A= > + *=0A= > + * Make sure to set VIRTIO_DEV_RUNNING to the device flags in new_device= and=0A= > + * remove it in destroy_device.=0A= > + *=0A= > */=0A= > struct virtio_net_device_ops {=0A= > int (*new_device)(struct virtio_net *); /**< Add device. */=0A= =0A=