From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id C42771B8A9 for ; Fri, 13 Apr 2018 15:23:00 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id y7so8268998wrh.10 for ; Fri, 13 Apr 2018 06:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=2xCwL7hBcveMFexebCeC56/mZlcIWIEEjoKHQ1LdqNM=; b=QVCCCeCNrWJZM29OEbL64lDW5pfnpBpxoDapKggqjOubynCS/HYP3i3+sLb0CQzjtr h2SJPVBkGkFoRwndqYT9vibIr44+0vTqSF+jPEHQ3ZMoBaLg0KAqYzM15AJB4mPJO6X6 M3RXZ0lVfzuB3Y2m3AoLIgDyWC8EhLTw11d5Y7LMjzhyGMbwPA7PxCRS4OLFHrCJquhC gAPKYUJwmOxAba0a8JvmMzUGA6LFUqzEaql7rhRQhjDbkR53HCLbCiyGNFjWSB4xH2yZ Esnw/3/poMWK5YvDELZei1W5bpWu6736bsR5FHmJWcE2RhPwyySE8MWB1j3TYuaAD8Ft AwWw== 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:in-reply-to:references; bh=2xCwL7hBcveMFexebCeC56/mZlcIWIEEjoKHQ1LdqNM=; b=oK3w8InuDsZa/eEdpGpXyJ4AM0YfcI9tRqr6+MnHe7HZImVyHCVCFlFnUMbepHodPG AUxtK3c/DlwdEeT6EOXr//7ZkQ9pdcA1JDjVb3YMFpAWV3CILXeKdcZB0f1DbzKQ++6H +M7JmOKZAdQjamjMkQHBvoXvHihrvQbuIefTljl642x1DI/7pTtl/PQ5ieMvtbfqaKwl 6JcZeG33bc/VyHNq9ue60SfDCMgMtluAxbMfwm2eVxnIXgnwFLf4Uy0i7CZn94xCEXc9 D3oiJ166nC1uUzy0LVe+DlgekD/4wjRFPVsuwhK1U5+hidSXvPtWiT6VaLk4A+Bar6Th Gtrg== X-Gm-Message-State: ALQs6tDRw36E6ZcSS8nI1eEclxg5YkOIrJBy5Z+pGmQSahmGgobiZdbd xnU/PsvpnBtc2YwfdnXT4tJVb4Vx X-Google-Smtp-Source: AIpwx4/uTX7DkoggfNZhk0c2uCTCzkNcL5BTtfe2Yncz0HvvC6gK98BfXVUCyprlewEqg6KXNSWLiA== X-Received: by 10.223.200.138 with SMTP id k10mr3973532wrh.282.1523625779997; Fri, 13 Apr 2018 06:22:59 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r200sm2377244wmb.9.2018.04.13.06.22.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 06:22:58 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 13 Apr 2018 15:22:17 +0200 Message-Id: <878ee309af1cb80aa4ce6287bfbbbfecf68ddc82.1523625524.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v6 02/22] eal: list acceptable init priorities 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: Fri, 13 Apr 2018 13:23:01 -0000 Build a central list to quickly see each used priorities for constructors, allowing to verify that they are both above 100 and in the proper order. Signed-off-by: Gaetan Rivet Acked-by: Neil Horman Acked-by: Shreyansh Jain --- lib/librte_eal/common/eal_common_log.c | 2 +- lib/librte_eal/common/include/rte_bus.h | 2 +- lib/librte_eal/common/include/rte_common.h | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index a27192620..36b9d6e08 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -260,7 +260,7 @@ static const struct logtype logtype_strings[] = { }; /* Logging should be first initializer (before drivers and bus) */ -RTE_INIT_PRIO(rte_log_init, 101); +RTE_INIT_PRIO(rte_log_init, LOG); 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 6fb08341a..eb9eded4e 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -325,7 +325,7 @@ enum rte_iova_mode rte_bus_get_iommu_class(void); * The constructor has higher priority than PMD constructors. */ #define RTE_REGISTER_BUS(nm, bus) \ -RTE_INIT_PRIO(businitfn_ ##nm, 110); \ +RTE_INIT_PRIO(businitfn_ ##nm, BUS); \ static void businitfn_ ##nm(void) \ {\ (bus).name = RTE_STR(nm);\ diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 6c5bc5a76..8f04518f7 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -81,6 +81,12 @@ typedef uint16_t unaligned_uint16_t; */ #define RTE_SET_USED(x) (void)(x) +#define RTE_PRIORITY_LOG 101 +#define RTE_PRIORITY_BUS 110 + +#define RTE_PRIO(prio) \ + RTE_PRIORITY_ ## prio + /** * Run function before main() with low priority. * @@ -102,7 +108,7 @@ static void __attribute__((constructor, used)) func(void) * Lowest number is the first to run. */ #define RTE_INIT_PRIO(func, prio) \ -static void __attribute__((constructor(prio), used)) func(void) +static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) /** * Force a function to be inlined -- 2.11.0