From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5749B5962 for ; Tue, 23 Feb 2016 06:56:44 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 22 Feb 2016 21:56:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,488,1449561600"; d="scan'208";a="919000315" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 22 Feb 2016 21:56:42 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 22 Feb 2016 21:56:42 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.249]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.196]) with mapi id 14.03.0248.002; Tue, 23 Feb 2016 13:56:40 +0800 From: "Xie, Huawei" To: Thomas Monjalon Thread-Topic: [PATCH RFC 4/4] doc: add note about rte_vhost_enqueue_burst thread safety. Thread-Index: AdFq8Jaz1/1ngahpRXGW43kFOae+SQ== Date: Tue, 23 Feb 2016 05:56:39 +0000 Message-ID: References: <1455863563-15751-1-git-send-email-i.maximets@samsung.com> <56C6DACA.7040109@samsung.com> <3343596.CjhAKlsm75@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.4.160] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Dyasly Sergey , "dev@dpdk.org" , Ilya Maximets Subject: Re: [dpdk-dev] [PATCH RFC 4/4] doc: add note about rte_vhost_enqueue_burst thread safety. 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, 23 Feb 2016 05:56:45 -0000 On 2/22/2016 6:16 PM, Thomas Monjalon wrote:=0A= > 2016-02-22 02:07, Xie, Huawei:=0A= >> On 2/19/2016 5:05 PM, Ilya Maximets wrote:=0A= >>> On 19.02.2016 11:36, Xie, Huawei wrote:=0A= >>>> On 2/19/2016 3:10 PM, Yuanhan Liu wrote:=0A= >>>>> On Fri, Feb 19, 2016 at 09:32:43AM +0300, Ilya Maximets wrote:=0A= >>>>>> Signed-off-by: Ilya Maximets =0A= >>>>>> ---=0A= >>>>>> doc/guides/prog_guide/thread_safety_dpdk_functions.rst | 1 +=0A= >>>>>> 1 file changed, 1 insertion(+)=0A= >>>>>>=0A= >>>>>> diff --git a/doc/guides/prog_guide/thread_safety_dpdk_functions.rst = b/doc/guides/prog_guide/thread_safety_dpdk_functions.rst=0A= >>>>>> index 403e5fc..13a6c89 100644=0A= >>>>>> --- a/doc/guides/prog_guide/thread_safety_dpdk_functions.rst=0A= >>>>>> +++ b/doc/guides/prog_guide/thread_safety_dpdk_functions.rst=0A= >>>>>> The mempool library is based on the DPDK lockless ring library and = therefore is also multi-thread safe.=0A= >>>>>> +rte_vhost_enqueue_burst() is also thread safe because based on lock= less ring-buffer algorithm like the ring library.=0A= >>>>> FYI, Huawei meant to make rte_vhost_enqueue_burst() not be thread-saf= e,=0A= >>>>> to aligh with the usage of rte_eth_tx_burst().=0A= >>>>>=0A= >>>>> --yliu=0A= >>>> I have a patch to remove the lockless enqueue. Unless there is strong= =0A= >>>> reason, i prefer vhost PMD to behave like other PMDs, with no internal= =0A= >>>> lockless algorithm. In future, for people who really need it, we could= =0A= >>>> have dynamic/static switch to enable it.=0A= >> Thomas, what is your opinion on this and my patch removing lockless enqu= eue?=0A= > The thread safety behaviour is part of the API specification.=0A= > If we want to enable/disable such behaviour, it must be done with an API= =0A= > function. But it would introduce a conditional statement in the fast path= .=0A= > That's why the priority must be to keep a simple and consistent behaviour= =0A= > and try to build around. An API complexity may be considered only if ther= e=0A= > is a real (measured) gain.=0A= =0A= Let us put the gain aside temporarily. I would do the measurement.=0A= Vhost is wrapped as a PMD in Tetsuya's patch. And also in DPDK OVS's=0A= case, it is wrapped as a vport like all other physical ports. The DPDK=0A= app/OVS will treat all ports equally. It will add complexity if the app=0A= needs to know that some supports concurrency while some not. Since all=0A= other PMDs doesn't support thread safety, it doesn't make sense for=0A= vhost PMD to support that. I believe the APP will not use that behavior.=0A= >>From the API's point of view, if we previously implemented it wrongly,=0A= we need to fix it as early as possible.=0A= =0A= >=0A= >=0A= =0A=