From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] eal: disable IOVA mode detection by default Date: Wed, 1 Nov 2017 09:32:52 +0530 Message-ID: <20171101040251.GA13569@jerin> References: <20171101010726.17781-1-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Thomas Monjalon , Bruce Richardson , Sergio Gonzalez Monroy , dev@dpdk.org, Jianfeng Tan , Santosh Shukla To: Ferruh Yigit Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0073.outbound.protection.outlook.com [104.47.41.73]) by dpdk.org (Postfix) with ESMTP id 56ED81B21C for ; Wed, 1 Nov 2017 05:03:16 +0100 (CET) Content-Disposition: inline In-Reply-To: <20171101010726.17781-1-ferruh.yigit@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Wed, 1 Nov 2017 01:07:26 +0000 > From: Ferruh Yigit > To: Thomas Monjalon , Bruce Richardson > , Sergio Gonzalez Monroy > > CC: dev@dpdk.org, Ferruh Yigit , Jianfeng Tan > , Santosh Shukla > > Subject: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default > X-Mailer: git-send-email 2.13.6 > > Fix kernel crash with KNI because KNI requires physical addresses. The actual fix would be to make KNI IOMMU aware based on the DPDK mode. ie. On slow path, /* Get iommu domain for iova to physical addr conversion */ if (rte_eal_iova_mode() == RTE_IOVA_VA) kni->iommu_domain = iommu_get_domain_for_dev(dev); else kni->iommu_domain = NULL; On fast path, static inline u64 kni_iova_to_phys(struct ... *kni, dma_addr_t dma_addr) { /* Translation is installed only when IOMMU is present */ if (kni->iommu_domain) return iommu_iova_to_phys(kni->iommu_domain, dma_addr); return dma_addr; } > > A config option introduced to disable IOVA mode detection and to set it > to physical address by default. Disabling config option will enable IOVA > mode detection. > > When there is no intension to use KNI, it is safe to enable detection. > > Config option disable IOVA mode detection by default to be sure only who > is aware of result enable it. > > Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy") > > Signed-off-by: Ferruh Yigit > --- > Cc: Jianfeng Tan > Cc: Santosh Shukla > Cc: Thomas Monjalon > --- > config/common_base | 5 +++++ > lib/librte_eal/bsdapp/eal/eal.c | 4 ++++ > lib/librte_eal/linuxapp/eal/eal.c | 4 ++++ > 3 files changed, 13 insertions(+) > > diff --git a/config/common_base b/config/common_base > index 82ee75456..903e7685b 100644 > --- a/config/common_base > +++ b/config/common_base > @@ -107,6 +107,11 @@ CONFIG_RTE_MALLOC_DEBUG=n > CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n > > # > +# Disabling PHYS_IOVA may crash kernel for KNI, use with caution > +# > +CONFIG_RTE_EAL_USE_PHYS_IOVA=y Defeat the purpose of all dynamic probing scheme. Either we can fix the KNI or revert the following patch for this release. http://dpdk.org/commit/f37dfab2