Skip to contentSkip to conversation

vfio/ppc64/spapr: Use correct structures for add/remove windows

PATCH Applied Alexey Kardashevskiy 3 participants 3 messages Apr 26, 2017 – Apr 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 vfio/ppc64/spapr: Use correct structures for add/remove windows

If Linux UAPI headers in the system do not have VFIO_SPAPR_TCE_v2_IOMMU defined, DPDK define necessary structures itself. However the existing definitions are different from ones pushed to the mainline kernel.

This copies structures passed via VFIO_IOMMU_SPAPR_TCE_CREATE and VFIO_IOMMU_SPAPR_TCE_REMOVE ioctls.

No change in behaviour is expected if installed linux UAPI headers have knowledge of VFIO_SPAPR_TCE_v2_IOMMU.

---
Changes:
v2:
* changed commit log after I realized that the linux UAPI headers are currently used and if a distro is quite fresh, it has everything defined correctly

---
 lib/librte_eal/linuxapp/eal/eal_vfio.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/linuxapp/eal/eal_vfio.h +8 -0
index 239ac4d8d..4a0283cb4 100644
@@ -69,13 +69,21 @@ struct vfio_iommu_spapr_register_memory {
 
 struct vfio_iommu_spapr_tce_create {
 	uint32_t argsz;
+	uint32_t flags;
+	/* in */
 	uint32_t page_shift;
+	uint32_t __resv1;
 	uint64_t window_size;
 	uint32_t levels;
+	uint32_t __resv2;
+	/* out */
+	uint64_t start_addr;
 };
 
 struct vfio_iommu_spapr_tce_remove {
 	uint32_t argsz;
+	uint32_t flags;
+	/* in */
 	uint64_t start_addr;
 };
 
Signature · 1 line
2.11.0
Acked-by on v2 1/1
#1 lore raw
Quoted 57 lines

From: dev [mailto:[email protected]] On Behalf Of Alexey Kardashevskiy
Sent: Wednesday, April 26, 2017 9:07 AM
To: [email protected]
Cc: Alexey Kardashevskiy <[email protected]>
Subject: [dpdk-dev] [PATCH dpdk v2] vfio/ppc64/spapr: Use correct structures for add/remove windows

If Linux UAPI headers in the system do not have VFIO_SPAPR_TCE_v2_IOMMU defined, DPDK define necessary structures itself. However the existing definitions are different from ones pushed to the mainline kernel.

This copies structures passed via VFIO_IOMMU_SPAPR_TCE_CREATE and VFIO_IOMMU_SPAPR_TCE_REMOVE ioctls.

No change in behaviour is expected if installed linux UAPI headers have knowledge of VFIO_SPAPR_TCE_v2_IOMMU.

---
Changes:
v2:
* changed commit log after I realized that the linux UAPI headers are currently used and if a distro is quite fresh, it has everything defined correctly

---
 lib/librte_eal/linuxapp/eal/eal_vfio.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/linuxapp/eal/eal_vfio.h +8 -1
index 239ac4d8d..4a0283cb4 100644
@@ -69,13 +69,21 @@ struct vfio_iommu_spapr_register_memory {
 
 struct vfio_iommu_spapr_tce_create {
 	uint32_t argsz;
+	uint32_t flags;
+	/* in */
 	uint32_t page_shift;
+	uint32_t __resv1;
 	uint64_t window_size;
 	uint32_t levels;
+	uint32_t __resv2;
+	/* out */
+	uint64_t start_addr;
 };
 
 struct vfio_iommu_spapr_tce_remove {
 	uint32_t argsz;
+	uint32_t flags;
+	/* in */
 	uint64_t start_addr;
 };
 
--
Quoted 1 line

2.11.0

That was quite an oversight on my part!..

#2 lore raw

26/04/2017 10:15, Burakov, Anatoly:

Quoted 9 lines
Quoted 9 lines

If Linux UAPI headers in the system do not have VFIO_SPAPR_TCE_v2_IOMMU defined, DPDK define necessary structures itself. However the existing definitions are different from ones pushed to the mainline kernel.

This copies structures passed via VFIO_IOMMU_SPAPR_TCE_CREATE and VFIO_IOMMU_SPAPR_TCE_REMOVE ioctls.

Quoted 8 lines
Quoted 4 lines

No change in behaviour is expected if installed linux UAPI headers have knowledge of VFIO_SPAPR_TCE_v2_IOMMU.

That was quite an oversight on my part!..

Applied, thanks