From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id F2E661B21B for ; Wed, 1 Nov 2017 11:31:17 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6B63F20AF7; Wed, 1 Nov 2017 06:31:17 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 01 Nov 2017 06:31:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=m/Kou+nNYjBRR25mKg0oMOtiUs HzrB1yaQLYCBu9xsk=; b=fOVbmPoMQzE1rZT+q9X/xWyKV770MBK/1AGM6cmZ+R aS0vqL0dz34fxREa1C+tLFgbPNtD1GmEo20Hbklyi4ex5bKwakNhCNxwC0duRM2m plUIZ/LeTjGBUwIFRteDmqf/+hl5KOoJbu/DWBAGt1nV0G4ScTxikyE0rXiXTScF o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=m/Kou+ nNYjBRR25mKg0oMOtiUsHzrB1yaQLYCBu9xsk=; b=cEnxFHCCymQpBs/91oR3zp 3/ATLFQrc44yvw3MmalT52T+IHWNT07rFOcnK6PP1/TaGQwscFCK4wCqlZYw5CtT a1/FBwBm1/9PB9bY8Vrx1Hm1PsbgSjQwh1Q5qEi8ifR6eGYTuL4vvlMh0DrmQF+n cE6p0vHvS9gZ9Ze0hTCR255/ssHebl3NLmQt0mtQMsm+C/zdJh5KDnLktl3fMaFn JtiaBv53V+7JeI5xgFzX/TraNJFojqxSOr51ddUofbLMmoadxgavIY+pGu2JfFFE POLEp6/luFbFkSlUg3VLzjfUTc8AFH3r4XMDSp57w1N3HLzzm4kAuNzXPYntA6vA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 314847F96B; Wed, 1 Nov 2017 06:31:17 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit , Santosh Shukla , jerin.jacob@caviumnetworks.com Cc: Bruce Richardson , Sergio Gonzalez Monroy , dev@dpdk.org, Jianfeng Tan Date: Wed, 01 Nov 2017 11:31:16 +0100 Message-ID: <79461063.5rUd41U7jB@xps> In-Reply-To: <20171101010726.17781-1-ferruh.yigit@intel.com> References: <20171101010726.17781-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 10:31:18 -0000 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. Opinions?