From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 2F8C51B199 for ; Wed, 11 Oct 2017 13:27:45 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 11 Oct 2017 04:27:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,361,1503385200"; d="scan'208";a="1024043709" Received: from aburakov-mobl2.ger.corp.intel.com (HELO [10.237.210.18]) ([10.237.210.18]) by orsmga003.jf.intel.com with ESMTP; 11 Oct 2017 04:27:43 -0700 To: Jianfeng Tan , dev@dpdk.org Cc: santosh.shukla@caviumnetworks.com, sergio.gonzalez.monroy@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com References: <1507718028-12943-1-git-send-email-jianfeng.tan@intel.com> <1507718028-12943-2-git-send-email-jianfeng.tan@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Wed, 11 Oct 2017 12:27:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1507718028-12943-2-git-send-email-jianfeng.tan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed 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, 11 Oct 2017 11:27:46 -0000 On 11-Oct-17 11: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; > mcfg->memseg[0].addr = addr; > mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K; > mcfg->memseg[0].len = internal_config.memory; > Acked-by: Anatoly Burakov -- Thanks, Anatoly