From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vhost: Add a hint on how to add or remove the device to a data core Date: Tue, 17 Mar 2015 00:40:45 +0100 Message-ID: <4112124.luVfq3zIfF@xps13> References: <1425032565-497-1-git-send-email-benoit.canet@nodalink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev-VfR2kkLFssw@public.gmane.org, =?ISO-8859-1?Q?Beno=EEt?= Canet To: Huawei Xie Return-path: In-Reply-To: <1425032565-497-1-git-send-email-benoit.canet-Kg/i9Ey4fNdWk0Htik3J/w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Huawei, any opinion about this patch? 2015-02-27 11:22, Beno=EEt Canet: > Let's make sure people will not forget to set and unset VIRTIO_DEV_RU= NNING. >=20 > Signed-off-by: Beno=EEt Canet > --- > doc/guides/prog_guide/vhost_lib.rst | 3 ++- > lib/librte_vhost/rte_virtio_net.h | 4 ++++ > 2 files changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_gu= ide/vhost_lib.rst > index 0b6eda7..ba6065d 100644 > --- a/doc/guides/prog_guide/vhost_lib.rst > +++ b/doc/guides/prog_guide/vhost_lib.rst > @@ -58,7 +58,8 @@ Vhost API Overview > register two callbacks, new_destory and destroy_device. > When virtio device is activated or deactivated by guest virtua= l machine, > the callback will be called, then vSwitch could put the device= onto data > - core or remove the device from data core. > + core or remove the device from data core by setting or unsetti= ng > + VIRTIO_DEV_RUNNING on the device flags. > =20 > * Read/write packets from/to guest virtual machine > =20 > diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte= _virtio_net.h > index 611a3d4..b9d34c7 100644 > --- a/lib/librte_vhost/rte_virtio_net.h > +++ b/lib/librte_vhost/rte_virtio_net.h > @@ -130,6 +130,10 @@ struct virtio_memory { > =20 > /** > * Device operations to add/remove device. > + * > + * Make sure to set VIRTIO_DEV_RUNNING to the device flags in new_de= vice and > + * remove it in destroy_device. > + * > */ > struct virtio_net_device_ops { > =09int (*new_device)(struct virtio_net *);=09/**< Add device. */ >=20