[v2] doc: update async enqueue API usage

Message ID 20220621072131.14756-1-xuan.ding@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] doc: update async enqueue API usage |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Ding, Xuan June 21, 2022, 7:21 a.m. UTC
  From: Xuan Ding <xuan.ding@intel.com>

This patch updates the correct usage for async enqueue APIs.
The rte_vhost_poll_enqueue_completed() needs to be
called in time to notify the guest of completed packets and
avoid packet loss.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
---
v2:
* refine doc and commit log
---
 doc/guides/prog_guide/vhost_lib.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Chenbo Xia June 21, 2022, 1:22 p.m. UTC | #1
Hi Xuan,

> -----Original Message-----
> From: Ding, Xuan <xuan.ding@intel.com>
> Sent: Tuesday, June 21, 2022 3:22 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Ding, Xuan
> <xuan.ding@intel.com>
> Subject: [PATCH v2] doc: update async enqueue API usage
> 
> From: Xuan Ding <xuan.ding@intel.com>
> 
> This patch updates the correct usage for async enqueue APIs.
> The rte_vhost_poll_enqueue_completed() needs to be
> called in time to notify the guest of completed packets and
> avoid packet loss.
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
> v2:
> * refine doc and commit log
> ---
>  doc/guides/prog_guide/vhost_lib.rst | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/vhost_lib.rst
> b/doc/guides/prog_guide/vhost_lib.rst
> index cd3f6caa9a..628db3fc38 100644
> --- a/doc/guides/prog_guide/vhost_lib.rst
> +++ b/doc/guides/prog_guide/vhost_lib.rst
> @@ -480,6 +480,14 @@ the same vring with their own DMA virtual channels.
> Besides, the number
>  of DMA devices is limited. For the purpose of scaling, it's necessary to
>  support sharing DMA channels among vrings.
> 
> +* Async enqueue API usage
> +
> +  In async enqueue path, rte_vhost_poll_enqueue_completed() needs to be
> +  called in time to notify the guest of DMA copy completed packets.
> +  Moreover, calling rte_vhost_submit_enqueue_burst() all the time but
> +  not poll completed will cause the DMA ring to be full, which will
> +  result in packet loss eventually.
> +

This subsection seems cleaner, could you also help to make 'Recommended IOVA
mode in async datapath' as a sub-section?

Another patch or not, either works for me.

Thanks,
Chenbo

>  Recommended IOVA mode in async datapath
>  ---------------------------------------
> 
> --
> 2.17.1
  
Ding, Xuan June 22, 2022, 1:13 a.m. UTC | #2
Hi Chenbo,

> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Tuesday, June 21, 2022 9:23 PM
> To: Ding, Xuan <xuan.ding@intel.com>; maxime.coquelin@redhat.com
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>
> Subject: RE: [PATCH v2] doc: update async enqueue API usage
> 
> Hi Xuan,
> 
> > -----Original Message-----
> > From: Ding, Xuan <xuan.ding@intel.com>
> > Sent: Tuesday, June 21, 2022 3:22 PM
> > To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> > Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Ding, Xuan
> > <xuan.ding@intel.com>
> > Subject: [PATCH v2] doc: update async enqueue API usage
> >
> > From: Xuan Ding <xuan.ding@intel.com>
> >
> > This patch updates the correct usage for async enqueue APIs.
> > The rte_vhost_poll_enqueue_completed() needs to be called in time to
> > notify the guest of completed packets and avoid packet loss.
> >
> > Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> > ---
> > v2:
> > * refine doc and commit log
> > ---
> >  doc/guides/prog_guide/vhost_lib.rst | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/doc/guides/prog_guide/vhost_lib.rst
> > b/doc/guides/prog_guide/vhost_lib.rst
> > index cd3f6caa9a..628db3fc38 100644
> > --- a/doc/guides/prog_guide/vhost_lib.rst
> > +++ b/doc/guides/prog_guide/vhost_lib.rst
> > @@ -480,6 +480,14 @@ the same vring with their own DMA virtual
> channels.
> > Besides, the number
> >  of DMA devices is limited. For the purpose of scaling, it's necessary
> > to  support sharing DMA channels among vrings.
> >
> > +* Async enqueue API usage
> > +
> > +  In async enqueue path, rte_vhost_poll_enqueue_completed() needs to
> > + be  called in time to notify the guest of DMA copy completed packets.
> > +  Moreover, calling rte_vhost_submit_enqueue_burst() all the time but
> > + not poll completed will cause the DMA ring to be full, which will
> > + result in packet loss eventually.
> > +
> 
> This subsection seems cleaner, could you also help to make 'Recommended
> IOVA mode in async datapath' as a sub-section?
> 
> Another patch or not, either works for me.

