From mboxrd@z Thu Jan 1 00:00:00 1970 From: Panu Matilainen Subject: [PATCH 2/5] eal: refactor plugin init from eal_parse_args() to a helper function Date: Fri, 16 Oct 2015 14:58:14 +0300 Message-ID: References: To: dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 46E4B8DA1 for ; Fri, 16 Oct 2015 13:58:28 +0200 (CEST) In-Reply-To: In-Reply-To: References: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Panu Matilainen --- lib/librte_eal/linuxapp/eal/eal.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index cc66d9f..d8a53e4 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -548,6 +548,19 @@ eal_plugin_add(const char *path) return 0; } +static void +eal_plugins_init(void) +{ + struct shared_driver *solib = NULL; + + TAILQ_FOREACH(solib, &solib_list, next) { + RTE_LOG(DEBUG, EAL, "open shared lib %s\n", solib->name); + solib->lib_handle = dlopen(solib->name, RTLD_NOW); + if (solib->lib_handle == NULL) + RTE_LOG(WARNING, EAL, "%s\n", dlerror()); + } +} + /* Parse the argument given in the command line of the application */ static int eal_parse_args(int argc, char **argv) @@ -741,7 +754,6 @@ rte_eal_init(int argc, char **argv) int i, fctret, ret; pthread_t thread_id; static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0); - struct shared_driver *solib = NULL; const char *logid; char cpuset[RTE_CPU_AFFINITY_STR_LEN]; @@ -837,12 +849,7 @@ rte_eal_init(int argc, char **argv) rte_eal_mcfg_complete(); - TAILQ_FOREACH(solib, &solib_list, next) { - RTE_LOG(DEBUG, EAL, "open shared lib %s\n", solib->name); - solib->lib_handle = dlopen(solib->name, RTLD_NOW); - if (solib->lib_handle == NULL) - RTE_LOG(WARNING, EAL, "%s\n", dlerror()); - } + eal_plugins_init(); eal_thread_init_master(rte_config.master_lcore); -- 2.4.3