From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D6A9F5A62 for ; Tue, 19 Jan 2016 17:25:27 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 19 Jan 2016 08:25:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,318,1449561600"; d="scan'208";a="896589339" Received: from unknown (HELO [10.255.27.35]) ([10.255.27.35]) by fmsmga002.fm.intel.com with ESMTP; 19 Jan 2016 08:25:23 -0800 To: Huawei Xie , dev@dpdk.org References: <1451918787-85887-1-git-send-email-huawei.xie@intel.com> From: "Tan, Jianfeng" Message-ID: <569E6372.5030200@intel.com> Date: Wed, 20 Jan 2016 00:25:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1451918787-85887-1-git-send-email-huawei.xie@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: ann.zhuangyanying@huawei.com Subject: Re: [dpdk-dev] [PATCH] vhost: remove lockless enqueue to the virtio ring 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, 19 Jan 2016 16:25:28 -0000 Hi Huawei, On 1/4/2016 10:46 PM, Huawei Xie wrote: > This patch removes the internal lockless enqueue implmentation. > DPDK doesn't support receiving/transmitting packets from/to the same > queue. Vhost PMD wraps vhost device as normal DPDK port. DPDK > applications normally have their own lock implmentation when enqueue > packets to the same queue of a port. > > The atomic cmpset is a costly operation. This patch should help > performance a bit. > > Signed-off-by: Huawei Xie > --- > lib/librte_vhost/vhost_rxtx.c | 86 +++++++++++++------------------------------ > 1 file changed, 25 insertions(+), 61 deletions(-) > > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c > index bbf3fac..26a1b9c 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c I think vhost example will not work well with this patch when vm2vm=software. Test case: Two virtio ports handled by two pmd threads. Thread 0 polls pkts from physical NIC and sends to virtio0, while thread0 receives pkts from virtio1 and routes it to virtio0. > - > *(volatile uint16_t *)&vq->used->idx += entry_success; Another unrelated question: We ever try to move this assignment out of loop to save cost as it's a data contention? Thanks, Jianfeng