From: Anatoly Burakov Date: Tue, 28 Mar 2017 15:53:43 +0000 (+0100) Subject: vfio: fix build on old kernel X-Git-Tag: spdx-start~4352 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=468f42cc264580c078b892fe6886810fe996a75f;p=dpdk.git vfio: fix build on old kernel Fixing compile failures for kernels without sPAPR IOMMU support. Fixes: 0fe9830b5345 ("eal/ppc: support sPAPR IOMMU for vfio-pci") Signed-off-by: Anatoly Burakov --- diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h index ac31a4fc10..0bf85bb595 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h @@ -59,22 +59,44 @@ #define VFIO_IOMMU_SPAPR_REGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 17) #define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 19) #define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20) + +/* SPAPR_v2 is not present, but SPAPR might be */ +#ifndef VFIO_SPAPR_TCE_IOMMU +#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) + +struct vfio_iommu_spapr_tce_info { + uint32_t argsz; + uint32_t flags; + uint32_t dma32_window_start; + uint32_t dma32_window_size; + struct vfio_iommu_spapr_tce_ddw_info ddw; +}; +#endif + struct vfio_iommu_spapr_register_memory { uint32_t argsz; uint32_t flags; uint64_t vaddr; uint64_t size; }; + struct vfio_iommu_spapr_tce_create { uint32_t argsz; uint32_t page_shift; uint64_t window_size; uint32_t levels; }; + struct vfio_iommu_spapr_tce_remove { uint32_t argsz; uint64_t start_addr; }; + +struct vfio_iommu_spapr_tce_ddw_info { + uint64_t pgsizes; + uint32_t max_dynamic_windows_supported; + uint32_t levels; +}; #else #define RTE_VFIO_SPAPR VFIO_SPAPR_TCE_v2_IOMMU #endif