From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 5D9305F38 for ; Thu, 29 Mar 2018 23:24:17 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id f125so13884190wme.4 for ; Thu, 29 Mar 2018 14:24:17 -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=8Jw/SG3Lv7IEOC6fS2HstX+rZRN5QEITaAVdNT4mRYs=; b=Ecmy781fHJ7E/7xKMa2OPYMzsMTb3BXWDf+Liy4ZBfUXeDtJ59Jj2mJcmKktIx0dbj zR2KHEvwyrnlWRs6KAV3Br9IZ9rXfO2UazEs/Ue6ytzN6FVDZyBQws43xuSN/Q3+ylIK 8VhtjW4K8n00x8pZhZvz86JNGi5c2XWfTg9y6cfnfDP9CW1lPdhV75YzA71+n1ColUzt +TxhHnWj11D7nYvPGFBNhrcDrNtpLl15q+M6rMqRacbACXbTEFKSiDfE4ZRvgs9BX97f GM0mcFDoCTpIpmFBJCczph3JvcrmOFcaXGbD6PlvEOjDjERa5XA/IUPefj8RMKovhNWJ 3azA== 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=8Jw/SG3Lv7IEOC6fS2HstX+rZRN5QEITaAVdNT4mRYs=; b=CRz74bxJ2jISKQAKUwkGibLhhJznRTG1m65Wxis9DfCRXWjjaCSeJiGJmdhEOtTwYb rjZcdlPJzLxVqb8RJkv+ZNNeT4B/xKJGy3zJ62Za3ijUv92YozNoFerPZxhN3WNXmfJ7 1QYps6T4Te8G907bjoDJ9vCIWPasBf9bHebu+5Xr0H8lblo6xB1PWy5wFbcjFiab7Zue i00Bq4HdHnDBkBy/HL+Oh6EFfGcVEIpdYvaZwyzCRT5cTC1WaO5apVkL1RgJvyLKFRRt GIEmDW4U+8lJDQumJXKkcN0yrKO2n59rlf4zCCyIQ//5ZRPC8Ln2EuKFLd/zMfFzpAXO y+WA== X-Gm-Message-State: AElRT7EDUSGYeULcubnKu0XCto5aAsmaC6pXanXUa94kSCJmco5mxDdE W9lszyvlVckd03zS87UXQ/dj+yYe X-Google-Smtp-Source: AIpwx4/dGLEW2PeY2yEt1uRmz7r1xBtTsZLVvqSGUtgihpG6HGTMGtw+MflU+IW9r313ogIiugbtOQ== X-Received: by 10.28.14.9 with SMTP id 9mr371055wmo.127.1522358656110; Thu, 29 Mar 2018 14:24:16 -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 m35sm11907457wrm.59.2018.03.29.14.24.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 14:24:14 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 29 Mar 2018 23:23:26 +0200 Message-Id: <01d04317b2a0fda4cd2a39dde18e146922df61e2.1522358421.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 v4 02/20] 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: Thu, 29 Mar 2018 21:24:17 -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 37b2e20e5..b384c72d3 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -224,7 +224,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 c7803e41c..99a799d6d 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