Thomas Monjalon <tho...@monjalon.net> wrote on 11/06/2017 09:25:15 PM:
> From: Thomas Monjalon <tho...@monjalon.net> > To: Jonas Pfefferle <j...@zurich.ibm.com>, anatoly.bura...@intel.com > Cc: dev@dpdk.org > Date: 11/06/2017 09:55 PM > Subject: Re: [dpdk-dev] [PATCH v2] vfio: noiommu check error handling > > 31/10/2017 16:59, Jonas Pfefferle: > > Check and report errors on open/read in noiommu check. > > > > Signed-off-by: Jonas Pfefferle <j...@zurich.ibm.com> > > I cannot decide to apply this patch as it does not explain what > it is fixing, and as it is not reviewed. > This patch adds error handling and logging to the noiommu check. Also, on older kernels when the noiommu_enable file does not exist it assumes noiommu is not enabled instead of returning -1. Note that in rte_pci_get_iommu_class (drivers/bus/pci/linux/pci.c) is the only usage of the function and it assumes return == 1: noiommu is enabled any other return value noiommu disabled, i.e. my code change does not change the behavior of this function. We might want to check for errors in rte_pci_get_iommu_class as well since assuming it is not enabled when we cannot open and read it might lead to iova == VA being used even if noiommu is enabled. All this comes back to what I proposed before: instead of the noiommu and PPC64 check we should decide which iova mode to use depending on the iommu types available. The type should be already available at the point where we decide on the iova type. (iommu types supported is checked by vfio_get_container_fd)