From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9663D1B1A4 for ; Wed, 11 Oct 2017 12:32:22 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2017 03:32:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,360,1503385200"; d="scan'208";a="321946976" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by fmsmga004.fm.intel.com with ESMTP; 11 Oct 2017 03:32:20 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: santosh.shukla@caviumnetworks.com, sergio.gonzalez.monroy@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com, Jianfeng Tan Date: Wed, 11 Oct 2017 10:33:47 +0000 Message-Id: <1507718028-12943-2-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507718028-12943-1-git-send-email-jianfeng.tan@intel.com> References: <1507718028-12943-1-git-send-email-jianfeng.tan@intel.com> Subject: [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 10:32:23 -0000 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; -- 2.7.4