From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH] vhost: remove lockless enqueue to the virtio ring Date: Wed, 20 Jan 2016 00:25:22 +0800 Message-ID: <569E6372.5030200@intel.com> References: <1451918787-85887-1-git-send-email-huawei.xie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: ann.zhuangyanying@huawei.com To: Huawei Xie , dev@dpdk.org 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) In-Reply-To: <1451918787-85887-1-git-send-email-huawei.xie@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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