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 844981B22F for ; Wed, 1 Nov 2017 02:10:30 +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; 31 Oct 2017 18:10:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,326,1505804400"; d="scan'208";a="916049336" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.241.225.190]) ([10.241.225.190]) by FMSMGA003.fm.intel.com with ESMTP; 31 Oct 2017 18:10:24 -0700 From: Ferruh Yigit To: Jianfeng Tan , dev@dpdk.org Cc: santosh.shukla@caviumnetworks.com, sergio.gonzalez.monroy@intel.com, thomas@monjalon.net References: <1507718028-12943-1-git-send-email-jianfeng.tan@intel.com> <1507718028-12943-2-git-send-email-jianfeng.tan@intel.com> Message-ID: <0210f78e-1a3a-aac0-0e85-aecd91d40a9c@intel.com> Date: Tue, 31 Oct 2017 18:10:24 -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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] eal: honor IOVA mode for no-huge case 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 01:10:30 -0000 On 10/31/2017 3:37 PM, Ferruh Yigit wrote: > On 10/31/2017 2:49 PM, Ferruh Yigit wrote: >> On 10/11/2017 3:33 AM, Jianfeng Tan wrote: >>> With the introduction of IOVA mode, the only blocker to run >>> with 4KB pages for NICs binding to vfio-pci, is that >>> RTE_BAD_PHYS_ADDR is not a valid IOVA address. >>> >>> We can refine this by using VA as IOVA if it's IOVA mode. >>> >>> Signed-off-by: Jianfeng Tan >>> --- >>> lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++- >>> 1 file changed, 4 insertions(+), 1 deletion(-) >>> >>> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c >>> index 28bca49..187d338 100644 >>> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c >>> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c >>> @@ -1030,7 +1030,10 @@ rte_eal_hugepage_init(void) >>> strerror(errno)); >>> return -1; >>> } >>> - mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR; >>> + if (rte_eal_iova_mode() == RTE_IOVA_VA) >>> + mcfg->memseg[0].phys_addr = (uintptr_t)addr; >>> + else >>> + mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR; >> >> This breaks KNI which requires physical address. > > My bad, this patch is for no_hugetlbfs case. > > Issue seen starting from next patch in the set [1], which enables IOVA mode for > Intel PMDs. > > With IOVA mode enabled, KNI fails. > > Does it make sense to add an API to set iova mode explicitly by application? > Application can set iova to PA and allocate memzones it requires. Added config option to disable IOVA mode detection: http://dpdk.org/dev/patchwork/patch/31071/ Still concerned if this may hit someone, since the result for KNI is a kernel crash it would be nice to have more solid protection here. And suggestion welcome. Thanks, ferruh > > [1] > http://dpdk.org/commit/f37dfab2 > >> >> Any idea how to disable RTE_IOVA_VA when KNI used? >> >>> mcfg->memseg[0].addr = addr; >>> mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K; >>> mcfg->memseg[0].len = internal_config.memory; >>> >> >