DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Hu, Jiayu" <jiayu.hu@intel.com>
To: "Ding, Xuan" <xuan.ding@intel.com>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"Xia, Chenbo" <chenbo.xia@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Jiang, Cheng1" <cheng1.jiang@intel.com>,
	"Pai G, Sunil" <sunil.pai.g@intel.com>,
	"liangma@liangbit.com" <liangma@liangbit.com>,
	"Wang, YuanX" <yuanx.wang@intel.com>
Subject: RE: [PATCH v7 4/5] vhost: support async dequeue for split ring
Date: Mon, 16 May 2022 05:52:56 +0000	[thread overview]
Message-ID: <4eedc57dfe484bd0b7d76735f944e9c9@intel.com> (raw)
In-Reply-To: <20220516024325.96067-5-xuan.ding@intel.com>

Hi Xuan,

> -----Original Message-----
> From: Ding, Xuan <xuan.ding@intel.com>
> Sent: Monday, May 16, 2022 10:43 AM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Jiang, Cheng1
> <cheng1.jiang@intel.com>; Pai G, Sunil <sunil.pai.g@intel.com>;
> liangma@liangbit.com; Ding, Xuan <xuan.ding@intel.com>; Wang, YuanX
> <yuanx.wang@intel.com>
> Subject: [PATCH v7 4/5] vhost: support async dequeue for split ring
> 
> From: Xuan Ding <xuan.ding@intel.com>
> 
> This patch implements asynchronous dequeue data path for vhost split ring,
> a new API rte_vhost_async_try_dequeue_burst() is introduced.
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  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(-)
> 
> 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 async
> data
>    path. Completed packets are returned to applications through ``pkts``.
> 
> +* ``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
>  --------------------------
> 
> 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.
> 
> +* **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
>  -------------
> 
> diff --git a/lib/vhost/rte_vhost_async.h b/lib/vhost/rte_vhost_async.h index
> 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);
> 
> +/**
> + * @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 copy
engine. But I think it's better to replace all with DMA vChannel to be consistent
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
> + *  >= 0: The amount of in-flight packets

Better to add more descriptions about the meaning of "nr_inflight".

Thanks,
Jiayu

  reply	other threads:[~2022-05-16  5:53 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 15:25 [PATCH v1 0/5] vhost: support async dequeue data path xuan.ding
2022-04-07 15:25 ` [PATCH v1 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-04-07 15:25 ` [PATCH v1 2/5] vhost: prepare async " xuan.ding
2022-04-07 15:25 ` [PATCH v1 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-04-07 15:25 ` [PATCH v1 4/5] vhost: support async dequeue for split ring xuan.ding
2022-04-07 15:25 ` [PATCH v1 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-04-11 10:00 ` [PATCH v2 0/5] vhost: " xuan.ding
2022-04-11 10:00   ` [PATCH v2 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-04-11 10:00   ` [PATCH v2 2/5] vhost: prepare async " xuan.ding
2022-04-11 10:00   ` [PATCH v2 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-04-11 10:00   ` [PATCH v2 4/5] vhost: support async dequeue for split ring xuan.ding
2022-04-11 10:00   ` [PATCH v2 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-04-19  3:43 ` [PATCH v3 0/5] vhost: " xuan.ding
2022-04-19  3:43   ` [PATCH v3 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-04-22 15:30     ` Maxime Coquelin
2022-04-19  3:43   ` [PATCH v3 2/5] vhost: prepare async " xuan.ding
2022-04-22 15:32     ` Maxime Coquelin
2022-04-19  3:43   ` [PATCH v3 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-04-22 11:06     ` David Marchand
2022-04-22 15:46       ` Maxime Coquelin
2022-04-24  2:02         ` Ding, Xuan
2022-04-22 15:43     ` Maxime Coquelin
2022-04-19  3:43   ` [PATCH v3 4/5] vhost: support async dequeue for split ring xuan.ding
2022-04-19  3:43   ` [PATCH v3 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-05-05  6:23 ` [PATCH v4 0/5] vhost: " xuan.ding
2022-05-05  6:23   ` [PATCH v4 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-05-05  7:37     ` Yang, YvonneX
2022-05-05  6:23   ` [PATCH v4 2/5] vhost: prepare async " xuan.ding
2022-05-05  7:38     ` Yang, YvonneX
2022-05-05  6:23   ` [PATCH v4 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-05-05  7:39     ` Yang, YvonneX
2022-05-05  6:23   ` [PATCH v4 4/5] vhost: support async dequeue for split ring xuan.ding
2022-05-05  7:40     ` Yang, YvonneX
2022-05-05 19:36     ` Maxime Coquelin
2022-05-05  6:23   ` [PATCH v4 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-05-05  7:39     ` Yang, YvonneX
2022-05-05 19:38     ` Maxime Coquelin
2022-05-05 19:52   ` [PATCH v4 0/5] vhost: " Maxime Coquelin
2022-05-06  1:49     ` Ding, Xuan
2022-05-13  2:00 ` [PATCH v5 " xuan.ding
2022-05-13  2:00   ` [PATCH v5 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-05-13  2:00   ` [PATCH v5 2/5] vhost: prepare async " xuan.ding
2022-05-13  2:00   ` [PATCH v5 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-05-13  2:00   ` [PATCH v5 4/5] vhost: support async dequeue for split ring xuan.ding
2022-05-13  2:24     ` Stephen Hemminger
2022-05-13  2:33       ` Ding, Xuan
2022-05-13  2:00   ` [PATCH v5 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-05-13  2:50 ` [PATCH v6 0/5] vhost: " xuan.ding
2022-05-13  2:50   ` [PATCH v6 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-05-13  2:50   ` [PATCH v6 2/5] vhost: prepare async " xuan.ding
2022-05-13  2:50   ` [PATCH v6 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-05-13  2:50   ` [PATCH v6 4/5] vhost: support async dequeue for split ring xuan.ding
2022-05-13  2:50   ` [PATCH v6 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-05-13  3:27     ` Xia, Chenbo
2022-05-13  3:51       ` Ding, Xuan
2022-05-16  2:43 ` [PATCH v7 0/5] vhost: " xuan.ding
2022-05-16  2:43   ` [PATCH v7 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-05-16  2:43   ` [PATCH v7 2/5] vhost: prepare async " xuan.ding
2022-05-16  2:43   ` [PATCH v7 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-05-16  2:43   ` [PATCH v7 4/5] vhost: support async dequeue for split ring xuan.ding
2022-05-16  5:52     ` Hu, Jiayu [this message]
2022-05-16  6:10       ` Ding, Xuan
2022-05-16  2:43   ` [PATCH v7 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-05-16 11:10 ` [PATCH v8 0/5] vhost: " xuan.ding
2022-05-16 11:10   ` [PATCH v8 1/5] vhost: prepare sync for descriptor to mbuf refactoring xuan.ding
2022-05-16 11:10   ` [PATCH v8 2/5] vhost: prepare async " xuan.ding
2022-05-16 11:10   ` [PATCH v8 3/5] vhost: merge sync and async descriptor to mbuf filling xuan.ding
2022-05-16 11:10   ` [PATCH v8 4/5] vhost: support async dequeue for split ring xuan.ding
2022-06-16 14:38     ` David Marchand
2022-06-16 14:40       ` David Marchand
2022-06-17  6:34         ` Ding, Xuan
2022-05-16 11:10   ` [PATCH v8 5/5] examples/vhost: support async dequeue data path xuan.ding
2022-05-17 13:22   ` [PATCH v8 0/5] vhost: " Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4eedc57dfe484bd0b7d76735f944e9c9@intel.com \
    --to=jiayu.hu@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=cheng1.jiang@intel.com \
    --cc=dev@dpdk.org \
    --cc=liangma@liangbit.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=sunil.pai.g@intel.com \
    --cc=xuan.ding@intel.com \
    --cc=yuanx.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).