From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v5 2/3] vhost: Add VHOST PMD Date: Fri, 18 Dec 2015 15:45:12 +0800 Message-ID: <20151218074512.GA18863@yliu-dev.sh.intel.com> References: <1447392031-24970-3-git-send-email-mukawa@igel.co.jp> <1448355603-21275-1-git-send-email-mukawa@igel.co.jp> <1448355603-21275-3-git-send-email-mukawa@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, ann.zhuangyanying@huawei.com, yuanhan.liu@intel.com To: Tetsuya Mukawa , "Xie, Huawei" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8FF1C5A72 for ; Fri, 18 Dec 2015 08:44:56 +0100 (CET) Content-Disposition: inline In-Reply-To: <1448355603-21275-3-git-send-email-mukawa@igel.co.jp> 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" On Tue, Nov 24, 2015 at 06:00:02PM +0900, Tetsuya Mukawa wrote: > +static uint16_t > +eth_vhost_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) > +{ > + struct vhost_queue *r = q; > + uint16_t i, nb_rx = 0; > + > + if (unlikely(rte_atomic32_read(&r->allow_queuing) == 0)) > + return 0; > + > + rte_atomic32_set(&r->while_queuing, 1); > + > + if (unlikely(rte_atomic32_read(&r->allow_queuing) == 0)) > + goto out; I'm not quite famililar with PMD driver yet, but as far as I know, rte_eth_rx/tx_burst() does not provide any garantee on concurrent dequeuing/queuing. If that's true, vhost pmd could (and should) not do that, to keep the consistency. On the other hand, rte_vhost_dequeue/enqueue_burst() already has such support since the beginning: above check is redundant then. However, FYI, Huawei has just (internally) proposed to remove it, as he thinks that's application's duty. So, in neither way, we should not do that. --yliu