DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] rte: initialize logging before bus
@ 2017-08-28 17:57 Stephen Hemminger
  2017-08-28 18:13 ` [dpdk-dev] [PATCH v2] " Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2017-08-28 17:57 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Stephen Hemminger

Any log messages during bus initialization maybeZZ lost because
the bus registration constructor is called befor the logging constructor.

Fixes: a97725791eec ("bus: introduce bus abstraction")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
Patch against current but also should be applied to stable.

 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-03  9:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 17:57 [dpdk-dev] [PATCH] rte: initialize logging before bus Stephen Hemminger
2017-08-28 18:13 ` [dpdk-dev] [PATCH v2] " Stephen Hemminger
2017-10-03  9:32   ` Thomas Monjalon

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).