From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yuanhan.liu@linux.intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id B844F37AC
 for <dev@dpdk.org>; Tue,  3 May 2016 02:42:55 +0200 (CEST)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga102.fm.intel.com with ESMTP; 02 May 2016 17:42:54 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.24,570,1455004800"; d="scan'208";a="967323208"
Received: from yliu-dev.sh.intel.com ([10.239.67.162])
 by orsmga002.jf.intel.com with ESMTP; 02 May 2016 17:42:53 -0700
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: dev@dpdk.org
Cc: huawei.xie@intel.com,
	Yuanhan Liu <yuanhan.liu@linux.intel.com>
Date: Mon,  2 May 2016 17:46:15 -0700
Message-Id: <1462236378-7604-1-git-send-email-yuanhan.liu@linux.intel.com>
X-Mailer: git-send-email 1.9.0
Subject: [dpdk-dev] [PATCH 0/3] [RFC] vhost: micro vhost optimization
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 03 May 2016 00:42:56 -0000

Here is a small patch set does the micro optimization, which brings about
10% performance boost in my 64B packet testing, with the following topo:

    pkt generator <----> NIC <-----> Virtio NIC

Patch 1 pre updates the used ring and update them in batch. It should be
feasible from my understanding: there will be no issue, guest driver will
not start processing them as far as we haven't updated the "used->idx"
yet. I could miss something though.

Patch 2 saves one check for small packets (that can be hold in one desc
buf and mbuf).

Patch 3 moves several frequently used fields into one cache line, for
better cache sharing. 

Note that this patch set is based on my latest vhost ABI refactoring patchset.


---
Yuanhan Liu (3):
  vhost: pre update used ring for Tx and Rx
  vhost: optimize dequeue for small packets
  vhost: arrange virtio_net fields for better cache sharing

 lib/librte_vhost/vhost-net.h  |   8 +--
 lib/librte_vhost/vhost_rxtx.c | 110 ++++++++++++++++++++++++------------------
 2 files changed, 68 insertions(+), 50 deletions(-)

-- 
1.9.0