From patchwork Mon Jun 29 14:44:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Fu X-Patchwork-Id: 72429 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D9BCA0350; Mon, 29 Jun 2020 16:54:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C01E1BF82; Mon, 29 Jun 2020 16:54:56 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A1D321BF7B for ; Mon, 29 Jun 2020 16:54:54 +0200 (CEST) IronPort-SDR: 5aqMAWrb1OaLKc+Rhq0jAyfWJkC5sQoPRNBEYTJ0+3A7Fy3UNxz1nRNOwJmTlt2Ud4wr90wJ5p RGzQ0R+2o0Hw== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="230812132" X-IronPort-AV: E=Sophos;i="5.75,295,1589266800"; d="scan'208";a="230812132" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 07:54:53 -0700 IronPort-SDR: gbmT1OAz08T+SNLbCd1LfSCy2aql0q0rzraE+fJjsD4RSxdCS6ey6C6W3+qdXT14lOEnG4+gr8 otNZdIgBzrGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,295,1589266800"; d="scan'208";a="424844212" Received: from npg-dpdk-patrickfu-sl1.sh.intel.com ([10.67.117.45]) by orsmga004.jf.intel.com with ESMTP; 29 Jun 2020 07:54:50 -0700 From: patrick.fu@intel.com To: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com, zhihong.wang@intel.com Cc: patrick.fu@intel.com, yinan.wang@intel.com, cheng1.jiang@intel.com, cunming.liang@intel.com Date: Mon, 29 Jun 2020 22:44:07 +0800 Message-Id: <1593441849-27306-1-git-send-email-patrick.fu@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH v2 0/2] introduce asynchronous data path for vhost 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Patrick Fu Performing large memory copies usually takes up a major part of CPU cycles and becomes the hot spot in vhost-user enqueue operation. To offload expensive memory operations from the CPU, this patch set proposes to leverage DMA engines, e.g., I/OAT, a DMA engine in the Intel's processor, to accelerate large copies. Large copies are offloaded from the CPU to the DMA in an asynchronous manner. The CPU just submits copy jobs to the DMA but without waiting for its copy completion. Thus, there is no CPU intervention during data transfer; we can save precious CPU cycles and improve the overall throughput for vhost-user based applications, like OVS. During packet transmission, it offloads large copies to the DMA and performs small copies by the CPU, due to startup overheads associated with the DMA. This patch set construct a general framework that applications can leverage to attach DMA channels with vhost-user transmit queues. Four new RTE APIs are introduced to vhost library for applications to register and use the asynchronous data path. In addition, two new DMA operation callbacks are defined, by which vhost-user asynchronous data path can interact with DMA hardware. Currently only enqueue operation for split queue is implemented, but the framework is flexible to extend support for packed queue. v2: update meson file for new header file update rte_vhost_version.map to include new APIs rename async APIs/structures to be prefixed with "rte_vhost" rename some variables/structures for readibility correct minor typo in comments/license statements refine memory allocation logic for vq internal buffer add error message printing in some failure cases check inflight async packets in unregistration API call mark new APIs as experimental Patrick Fu (2): vhost: introduce async enqueue registration API vhost: introduce async enqueue for split ring lib/librte_vhost/Makefile | 2 +- lib/librte_vhost/meson.build | 2 +- lib/librte_vhost/rte_vhost.h | 1 + lib/librte_vhost/rte_vhost_async.h | 176 +++++++++++ lib/librte_vhost/rte_vhost_version.map | 4 + lib/librte_vhost/socket.c | 20 ++ lib/librte_vhost/vhost.c | 127 +++++++- lib/librte_vhost/vhost.h | 30 +- lib/librte_vhost/vhost_user.c | 27 +- lib/librte_vhost/virtio_net.c | 539 ++++++++++++++++++++++++++++++++- 10 files changed, 919 insertions(+), 9 deletions(-) create mode 100644 lib/librte_vhost/rte_vhost_async.h