From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Stephen Hemminger <sthemmin@microsoft.com>
Subject: [dpdk-dev] [PATCH v2] rte: initialize logging before bus
Date: Mon, 28 Aug 2017 11:13:31 -0700 [thread overview]
Message-ID: <20170828181331.16112-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20170828175703.5746-1-stephen@networkplumber.org>
Any log messages during bus initialization maybe lost because
the bus registration constructor is called before the logging constructor.
Fixes: a97725791eec ("bus: introduce bus abstraction")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
v2 - fix commit message typos
lib/librte_eal/common/eal_common_log.c | 3 ++-
lib/librte_eal/common/include/rte_bus.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 0e3b9320954f..b62b0a6d61c8 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -289,7 +289,8 @@ static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_USER8, "user8"}
};
-RTE_INIT(rte_log_init);
+/* Logging should be first initialzer (before drivers and bus) */
+RTE_INIT_PRIO(rte_log_init, 101);
static void
rte_log_init(void)
{
diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h
index c79368d3c882..8f8b09954abc 100644
--- a/lib/librte_eal/common/include/rte_bus.h
+++ b/lib/librte_eal/common/include/rte_bus.h
@@ -285,7 +285,7 @@ struct rte_bus *rte_bus_find_by_name(const char *busname);
* The constructor has higher priority than PMD constructors.
*/
#define RTE_REGISTER_BUS(nm, bus) \
-RTE_INIT_PRIO(businitfn_ ##nm, 101); \
+RTE_INIT_PRIO(businitfn_ ##nm, 110); \
static void businitfn_ ##nm(void) \
{\
(bus).name = RTE_STR(nm);\
--
2.11.0
next prev parent reply other threads:[~2017-08-28 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 17:57 [dpdk-dev] [PATCH] " Stephen Hemminger
2017-08-28 18:13 ` Stephen Hemminger [this message]
2017-10-03 9:32 ` [dpdk-dev] [PATCH v2] " 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=20170828181331.16112-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=sthemmin@microsoft.com \
/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).