From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 0DEDCC826 for ; Wed, 29 Apr 2015 13:38:04 +0200 (CEST) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3TBc3Wa025848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 29 Apr 2015 07:38:04 -0400 Received: from localhost.localdomain (vpn1-7-141.ams2.redhat.com [10.36.7.141]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3TBc2Uk021534 for ; Wed, 29 Apr 2015 07:38:03 -0400 Message-ID: <5540C29A.9010708@redhat.com> Date: Wed, 29 Apr 2015 14:38:02 +0300 From: Panu Matilainen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: dev@dpdk.org References: <1430306974-9618-1-git-send-email-huawei.xie@intel.com> In-Reply-To: <1430306974-9618-1-git-send-email-huawei.xie@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Subject: Re: [dpdk-dev] [PATCH] vhost: make vhost lockless enqueue configurable 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: Wed, 29 Apr 2015 11:38:05 -0000 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 -