From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9F7A86936 for ; Tue, 11 Oct 2016 15:04:31 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 11 Oct 2016 06:04:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,329,1473145200"; d="scan'208";a="1068937623" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 11 Oct 2016 06:04:29 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 11 Oct 2016 06:04:29 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 11 Oct 2016 06:04:29 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.15]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.234]) with mapi id 14.03.0248.002; Tue, 11 Oct 2016 21:04:27 +0800 From: "Xu, Qian Q" To: Yuanhan Liu , "dev@dpdk.org" CC: Maxime Coquelin Thread-Topic: [dpdk-dev] [PATCH v3 0/7] vhost: add dequeue zero copy support Thread-Index: AQHSIf6jG7nHUA9FUEeKh3VdOZOk2KCjOZ0A Date: Tue, 11 Oct 2016 13:04:26 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E39202910@shsmsx102.ccr.corp.intel.com> References: <1474604007-5221-1-git-send-email-yuanhan.liu@linux.intel.com> <1475998080-4644-1-git-send-email-yuanhan.liu@linux.intel.com> In-Reply-To: <1475998080-4644-1-git-send-email-yuanhan.liu@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 0/7] vhost: add dequeue zero copy support 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: Tue, 11 Oct 2016 13:04:32 -0000 Tested-by: Qian Xu - Apply patch to dpdk-next-virtio: Pass - Compile: Pass - OS: Ubuntu16.04 4.4.0-34-generic - GCC: 5.4.0 Test Case - Pass, over 20% performance gain for big packet(1024B), and it's= designed to improve big packet performance.=20 - Test case: Without NIC, Vhost dequeuer, virtio TXonly, mergeable=3Don, th= en see ~28% performance gains for packet size 1518B; for small packet 64B, = similar performance as zero-copy=3D0.=20 - Test case: With Intel FVL 40G NIC, run PVP case, txd=3D128, mergeable=3Do= n, for packet size over 1K(1024B), we can see the performance benefits, for= example, 1024 will get 18% performance gains; 1518B will get 26% performan= ce gain compared with zero-copy=3D0, for small packet such as 64B, we will = get 15% performance drop which is reasonable, and vhost zero-copy is not ap= plicable for the small packet performance.=20 -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yuanhan Liu Sent: Sunday, October 9, 2016 8:28 AM To: dev@dpdk.org Cc: Maxime Coquelin ; Yuanhan Liu Subject: [dpdk-dev] [PATCH v3 0/7] vhost: add dequeue zero copy support This patch set enables vhost dequeue zero copy. The majority work goes to p= atch 4: "vhost: add dequeue zero copy". The basic idea of dequeue zero copy is, instead of copying data from the de= sc buf, here we let the mbuf reference the desc buf addr directly. The major issue behind that is how and when to update the used ring. You could check the commit log of patch 4 for more details. Patch 5 introduces a new flag, RTE_VHOST_USER_DEQUEUE_ZERO_COPY, to enable = dequeue zero copy, which is disabled by default. The performance gain is quite impressive. For a simple dequeue workload (ru= nning rxonly in vhost-pmd and runnin txonly in guest testpmd), it yields 50+% performance boost for packet size 1500B. For VM2VM iperf test case, it's even better: about 70% boost. For small packets, the performance is worse (it's expected, as the extra ov= erhead introduced by zero copy outweighs the benefits from saving few bytes= copy). v3: - rebase: mainly for removing conflicts with the Tx indirect patch - don't update last_used_idx twice for zero-copy mode - handle two mssiing "Tx -> dequeue" renames in log and usage v2: - renamed "tx zero copy" to "dequeue zero copy", to reduce confusions. - hnadle the case that a desc buf might across 2 host phys pages - use MAP_POPULATE to let kernel populate the page tables - updated release note - doc-ed the limitations for the vm2nic case - merge 2 continuous guest phys memory region - and few more trivial changes, please see them in the corresponding patches --- Yuanhan Liu (7): vhost: simplify memory regions handling vhost: get guest/host physical address mappings vhost: introduce last avail idx for dequeue vhost: add dequeue zero copy vhost: add a flag to enable dequeue zero copy examples/vhost: add an option to enable dequeue zero copy net/vhost: add an option to enable dequeue zero copy doc/guides/prog_guide/vhost_lib.rst | 35 +++- doc/guides/rel_notes/release_16_11.rst | 13 ++ drivers/net/vhost/rte_eth_vhost.c | 13 ++ examples/vhost/main.c | 19 +- lib/librte_vhost/rte_virtio_net.h | 1 + lib/librte_vhost/socket.c | 5 + lib/librte_vhost/vhost.c | 12 ++ lib/librte_vhost/vhost.h | 102 ++++++++--- lib/librte_vhost/vhost_user.c | 315 ++++++++++++++++++++++-------= ---- lib/librte_vhost/virtio_net.c | 196 +++++++++++++++++--- 10 files changed, 549 insertions(+), 162 deletions(-) -- 1.9.0