[v6,3/3] vhost: prevent zero copy mode if iommu is on
Checks
Commit Message
The simultaneous use of dequeue_zero_copy and IOMMU is problematic.
Not only because IOVA_VA mode is not supported but also because the
potential invalidation of guest pages while the buffers are in use,
is not handled.
Prevent these two features to be enabled simultaneously.
Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
Cc: maxime.coquelin@redhat.com
Cc: stable@dpdk.org
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
---
lib/librte_vhost/socket.c | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On 10/9/19 1:54 PM, Adrian Moreno wrote:
> The simultaneous use of dequeue_zero_copy and IOMMU is problematic.
> Not only because IOVA_VA mode is not supported but also because the
> potential invalidation of guest pages while the buffers are in use,
> is not handled.
>
> Prevent these two features to be enabled simultaneously.
>
> Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
> Cc: maxime.coquelin@redhat.com
> Cc: stable@dpdk.org
>
> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
> Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
>
> ---
> lib/librte_vhost/socket.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
@@ -871,6 +871,14 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
}
vsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY;
+ if (vsocket->dequeue_zero_copy &&
+ (flags & RTE_VHOST_USER_IOMMU_SUPPORT)) {
+ RTE_LOG(ERR, VHOST_CONFIG,
+ "error: enabling dequeue zero copy and IOMMU features "
+ "simultaneously is not supported\n");
+ goto out_mutex;
+ }
+
/*
* Set the supported features correctly for the builtin vhost-user
* net driver.