From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by dpdk.org (Postfix) with ESMTP id 453241B53 for ; Mon, 28 Aug 2017 20:13:36 +0200 (CEST) Received: by mail-pg0-f50.google.com with SMTP id r133so3605707pgr.3 for ; Mon, 28 Aug 2017 11:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9a2c+wK/7jeyXEKIXg2UnfeSJuAoqmzq8cnuLP6tF8w=; b=DSTfGVw+Sc/OiRfaY8rJv+qoE45bkXbp5fmrStI4R69vaeqGTgkXqYEgbxSTXhCscU 0968TbWZz2qFatxJDslzhXODNVptJdq+Za+17GbR+FLQv+UYVu8tQjuXfCxecTCalJiu P0B0uao6+RBBSD2BunVNk4qWInwxNO/sOEYGc85Rh5zqqxpvp1tNpLuLE1ypzWxCS9vL 3IGznKgt2d7qiq3PRnJ7YUWNtnEv9tDs1NphPeoa3377OLeC3//neBr6kezzka8N1zNy BNv++OVwJNoU2rExtXR1Ua5nCBGlOeMPCOo72oPU5b9P+lh21SwP4eTmesOgJj+S6chF +7Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9a2c+wK/7jeyXEKIXg2UnfeSJuAoqmzq8cnuLP6tF8w=; b=bPyzVaeHktTkW7cEEG1IUugmuVcVQtCYMdZRhkDzHUqXjjGfsDw5eMRY8uaCgQsY82 1EVM+k5WDJWcndWaNumNiYpNuM/flbNoD+uAMcGdWX0elHe1i3Qmcj0EqVPIGiTWaYRJ k8NCBAPYm7JZRl0GoMLxRTVxAAJpOYJGVKpVccAcjvFO+Jl/BvXjhliAOWikSwVBXDyS juyEg9bW7qmAJVOu9sAq8R3i9JNjGsoBlx9Ebu7gsx/Ru6soApHHJDKN2BdXTpjDtXDw dq73uXxGTdLmT6mX71HfM6K/4dlke+8ZUYZUvsgZmH8MAYwMOFBnexAaP2FttMaI2JpC UuRQ== X-Gm-Message-State: AHYfb5h69GO2Y8Gn/tu5rPsvagnrWO7deAH4BOzs2zIGC3tMJ9rFoPFs 45dcCVcTjUX7LP9hmQ+v7A== X-Received: by 10.84.215.217 with SMTP id g25mr1810316plj.45.1503944015211; Mon, 28 Aug 2017 11:13:35 -0700 (PDT) Received: from xeon-e3.lan (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id p5sm78971pgn.91.2017.08.28.11.13.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 11:13:34 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Stephen Hemminger Date: Mon, 28 Aug 2017 11:13:31 -0700 Message-Id: <20170828181331.16112-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170828175703.5746-1-stephen@networkplumber.org> References: <20170828175703.5746-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v2] rte: initialize logging before bus X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2017 18:13:36 -0000 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 --- 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