From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 2F9DE5F13; Wed, 24 Oct 2018 10:51:49 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 01:51:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,419,1534834800"; d="scan'208";a="243902133" Received: from btwcube1.sh.intel.com (HELO debian) ([10.67.104.158]) by orsmga004.jf.intel.com with ESMTP; 24 Oct 2018 01:51:47 -0700 Date: Wed, 24 Oct 2018 16:50:24 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: dev@dpdk.org, jfreimann@redhat.com, zhihong.wang@intel.com, stable@dpdk.org Message-ID: <20181024085024.GA4708@debian> References: <20181023100710.14739-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181023100710.14739-1-maxime.coquelin@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v2] vhost: avoid memory barriers when no descriptors dequeued X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 08:51:49 -0000 On Tue, Oct 23, 2018 at 12:07:10PM +0200, Maxime Coquelin wrote: > In both split and packed dequeue paths, flush_shadow_used_ring > and vhost_ring_call variants gets called even if not packets > have been dequeued, and so no descriptors updates happened. > > It has an impact on CPU pipeline, as memory barriers are used > in these functions. > > This patch don't call these functions if no descriptors have > been dequeued. The performance gain with split ring when > dequeue zero-copy is disabled should be null, but should be > noticeable with packed ring or dequeue zero-copy enabled. > > Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring") > Fixes: 915cf9404225 ("vhost: use shadow used ring in dequeue path") > Cc: stable@dpdk.org > > Signed-off-by: Maxime Coquelin > --- > > Changes in v2: > - Fix shadow_used_idx reset in error path (Tiwei) > > lib/librte_vhost/virtio_net.c | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) Reviewed-by: Tiwei Bie