From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 93818C0C1B02; Fri, 16 Oct 2015 11:58:27 +0000 (UTC) Received: from dhcp195.koti.laiskiainen.org.com (vpn1-6-41.ams2.redhat.com [10.36.6.41]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9GBwMXM015206; Fri, 16 Oct 2015 07:58:26 -0400 From: Panu Matilainen To: dev@dpdk.org Date: Fri, 16 Oct 2015 14:58:14 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Subject: [dpdk-dev] [PATCH 2/5] eal: refactor plugin init from eal_parse_args() to a helper function 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, 16 Oct 2015 11:58:28 -0000 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