From mboxrd@z Thu Jan 1 00:00:00 1970 From: Panu Matilainen Subject: Re: [PATCH] vhost: make vhost lockless enqueue configurable Date: Wed, 29 Apr 2015 14:38:02 +0300 Message-ID: <5540C29A.9010708@redhat.com> References: <1430306974-9618-1-git-send-email-huawei.xie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1430306974-9618-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@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" On 04/29/2015 02:29 PM, Huawei Xie wrote: > vhost enabled vSwitch could have their own thread-safe vring enqueue policy. > Add the RTE_LIBRTE_VHOST_LOCKLESS_ENQ macro for vhost lockless enqueue. > Turn it off by default. > > Signed-off-by: Huawei Xie > --- > config/common_linuxapp | 1 + > lib/librte_vhost/vhost_rxtx.c | 24 +++++++++++++++++++++++- > 2 files changed, 24 insertions(+), 1 deletion(-) > > diff --git a/config/common_linuxapp b/config/common_linuxapp > index 0078dc9..7f59499 100644 > --- a/config/common_linuxapp > +++ b/config/common_linuxapp > @@ -421,6 +421,7 @@ CONFIG_RTE_KNI_VHOST_DEBUG_TX=n > # > CONFIG_RTE_LIBRTE_VHOST=n > CONFIG_RTE_LIBRTE_VHOST_USER=y > +CONFIG_RTE_LIBRTE_VHOST_LOCKLESS_ENQ=n > CONFIG_RTE_LIBRTE_VHOST_DEBUG=n > > # > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c > index 510ffe8..475be6e 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c > @@ -80,7 +80,11 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > * they need to be reserved. > */ > do { > +#ifdef RTE_LIBRTE_VHOST_LOCKESS_ENQ > res_base_idx = vq->last_used_idx_res; > +#else > + res_base_idx = vq->last_used_idx; > +#endif These things should be runtime configurable, not build options. Please do not assume everybody builds DPDK separately for each and every application that might ever be. - Panu -