From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9A3DCA00BE; Mon, 16 May 2022 07:53:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4636440A7A; Mon, 16 May 2022 07:53:03 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 3CD3740A79 for ; Mon, 16 May 2022 07:53:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652680382; x=1684216382; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=J5bsc2Z1iEcFuHkb8r98hnhE5v5vpiBpiVDqS8qhiT0=; b=j1VE2EsDHUJr5jLhwJEwPwzu44QuAO+FUmpW8kgX8yVioobtb9RiETw4 ZMc3zDJnT2uSqX1rqF2LADebP6Td2nsrp123Xzqil76sFwYw1LcP1Cnhb /RapXXl+JW/1Uo2aEO3BP8p/CWYch3GTVGTpGWH/+RV+GjGD2meU9zNsk 63EO5if92r9VNGmxDLqZgaVrdCo1VAkZevZlI5mOZxZO844OND0Agb9e7 IfcvSWI0Mx+GraXskyD2ByA+ZA3U1b/WZZJkB130E95nIroUk1crWDntI eWZeGMylTSUmXYqroCYP1riyRwlJWdYiyPFMcT6bEEpzI6zOjh+Ak/yJh Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10348"; a="333798043" X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="333798043" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2022 22:52:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="897053991" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 15 May 2022 22:52:56 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 15 May 2022 22:52:56 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 15 May 2022 22:52:56 -0700 Received: from fmsmsx612.amr.corp.intel.com ([10.18.126.92]) by fmsmsx612.amr.corp.intel.com ([10.18.126.92]) with mapi id 15.01.2308.027; Sun, 15 May 2022 22:52:56 -0700 From: "Hu, Jiayu" To: "Ding, Xuan" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" CC: "dev@dpdk.org" , "Jiang, Cheng1" , "Pai G, Sunil" , "liangma@liangbit.com" , "Wang, YuanX" Subject: RE: [PATCH v7 4/5] vhost: support async dequeue for split ring Thread-Topic: [PATCH v7 4/5] vhost: support async dequeue for split ring Thread-Index: AQHYaM9tW+yKmsfgl0iw1A+iH4KVZK0g+22Q Date: Mon, 16 May 2022 05:52:56 +0000 Message-ID: <4eedc57dfe484bd0b7d76735f944e9c9@intel.com> References: <20220407152546.38167-1-xuan.ding@intel.com> <20220516024325.96067-1-xuan.ding@intel.com> <20220516024325.96067-5-xuan.ding@intel.com> In-Reply-To: <20220516024325.96067-5-xuan.ding@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Xuan, > -----Original Message----- > From: Ding, Xuan > Sent: Monday, May 16, 2022 10:43 AM > To: maxime.coquelin@redhat.com; Xia, Chenbo > Cc: dev@dpdk.org; Hu, Jiayu ; Jiang, Cheng1 > ; Pai G, Sunil ; > liangma@liangbit.com; Ding, Xuan ; Wang, YuanX > > Subject: [PATCH v7 4/5] vhost: support async dequeue for split ring >=20 > From: Xuan Ding >=20 > This patch implements asynchronous dequeue data path for vhost split ring= , > a new API rte_vhost_async_try_dequeue_burst() is introduced. >=20 > Signed-off-by: Xuan Ding > Signed-off-by: Yuan Wang > Tested-by: Yvonne Yang > Reviewed-by: Maxime Coquelin > --- > doc/guides/prog_guide/vhost_lib.rst | 7 + > doc/guides/rel_notes/release_22_07.rst | 5 + > lib/vhost/rte_vhost_async.h | 37 +++ > lib/vhost/version.map | 2 +- > lib/vhost/virtio_net.c | 337 +++++++++++++++++++++++++ > 5 files changed, 387 insertions(+), 1 deletion(-) >=20 > diff --git a/doc/guides/prog_guide/vhost_lib.rst > b/doc/guides/prog_guide/vhost_lib.rst > index f287b76ebf..09c1c24b48 100644 > --- a/doc/guides/prog_guide/vhost_lib.rst > +++ b/doc/guides/prog_guide/vhost_lib.rst > @@ -282,6 +282,13 @@ The following is an overview of some key Vhost API > functions: > Clear inflight packets which are submitted to DMA engine in vhost asyn= c > data > path. Completed packets are returned to applications through ``pkts``. >=20 > +* ``rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id, > + struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count, > + int *nr_inflight, uint16_t dma_id, uint16_t vchan_id)`` In dmadev library, dma_id is int16_t, rather than uint16_t. > + > + Receives (dequeues) ``count`` packets from guest to host in async > + data path, and stored them at ``pkts``. > + > Vhost-user Implementations > -------------------------- >=20 > diff --git a/doc/guides/rel_notes/release_22_07.rst > b/doc/guides/rel_notes/release_22_07.rst > index 88b1e478d4..564d88623e 100644 > --- a/doc/guides/rel_notes/release_22_07.rst > +++ b/doc/guides/rel_notes/release_22_07.rst > @@ -70,6 +70,11 @@ New Features > Added an API which can get the number of inflight packets in > vhost async data path without using lock. >=20 > +* **Added vhost async dequeue API to receive pkts from guest.** > + > + Added vhost async dequeue API which can leverage DMA devices to > + accelerate receiving pkts from guest. > + > Removed Items > ------------- >=20 > diff --git a/lib/vhost/rte_vhost_async.h b/lib/vhost/rte_vhost_async.h in= dex > 70234debf9..2789492e38 100644 > --- a/lib/vhost/rte_vhost_async.h > +++ b/lib/vhost/rte_vhost_async.h > @@ -204,6 +204,43 @@ uint16_t rte_vhost_clear_queue_thread_unsafe(int > vid, uint16_t queue_id, __rte_experimental int > rte_vhost_async_dma_configure(int16_t dma_id, uint16_t vchan_id); >=20 > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior > +notice > + * > + * This function tries to receive packets from the guest with > +offloading > + * copies to the async channel. The packets that are transfer completed In rte_vhost_async.h, DMA vChannel is referred as async channel or async co= py engine. But I think it's better to replace all with DMA vChannel to be cons= istent with DPDK. > + * are returned in "pkts". The other packets that their copies are > +submitted to > + * the async channel but not completed are called "in-flight packets". > + * This function will not return in-flight packets until their copies > +are > + * completed by the async channel. > + * > + * @param vid > + * ID of vhost device to dequeue data > + * @param queue_id > + * ID of virtqueue to dequeue data > + * @param mbuf_pool > + * Mbuf_pool where host mbuf is allocated > + * @param pkts > + * Blank array to keep successfully dequeued packets > + * @param count > + * Size of the packet array > + * @param nr_inflight > + * >=3D 0: The amount of in-flight packets Better to add more descriptions about the meaning of "nr_inflight". Thanks, Jiayu