From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] eal: disable IOVA mode detection by default Date: Wed, 1 Nov 2017 11:22:55 -0700 Message-ID: References: <20171101010726.17781-1-ferruh.yigit@intel.com> <79461063.5rUd41U7jB@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Bruce Richardson , Sergio Gonzalez Monroy , dev@dpdk.org, Jianfeng Tan To: santosh , Thomas Monjalon , jerin.jacob@caviumnetworks.com Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 899511B2F5 for ; Wed, 1 Nov 2017 19:22:57 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/1/2017 4:06 AM, santosh wrote: > > On Wednesday 01 November 2017 04:01 PM, Thomas Monjalon wrote: >> 01/11/2017 02:07, Ferruh Yigit: >>> Fix kernel crash with KNI because KNI requires physical addresses. >>> >>> 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 >>> --- >>> +#ifdef RTE_EAL_USE_PHYS_IOVA >>> + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; >>> +#else >>> /* autodetect the iova mapping mode (default is iova_pa) */ >>> rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); >>> +#endif >> I don't understand why you are adding a compile-time option. >> I think it should be an EAL option --use-phys-addr. >> The opposite option may be required to force VA: --use-virt-addr. >> And if there is no option given, we fallback to autodetect. >> We can improve the autodetect by checking whether rte_kni.ko is loaded. > > IMO, we could introduce a rule for kni in iova autodetection(/for linux case) > such away that: > > if cat /proc/modules has rte_kni entry > then use default iova=pa mode. This sounds good as a workaround for this release [1]. For long term I believe KNI should be updated to work with virtual addresses. [1] This won't work if both IOVA VA mode only device and KNI used together. But I assume this is not common use case. > > so +1 to your proposition Thomas. > >> Opinions? >