From: Shahaf Shuler Date: Sun, 10 Mar 2019 08:27:58 +0000 (+0200) Subject: vfio: allow DMA map to the default container X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4106d89a18f8;p=dpdk.git vfio: allow DMA map to the default container Enable users the option to call rte_vfio_dma_map with request to map to the default vfio fd. Signed-off-by: Shahaf Shuler Acked-by: Anatoly Burakov Acked-by: Gaetan Rivet --- diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst index 4e991180ed..86132821b1 100644 --- a/doc/guides/rel_notes/release_19_05.rst +++ b/doc/guides/rel_notes/release_19_05.rst @@ -147,6 +147,10 @@ API Changes ``rte_service_attr_get()`` has been changed from ``uint32_t *`` to ``uint64_t *``. +* vfio: Functions ``rte_vfio_container_dma_map`` and + ``rte_vfio_container_dma_unmap`` have been extended with an option to + request mapping or un-mapping to the default vfio container fd. + ABI Changes ----------- diff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h index 4b3a91e91e..247fa2f1e3 100644 --- a/lib/librte_eal/common/include/rte_vfio.h +++ b/lib/librte_eal/common/include/rte_vfio.h @@ -80,6 +80,8 @@ struct vfio_device_info; #endif /* VFIO_PRESENT */ +#define RTE_VFIO_DEFAULT_CONTAINER_FD (-1) + /** * Setup vfio_cfg for the device identified by its address. * It discovers the configured I/O MMU groups or sets a new one for the device. @@ -351,7 +353,8 @@ rte_vfio_container_group_unbind(int container_fd, int iommu_group_num); * Perform DMA mapping for devices in a container. * * @param container_fd - * the specified container fd + * the specified container fd. Use RTE_VFIO_DEFAULT_CONTAINER_FD to + * use the default container. * * @param vaddr * Starting virtual address of memory to be mapped. @@ -374,7 +377,8 @@ rte_vfio_container_dma_map(int container_fd, uint64_t vaddr, * Perform DMA unmapping for devices in a container. * * @param container_fd - * the specified container fd + * the specified container fd. Use RTE_VFIO_DEFAULT_CONTAINER_FD to + * use the default container. * * @param vaddr * Starting virtual address of memory to be unmapped.