diff mbox

[dpdk-dev,v2] doc: add driver limitation for vhost dequeue zero copy

Message ID 1519723268-28723-1-git-send-email-junjie.j.chen@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

junjie.j.chen@intel.com Feb. 27, 2018, 9:21 a.m. UTC
In vhost-switch example, when binding nic to vfio-pci, dequeue zero
copy cannot work in VM2NIC mode due to no iommu dma mapping is setup
for guest memory currently.

Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
---
Changes in V2:
 - add doc in vhost lib

 doc/guides/prog_guide/vhost_lib.rst | 3 +++
 doc/guides/sample_app_ug/vhost.rst  | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Maxime Coquelin March 6, 2018, 8:57 a.m. UTC | #1
On 02/27/2018 10:21 AM, Junjie Chen wrote:
> In vhost-switch example, when binding nic to vfio-pci, dequeue zero
> copy cannot work in VM2NIC mode due to no iommu dma mapping is setup
> for guest memory currently.
> 
> Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
> ---
> Changes in V2:
>   - add doc in vhost lib
> 
>   doc/guides/prog_guide/vhost_lib.rst | 3 +++
>   doc/guides/sample_app_ug/vhost.rst  | 5 ++++-
>   2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst
> index 18227b6..bdf77d6 100644
> --- a/doc/guides/prog_guide/vhost_lib.rst
> +++ b/doc/guides/prog_guide/vhost_lib.rst
> @@ -83,6 +83,9 @@ The following is an overview of some key Vhost API functions:
>         of those segments, thus the fewer the segments, the quicker we will get
>         the mapping. NOTE: we may speed it by using tree searching in future.
>   
> +    * zero copy does not work when using vfio-pci driver currently, this is
> +      because we don't setup iommu dma mapping for guest memory.
> +

I guess that it should work with vfio-pci in noiommu mode? Maybe worth
to clarify.

>     - ``RTE_VHOST_USER_IOMMU_SUPPORT``
>   
>       IOMMU support will be enabled when this flag is set. It is disabled by
> diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
> index a4bdc6a..840c1fd 100644
> --- a/doc/guides/sample_app_ug/vhost.rst
> +++ b/doc/guides/sample_app_ug/vhost.rst
> @@ -147,7 +147,10 @@ retries on an RX burst, it takes effect only when rx retry is enabled. The
>   default value is 15.
>   
>   **--dequeue-zero-copy**
> -Dequeue zero copy will be enabled when this option is given.
> +Dequeue zero copy will be enabled when this option is given, it is worth to
> +note that if NIC is binded to vfio-pci driver, dequeue zero copy cannot work
> +at VM2NIC mode (vm2vm=0) due to currently we don't setup iommu dma mapping for
> +guest memory.
>   
>   **--vlan-strip 0|1**
>   VLAN strip option is removed, because different NICs have different behaviors
>
junjie.j.chen@intel.com March 9, 2018, 5:17 a.m. UTC | #2
> -----Original Message-----

> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]

> Sent: Tuesday, March 6, 2018 4:57 PM

> To: Chen, Junjie J <junjie.j.chen@intel.com>; yliu@fridaylinux.org; Tan,

> Jianfeng <jianfeng.tan@intel.com>

> Cc: dev@dpdk.org

> Subject: Re: [PATCH v2] doc: add driver limitation for vhost dequeue zero copy

> 

> 

> 

> On 02/27/2018 10:21 AM, Junjie Chen wrote:

> > In vhost-switch example, when binding nic to vfio-pci, dequeue zero

> > copy cannot work in VM2NIC mode due to no iommu dma mapping is setup

> > for guest memory currently.

> >

> > Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>

> > ---

> > Changes in V2:

> >   - add doc in vhost lib

> >

> >   doc/guides/prog_guide/vhost_lib.rst | 3 +++

> >   doc/guides/sample_app_ug/vhost.rst  | 5 ++++-

> >   2 files changed, 7 insertions(+), 1 deletion(-)

> >

> > diff --git a/doc/guides/prog_guide/vhost_lib.rst

> > b/doc/guides/prog_guide/vhost_lib.rst

> > index 18227b6..bdf77d6 100644

> > --- a/doc/guides/prog_guide/vhost_lib.rst

> > +++ b/doc/guides/prog_guide/vhost_lib.rst

> > @@ -83,6 +83,9 @@ The following is an overview of some key Vhost API

> functions:

> >         of those segments, thus the fewer the segments, the quicker we

> will get

> >         the mapping. NOTE: we may speed it by using tree searching in

> future.

> >

> > +    * zero copy does not work when using vfio-pci driver currently, this is

> > +      because we don't setup iommu dma mapping for guest memory.

> > +

> 

> I guess that it should work with vfio-pci in noiommu mode? Maybe worth to

> clarify.

You are right, it works on noiommu mode. Updated patch accordingly. 
> 

> >     - ``RTE_VHOST_USER_IOMMU_SUPPORT``

> >

> >       IOMMU support will be enabled when this flag is set. It is

> > disabled by diff --git a/doc/guides/sample_app_ug/vhost.rst

> > b/doc/guides/sample_app_ug/vhost.rst

> > index a4bdc6a..840c1fd 100644

> > --- a/doc/guides/sample_app_ug/vhost.rst

> > +++ b/doc/guides/sample_app_ug/vhost.rst

> > @@ -147,7 +147,10 @@ retries on an RX burst, it takes effect only when rx

> retry is enabled. The

> >   default value is 15.

> >

> >   **--dequeue-zero-copy**

> > -Dequeue zero copy will be enabled when this option is given.

> > +Dequeue zero copy will be enabled when this option is given, it is

> > +worth to note that if NIC is binded to vfio-pci driver, dequeue zero

> > +copy cannot work at VM2NIC mode (vm2vm=0) due to currently we don't

> > +setup iommu dma mapping for guest memory.

> >

> >   **--vlan-strip 0|1**

> >   VLAN strip option is removed, because different NICs have different

> > behaviors

> >
diff mbox

Patch

diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst
index 18227b6..bdf77d6 100644
--- a/doc/guides/prog_guide/vhost_lib.rst
+++ b/doc/guides/prog_guide/vhost_lib.rst
@@ -83,6 +83,9 @@  The following is an overview of some key Vhost API functions:
       of those segments, thus the fewer the segments, the quicker we will get
       the mapping. NOTE: we may speed it by using tree searching in future.
 
+    * zero copy does not work when using vfio-pci driver currently, this is
+      because we don't setup iommu dma mapping for guest memory.
+
   - ``RTE_VHOST_USER_IOMMU_SUPPORT``
 
     IOMMU support will be enabled when this flag is set. It is disabled by
diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index a4bdc6a..840c1fd 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -147,7 +147,10 @@  retries on an RX burst, it takes effect only when rx retry is enabled. The
 default value is 15.
 
 **--dequeue-zero-copy**
-Dequeue zero copy will be enabled when this option is given.
+Dequeue zero copy will be enabled when this option is given, it is worth to
+note that if NIC is binded to vfio-pci driver, dequeue zero copy cannot work
+at VM2NIC mode (vm2vm=0) due to currently we don't setup iommu dma mapping for
+guest memory.
 
 **--vlan-strip 0|1**
 VLAN strip option is removed, because different NICs have different behaviors