From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 3F74C5A06 for ; Tue, 17 Mar 2015 00:41:20 +0100 (CET) Received: by wgdm6 with SMTP id m6so52368128wgd.2 for ; Mon, 16 Mar 2015 16:41:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=9pjIyI7Gt75XrTrLqu8D1uyZvHGCNCR6hikzNROauik=; b=Arka7R7EYTcLSGUpDfB1JoZuTLBymoS+/34+MDugA9+fXuwgLTw/kjm6kwZ7mK6zxL mbq9RA9MvRoRCDM5Wdtp1uR9bjmnA/lG0YXVuLozkcisRR/po1bQV1zNXpfgz6ixzISU +MNFnSiRJ7lzLPD+aMFGmuTX89kMQs4PBRIc9K4Tlb7u/tfUJHf5m9QfyEW9HY9yTrJh iHelzTVQA7hBj7xClcziiaBfSqavwWkEYUQFQJEMjjH4MhdPKMuuqEdd8Yg0ZwnajJNr DGCW76utOc7NNzpUrkd04oli+VZpHt5C3nhYlwuRStGhkx4eWjGVwPi9NejY4yPjXmr9 nqnw== X-Gm-Message-State: ALoCoQnG2WXUyclerobwbHnsaFE1cZXvBxtTcXQDGkJAk45a3ug7xqlRKm6FE9zVJhzPdWKRpb1n X-Received: by 10.180.82.129 with SMTP id i1mr124600556wiy.77.1426549280079; Mon, 16 Mar 2015 16:41:20 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id n3sm17477956wja.36.2015.03.16.16.41.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 16:41:19 -0700 (PDT) From: Thomas Monjalon To: Huawei Xie Date: Tue, 17 Mar 2015 00:40:45 +0100 Message-ID: <4112124.luVfq3zIfF@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1425032565-497-1-git-send-email-benoit.canet@nodalink.com> References: <1425032565-497-1-git-send-email-benoit.canet@nodalink.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Cc: dev@dpdk.org, =?ISO-8859-1?Q?Beno=EEt?= Canet 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: Mon, 16 Mar 2015 23:41:20 -0000 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