From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 34B112A7 for ; Wed, 10 Jul 2013 15:16:08 +0200 (CEST) Received: by mail-wg0-f42.google.com with SMTP id z11so10921859wgg.1 for ; Wed, 10 Jul 2013 06:16:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=T2iGrEUV7rL2+c59NGi+Lzx0AxtIfQ5t5NJqTPCPEFA=; b=aM7FYl7qSrLSp8ClMNf9z4UVZ0f4B3SmZugBJRJoMrOW232SRmrhfSwqGx/sQYmoOi jn7POta8N/+5koXkR9u4dXj4wlruCgRJ9TzraXMro99YI7r/6jhWyQOG1Jm3ZVKe+Gmi KgkjJMtAdevx7VzlJHw3xNQ77NFdkRvyasbSpBE6WKMDsjVQeacHNxztlhi+wcoM7tqy XXpBlnyPDHbGr3xmbjfgTC01tZh3BETvzwOahH7SrfdNM/aA2QeveaQW4kMg3Fzhcewo DzQ965qP60RePhwgLWbxuXsgIPD8U2anlKt6WvS4QcHKMIcPhKQuR3aaq3TojQLvH3Xd Tu3A== X-Received: by 10.194.119.195 with SMTP id kw3mr17789943wjb.64.1373462186265; Wed, 10 Jul 2013 06:16:26 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id b20sm36018102wiw.4.2013.07.10.06.16.23 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 10 Jul 2013 06:16:25 -0700 (PDT) From: Damien Millescamps To: dev@dpdk.org Date: Wed, 10 Jul 2013 15:14:53 +0200 Message-Id: <3acd665fb53a7624607fc863fa400b448e2bd590.1373462050.git.damien.millescamps@6wind.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQln2MUYHeY6y543eqIhVuIKm97vsOK56rV/L+cpuB7meDK+ibBLAF86EHKyQCTKHfVdvyX2 Subject: [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads 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: Wed, 10 Jul 2013 13:16:08 -0000 We want the threads to inherit any property that could be set while loading a plugin, such as iopl(). Signed-off-by: Damien Millescamps --- lib/librte_eal/linuxapp/eal/eal.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 8ef5671..8cb3f69 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -687,6 +687,18 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_init() < 0) rte_panic("Cannot init PCI\n"); + TAILQ_FOREACH(solib, &solib_list, next) { + solib->lib_handle = dlopen(solib->name, RTLD_NOW); + if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) { + /* relative path: try again with "./" prefix */ + char sopath[PATH_MAX]; + snprintf(sopath, sizeof(sopath), "./%s", solib->name); + solib->lib_handle = dlopen(sopath, RTLD_NOW); + } + if (solib->lib_handle == NULL) + RTE_LOG(WARNING, EAL, "%s\n", dlerror()); + } + RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n", rte_config.master_lcore, (int)thread_id); @@ -712,18 +724,6 @@ rte_eal_init(int argc, char **argv) eal_thread_init_master(rte_config.master_lcore); - TAILQ_FOREACH(solib, &solib_list, next) { - solib->lib_handle = dlopen(solib->name, RTLD_NOW); - if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) { - /* relative path: try again with "./" prefix */ - char sopath[PATH_MAX]; - snprintf(sopath, sizeof(sopath), "./%s", solib->name); - solib->lib_handle = dlopen(sopath, RTLD_NOW); - } - if (solib->lib_handle == NULL) - RTE_LOG(WARNING, EAL, "%s\n", dlerror()); - } - return fctret; } -- 1.7.2.5