Thread (25 messages) 25 messages, 4 authors, 2016-01-28

Re: [PATCH v4] vfio: Support for no-IOMMU mode

From: Burakov, Anatoly <hidden>
Date: 2016-01-27 16:01:19

Hi Thomas,
quoted
+/* DMA mapping function prototype.
+ * Takes VFIO container fd as a parameter.
+ * Returns 0 on success, -1 on error.
+ * */
+typedef  int (*vfio_dma_func_t)(int);
+
+struct vfio_iommu_type {
+	int type_id;
+	const char *name;
+	vfio_dma_func_t dma_map_func;
+};
+
+int vfio_iommu_type1_dma_map(int);
+int vfio_iommu_noiommu_dma_map(int);
Is it possible (is it better) to declare these functions with vfio_dma_func_t?
Yeah, sure. Or maybe the other way around - maybe we could do away with the typedef. I'll go for the former though.
vfio_iommu_noiommu_dma_map is a weird name.
Why not vfio_noiommu_dma_map or vfio_iommu_none_dma_map?
Well, the NOIOMMU type is named VFIO_IOMMU_NOIOMMU in the VFIO headers. So it's consistent with the IOMMU type name. Although vfio_noiommu_dma_map seems reasonable.

Thanks,
Anatoly
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help