From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 17 Dec 2015 23:44:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,445,1444719600"; d="scan'208";a="710237201" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga003.jf.intel.com with ESMTP; 17 Dec 2015 23:44:39 -0800 Date: Fri, 18 Dec 2015 15:45:12 +0800 From: Yuanhan Liu To: Tetsuya Mukawa , "Xie, Huawei" 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 Content-Disposition: inline In-Reply-To: <1448355603-21275-3-git-send-email-mukawa@igel.co.jp> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org, ann.zhuangyanying@huawei.com, yuanhan.liu@intel.com Subject: Re: [dpdk-dev] [PATCH v5 2/3] vhost: Add VHOST PMD 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: Fri, 18 Dec 2015 07:44:57 -0000 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