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

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

Checks

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

Commit Message

junjie.j.chen@intel.com March 14, 2018, 4:24 p.m. UTC
  In vhost-switch example, when binding nic to vfio-pci with iommu enabled,
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 V4:
- make words more accurate
Changes in V3:
- update limitation to iommu
Changes in V2:
- add doc in vhost lib
 doc/guides/prog_guide/vhost_lib.rst | 5 +++++
 doc/guides/sample_app_ug/vhost.rst  | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
  

Comments

Jianfeng Tan March 19, 2018, 6:56 a.m. UTC | #1
> -----Original Message-----
> From: Chen, Junjie J
> Sent: Thursday, March 15, 2018 12:24 AM
> To: Tan, Jianfeng; maxime.coquelin@redhat.com; yliu@fridaylinux.org
> Cc: dev@dpdk.org; Chen, Junjie J
> Subject: [PATCH v4] doc: add driver limitation for vhost dequeue zero copy
> 
> In vhost-switch example, when binding nic to vfio-pci with iommu enabled,
> 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>

Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>

Thanks!

> ---
> Changes in V4:
> - make words more accurate
> Changes in V3:
> - update limitation to iommu
> Changes in V2:
> - add doc in vhost lib
>  doc/guides/prog_guide/vhost_lib.rst | 5 +++++
>  doc/guides/sample_app_ug/vhost.rst  | 5 ++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/guides/prog_guide/vhost_lib.rst
> b/doc/guides/prog_guide/vhost_lib.rst
> index 18227b6..b49e36e 100644
> --- a/doc/guides/prog_guide/vhost_lib.rst
> +++ b/doc/guides/prog_guide/vhost_lib.rst
> @@ -83,6 +83,11 @@ 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 can not work when using vfio-pci with iommu mode currently,
> this
> +      is because we don't setup iommu dma mapping for guest memory. If
> you have
> +      to use vfio-pci driver, please insert vfio-pci kernel module in noiommu
> +      mode.
> +
>    - ``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..f0bb169 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 driver with iommu enabled, 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
> --
> 2.0.1
  
Maxime Coquelin March 29, 2018, 12:14 p.m. UTC | #2
On 03/14/2018 05:24 PM, Junjie Chen wrote:
> In vhost-switch example, when binding nic to vfio-pci with iommu enabled,
> 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>

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

John, as this is a doc patch for Vhost, does it go through the doc tree 
or through Virtio one?

Thanks,
Maxime
> ---
> Changes in V4:
> - make words more accurate
> Changes in V3:
> - update limitation to iommu
> Changes in V2:
> - add doc in vhost lib
>   doc/guides/prog_guide/vhost_lib.rst | 5 +++++
>   doc/guides/sample_app_ug/vhost.rst  | 5 ++++-
>   2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst
> index 18227b6..b49e36e 100644
> --- a/doc/guides/prog_guide/vhost_lib.rst
> +++ b/doc/guides/prog_guide/vhost_lib.rst
> @@ -83,6 +83,11 @@ 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 can not work when using vfio-pci with iommu mode currently, this
> +      is because we don't setup iommu dma mapping for guest memory. If you have
> +      to use vfio-pci driver, please insert vfio-pci kernel module in noiommu
> +      mode.
> +
>     - ``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..f0bb169 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 driver with iommu enabled, 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
>
  
Maxime Coquelin April 11, 2018, 2:34 p.m. UTC | #3
On 03/29/2018 02:14 PM, Maxime Coquelin wrote:
> 
> 
> On 03/14/2018 05:24 PM, Junjie Chen wrote:
>> In vhost-switch example, when binding nic to vfio-pci with iommu enabled,
>> 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>
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> John, as this is a doc patch for Vhost, does it go through the doc tree 
> or through Virtio one?


Applied to dpdk-next-virtio/master

Thanks,
Maxime

> Thanks,
> Maxime
>> ---
>> Changes in V4:
>> - make words more accurate
>> Changes in V3:
>> - update limitation to iommu
>> Changes in V2:
>> - add doc in vhost lib
>>   doc/guides/prog_guide/vhost_lib.rst | 5 +++++
>>   doc/guides/sample_app_ug/vhost.rst  | 5 ++++-
>>   2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/guides/prog_guide/vhost_lib.rst 
>> b/doc/guides/prog_guide/vhost_lib.rst
>> index 18227b6..b49e36e 100644
>> --- a/doc/guides/prog_guide/vhost_lib.rst
>> +++ b/doc/guides/prog_guide/vhost_lib.rst
>> @@ -83,6 +83,11 @@ 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 can not work when using vfio-pci with iommu mode 
>> currently, this
>> +      is because we don't setup iommu dma mapping for guest memory. 
>> If you have
>> +      to use vfio-pci driver, please insert vfio-pci kernel module in 
>> noiommu
>> +      mode.
>> +
>>     - ``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..f0bb169 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 driver with iommu enabled, 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
>>
  

Patch

diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst
index 18227b6..b49e36e 100644
--- a/doc/guides/prog_guide/vhost_lib.rst
+++ b/doc/guides/prog_guide/vhost_lib.rst
@@ -83,6 +83,11 @@  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 can not work when using vfio-pci with iommu mode currently, this
+      is because we don't setup iommu dma mapping for guest memory. If you have
+      to use vfio-pci driver, please insert vfio-pci kernel module in noiommu
+      mode.
+
   - ``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..f0bb169 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 driver with iommu enabled, 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