From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id F0A481B2F5 for ; Wed, 1 Nov 2017 19:11:56 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2017 11:11:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,330,1505804400"; d="scan'208";a="916336451" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.254.27.219]) ([10.254.27.219]) by FMSMGA003.fm.intel.com with ESMTP; 01 Nov 2017 11:11:54 -0700 To: Thomas Monjalon , Santosh Shukla , jerin.jacob@caviumnetworks.com Cc: Bruce Richardson , Sergio Gonzalez Monroy , dev@dpdk.org, Jianfeng Tan References: <20171101010726.17781-1-ferruh.yigit@intel.com> <79461063.5rUd41U7jB@xps> From: Ferruh Yigit Message-ID: Date: Wed, 1 Nov 2017 11:11:53 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <79461063.5rUd41U7jB@xps> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2017 18:11:57 -0000 On 11/1/2017 3:31 AM, 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. It was to have old behavior by default without doing anything special, so that previous KNI applications can continue to run as it is. > We can improve the autodetect by checking whether rte_kni.ko is loaded. > > Opinions? >