From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id AF0932906 for ; Fri, 21 Oct 2016 09:50:27 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 21 Oct 2016 00:50:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,375,1473145200"; d="scan'208";a="1047895284" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 21 Oct 2016 00:50:24 -0700 Date: Fri, 21 Oct 2016 15:51:17 +0800 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Jianbo Liu Message-ID: <20161021075117.GR16751@yliu-dev.sh.intel.com> References: <1476437678-7102-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476437678-7102-1-git-send-email-yuanhan.liu@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v7 0/7] vhost: optimize mergeable Rx path 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, 21 Oct 2016 07:50:28 -0000 Applied to dpdk-next-virtio. And thanks for testing and reviewing. --yliu On Fri, Oct 14, 2016 at 05:34:31PM +0800, Yuanhan Liu wrote: > This is a new set of patches to optimize the mergeable Rx code path. > No refactoring (rewrite) was made this time. It just applies some > findings from Zhihong (kudos to him!) that could improve the mergeable > Rx path on the old code. > > The two major factors that could improve the performance greatly are: > > - copy virtio header together with packet data. This could remove > the buubbles between the two copy to optimize the cache access. > > This is implemented in patch 2 "vhost: optimize cache access" > > - shadow used ring update and update them at once > > The basic idea is to update used ring in a local buffer and flush > them to the virtio used ring at once in the end. Again, this is > for optimizing the cache access. > > This is implemented in patch 5 "vhost: shadow used ring update" > > The two optimizations could yield 40+% performance in micro testing > and 20+% in PVP case testing with 64B packet size. > > Besides that, there are some tiny optimizations, such as prefetch > avail ring (patch 6) and retrieve avail head once (patch 7). > > Note: the shadow used ring tech could also be applied to the non-mrg > Rx path (and even the dequeu) path. I didn't do that for two reasons: > > - we already update used ring in batch in both path: it's not shadowed > first though. > > - it's a bit too late too make many changes at this stage: RC1 is out. > > Please help testing. > > Thanks. > > --yliu > > Cc: Jianbo Liu > --- > Yuanhan Liu (4): > vhost: simplify mergeable Rx vring reservation > vhost: use last avail idx for avail ring reservation > vhost: prefetch avail ring > vhost: retrieve avail head once > > Zhihong Wang (3): > vhost: remove useless volatile > vhost: optimize cache access > vhost: shadow used ring update > > lib/librte_vhost/vhost.c | 13 ++- > lib/librte_vhost/vhost.h | 5 +- > lib/librte_vhost/vhost_user.c | 23 +++-- > lib/librte_vhost/virtio_net.c | 193 +++++++++++++++++++++++++----------------- > 4 files changed, 149 insertions(+), 85 deletions(-) > > -- > 1.9.0