From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so2.wedos.net (wes1-so2.wedos.net [46.28.106.16]) by dpdk.org (Postfix) with ESMTP id 7B5E35592 for ; Fri, 6 May 2016 15:50:09 +0200 (CEST) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so2.wedos.net (Postfix) with ESMTPSA id 3r1Y7P2BySz7Ch; Fri, 6 May 2016 15:50:09 +0200 (CEST) From: Jan Viktorin To: dev@dpdk.org Cc: Jan Viktorin , David Marchand , Thomas Monjalon , Bruce Richardson , Declan Doherty , jianbo.liu@linaro.org, jerin.jacob@caviumnetworks.com, Keith Wiles , Stephen Hemminger Date: Fri, 6 May 2016 15:47:52 +0200 Message-Id: <1462542490-15556-11-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1462542490-15556-1-git-send-email-viktorin@rehivetech.com> References: <1462542490-15556-1-git-send-email-viktorin@rehivetech.com> In-Reply-To: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> Subject: [dpdk-dev] [PATCH v1 10/28] eal/soc: init SoC infra from EAL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 13:50:09 -0000 Signed-off-by: Jan Viktorin --- lib/librte_eal/bsdapp/eal/eal.c | 4 ++++ lib/librte_eal/common/eal_private.h | 10 ++++++++++ lib/librte_eal/linuxapp/eal/eal.c | 3 +++ lib/librte_eal/linuxapp/eal/eal_soc.c | 17 +++++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 06bfd4e..23faebd 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -567,6 +568,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_init() < 0) rte_panic("Cannot init PCI\n"); + if (rte_eal_soc_init() < 0) + rte_panic("Cannot init SoC\n"); + eal_check_mem_on_local_socket(); if (eal_plugins_init() < 0) diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h index 5145215..b27ec89 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -187,6 +187,16 @@ int rte_eal_ivshmem_obj_init(void); struct rte_soc_driver; struct rte_soc_device; +/** + * Init the SoC infra. + * + * This function is private to EAL. + * + * @return + * 0 on success, negative on error + */ +int rte_eal_soc_init(void); + struct rte_pci_driver; struct rte_pci_device; diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index a9f3ae2..5f190ff 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -803,6 +803,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_init() < 0) rte_panic("Cannot init PCI\n"); + if (rte_eal_soc_init() < 0) + rte_panic("Cannot init SoC\n"); + #ifdef RTE_LIBRTE_IVSHMEM if (rte_eal_ivshmem_init() < 0) rte_panic("Cannot init IVSHMEM\n"); diff --git a/lib/librte_eal/linuxapp/eal/eal_soc.c b/lib/librte_eal/linuxapp/eal/eal_soc.c index 8dbb367..a3b9935 100644 --- a/lib/librte_eal/linuxapp/eal/eal_soc.c +++ b/lib/librte_eal/linuxapp/eal/eal_soc.c @@ -44,6 +44,7 @@ #include #include +#include "eal_internal_cfg.h" #include "eal_private.h" static char * @@ -280,3 +281,19 @@ error: closedir(dir); return -1; } + +/* Init the SoC EAL subsystem */ +int +rte_eal_soc_init(void) +{ + /* for debug purposes, SoC can be disabled */ + if (internal_config.no_soc) + return 0; + + if (rte_eal_soc_scan() < 0) { + RTE_LOG(ERR, EAL, "%s(): Cannot scan SoC devices\n", __func__); + return -1; + } + + return 0; +} -- 2.8.0