From mboxrd@z Thu Jan 1 00:00:00 1970 From: Santosh Shukla Subject: [PATCH 06/10] bsdapp/eal: detect iova mapping mode Date: Thu, 8 Jun 2017 16:35:09 +0530 Message-ID: <20170608110513.22548-7-santosh.shukla@caviumnetworks.com> References: <20170608110513.22548-1-santosh.shukla@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, gaetan.rivet@6wind.com, Santosh Shukla To: thomas@monjalon.net, bruce.richardson@intel.com, dev@dpdk.org Return-path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0079.outbound.protection.outlook.com [104.47.38.79]) by dpdk.org (Postfix) with ESMTP id 9C6B43790 for ; Thu, 8 Jun 2017 13:06:24 +0200 (CEST) In-Reply-To: <20170608110513.22548-1-santosh.shukla@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" - Moving late bus scanning to up..just after eal_parsing. - Mapping mode would be default for bsdapp. It supports only one pass through mode (RTE_KDRV_NIC_UIO) Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob --- lib/librte_eal/bsdapp/eal/eal.c | 24 ++++++++++++++++++------ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 05f0c1f90..d9c6617bf 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -113,6 +113,13 @@ struct internal_config internal_config; /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; +/* Get the iova mode */ +enum rte_iova_mode +rte_eal_iova_mode(void) +{ + return internal_config.iova_mode; +} + /* Return a pointer to the configuration structure */ struct rte_config * rte_eal_get_configuration(void) @@ -536,6 +543,17 @@ rte_eal_init(int argc, char **argv) return -1; } + if (rte_bus_scan()) { + rte_eal_init_alert("Cannot scan the buses for devices\n"); + rte_errno = ENODEV; + return -1; + } + + if (rte_eal_iova_mode() == RTE_IOVA_VA && + rte_bus_get_iommu_class() == RTE_IOVA_VA) { + internal_config.iova_mode = RTE_IOVA_VA; + } + if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY && eal_hugepage_info_init() < 0) { @@ -615,12 +633,6 @@ rte_eal_init(int argc, char **argv) rte_config.master_lcore, thread_id, cpuset, ret == 0 ? "" : "..."); - if (rte_bus_scan()) { - rte_eal_init_alert("Cannot scan the buses for devices\n"); - rte_errno = ENODEV; - return -1; - } - RTE_LCORE_FOREACH_SLAVE(i) { /* diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 0beadacfb..6900626fe 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -199,5 +199,6 @@ DPDK_17.08 { rte_pci_get_iommu_class; rte_bus_get_iommu_class; + rte_eal_iova_mode; } DPDK_17.05; -- 2.11.0