I will send a separate patch to move 'Recommended IOVA mode in async datapath' as a sub-section.

Thanks,
Xuan

> 
> Thanks,
> Chenbo
> 
> >  Recommended IOVA mode in async datapath
> >  ---------------------------------------
> >
> > --
> > 2.17.1
  
Chenbo Xia June 23, 2022, 3:09 a.m. UTC | #3
> -----Original Message-----
> From: Ding, Xuan <xuan.ding@intel.com>
> Sent: Tuesday, June 21, 2022 3:22 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Ding, Xuan
> <xuan.ding@intel.com>
> Subject: [PATCH v2] doc: update async enqueue API usage
> 
> From: Xuan Ding <xuan.ding@intel.com>
> 
> This patch updates the correct usage for async enqueue APIs.
> The rte_vhost_poll_enqueue_completed() needs to be
> called in time to notify the guest of completed packets and
> avoid packet loss.
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
> v2:
> * refine doc and commit log
> ---
>  doc/guides/prog_guide/vhost_lib.rst | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/vhost_lib.rst
> b/doc/guides/prog_guide/vhost_lib.rst
> index cd3f6caa9a..628db3fc38 100644
> --- a/doc/guides/prog_guide/vhost_lib.rst
> +++ b/doc/guides/prog_guide/vhost_lib.rst
> @@ -480,6 +480,14 @@ the same vring with their own DMA virtual channels.
> Besides, the number
>  of DMA devices is limited. For the purpose of scaling, it's necessary to
>  support sharing DMA channels among vrings.
> 
> +* Async enqueue API usage
> +
> +  In async enqueue path, rte_vhost_poll_enqueue_completed() needs to be
> +  called in time to notify the guest of DMA copy completed packets.
> +  Moreover, calling rte_vhost_submit_enqueue_burst() all the time but
> +  not poll completed will cause the DMA ring to be full, which will
> +  result in packet loss eventually.
> +
>  Recommended IOVA mode in async datapath
>  ---------------------------------------
> 
> --
> 2.17.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
  
Maxime Coquelin July 1, 2022, 1:54 p.m. UTC | #4
On 6/21/22 09:21, xuan.ding@intel.com wrote:
> From: Xuan Ding <xuan.ding@intel.com>
> 
> This patch updates the correct usage for async enqueue APIs.
> The rte_vhost_poll_enqueue_completed() needs to be
> called in time to notify the guest of completed packets and
> avoid packet loss.
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
> v2:
> * refine doc and commit log
> ---
>   doc/guides/prog_guide/vhost_lib.rst | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime
  

Patch

diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst
index cd3f6caa9a..628db3fc38 100644
--- a/doc/guides/prog_guide/vhost_lib.rst
+++ b/doc/guides/prog_guide/vhost_lib.rst
@@ -480,6 +480,14 @@  the same vring with their own DMA virtual channels. Besides, the number
 of DMA devices is limited. For the purpose of scaling, it's necessary to
 support sharing DMA channels among vrings.
 
+* Async enqueue API usage
+
+  In async enqueue path, rte_vhost_poll_enqueue_completed() needs to be
+  called in time to notify the guest of DMA copy completed packets.
+  Moreover, calling rte_vhost_submit_enqueue_burst() all the time but
+  not poll completed will cause the DMA ring to be full, which will
+  result in packet loss eventually.
+
 Recommended IOVA mode in async datapath
 ---------------------------------------