DPDK patches and discussions
 help / color / mirror / Atom feed
From: Damien Millescamps <damien.millescamps@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads
Date: Wed, 10 Jul 2013 15:14:53 +0200	[thread overview]
Message-ID: <3acd665fb53a7624607fc863fa400b448e2bd590.1373462050.git.damien.millescamps@6wind.com> (raw)
In-Reply-To: <cover.1373462050.git.damien.millescamps@6wind.com>
In-Reply-To: <cover.1373462050.git.damien.millescamps@6wind.com>

We want the threads to inherit any property that could be set while
loading a plugin, such as iopl().

Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
---
 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

  parent reply	other threads:[~2013-07-10 13:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 13:14 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Damien Millescamps
2013-07-10 13:14 ` [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device Damien Millescamps
2013-07-10 15:52   ` Thomas Monjalon
2013-07-10 13:14 ` Damien Millescamps [this message]
2013-07-10 15:52   ` [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3acd665fb53a7624607fc863fa400b448e2bd590.1373462050.git.damien.millescamps@6wind.com \
    --to=damien.millescamps@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).