From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gaetan.rivet@6wind.com>
Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com
 [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id BFC241B3FE
 for <dev@dpdk.org>; Sun, 15 Apr 2018 17:08:14 +0200 (CEST)
Received: by mail-wr0-f193.google.com with SMTP id w3so2668452wrg.2
 for <dev@dpdk.org>; Sun, 15 Apr 2018 08:08:14 -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=AvYrzoRcMZHfvRG1lNtXbYNg5lPA+k5iDJDOcEmN02w=;
 b=aiG+W6SvbXcC9yadVNg9hd+t9kR3bsWDoZWdRbztswkpyHbK3b3idCjsRCbK2mSUMl
 iEqru1TrI6a+yJTrKSH6MnUO21G1zlry8q22WVXvfyomDtAqKVTOERJHYHk7go0183H1
 QlbQizWH/vQ6JKXgaxzr/n1yxG9iDW5BhDlUYx96OQE3kA/QhMZgHNJJHUE1KBr+3Fx4
 28HFbReqOoImLqugcpJGolI1amWjZW6VNIHEedjb5P81YuXOHQE4Tw6YBoWcxzB5VIgh
 TVOoCCNs7SllPPjgg1cl01jhNRJ/A9JvJJ5HZ+VLXXxarWKOKSv3QBYED7URr5AbXJZO
 f1ug==
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=AvYrzoRcMZHfvRG1lNtXbYNg5lPA+k5iDJDOcEmN02w=;
 b=bGM5AhjK4KTx8B2KbP9qCWNBWXOusQi4L1LNDd0t3/IPxUIsmW6uRSvg8q6iwZQlf0
 5i5gublQFHRjrP9DXVvUOaDlp/c1W2cOJFHoUZF6lwjxuQvS0HRWfjFrxK2Ziabv+oLf
 NdrvpERDVK4i5bFArzMIlJ/ulsDXpKED6uV+gfmXeCiOdnQesnPW3ddXUwO4LhQxNeeR
 4boM/c5HBswD9GlhhdeF/BrOr/f+FUf66BHO6bH3XQm3/UcvILcxWCfbHTDYA1b5wJbs
 Kn9/lnPv1iRSii441h3UF93g7dbhZM+JsK1fUhyN+7ahEy6bqp8IVjajV/xZpHULMLG0
 Ql6w==
X-Gm-Message-State: ALQs6tAGapEIVYEdnnOcSVxVZBnk4FP6FjbQ70A+bQobCsLCETc34PAi
 Q3TLQK4CbeMzTOOAmkNM5H//jwY2
X-Google-Smtp-Source: AIpwx4/EdUVOXcsWGxXw/deZzRTPB7cAq7aSiyzQ/FMOzrC0lqKmVchiueQ0jm6HEkl1yuW70G4eOg==
X-Received: by 10.28.156.2 with SMTP id f2mr8033081wme.64.1523804894080;
 Sun, 15 Apr 2018 08:08:14 -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 r200sm13673438wmb.39.2018.04.15.08.08.12
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 15 Apr 2018 08:08:13 -0700 (PDT)
From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
Date: Sun, 15 Apr 2018 17:07:32 +0200
Message-Id: <bd41015e96aadec3cb5d5e7b4a357a6089403861.1523804657.git.gaetan.rivet@6wind.com>
X-Mailer: git-send-email 2.11.0
In-Reply-To: <cover.1523804657.git.gaetan.rivet@6wind.com>
References: <cover.1521124599.git.gaetan.rivet@6wind.com>
 <cover.1523804657.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1523804657.git.gaetan.rivet@6wind.com>
References: <cover.1523804657.git.gaetan.rivet@6wind.com>
Subject: [dpdk-dev] [PATCH v7 03/22] eal: add last init priority
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Apr 2018 15:08:15 -0000

Add the priority RTE_PRIORITY_LAST, used for initialization routines
meant to be run after all other constructors.

This priority becomes the default priority for all DPDK constructors.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/include/rte_common.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 8f04518f7..69e5ed1e3 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -83,22 +83,12 @@ typedef uint16_t unaligned_uint16_t;
 
 #define RTE_PRIORITY_LOG 101
 #define RTE_PRIORITY_BUS 110
+#define RTE_PRIORITY_LAST 65535
 
 #define RTE_PRIO(prio) \
 	RTE_PRIORITY_ ## prio
 
 /**
- * Run function before main() with low priority.
- *
- * The constructor will be run after prioritized constructors.
- *
- * @param func
- *   Constructor function.
- */
-#define RTE_INIT(func) \
-static void __attribute__((constructor, used)) func(void)
-
-/**
  * Run function before main() with high priority.
  *
  * @param func
@@ -111,6 +101,17 @@ static void __attribute__((constructor, used)) func(void)
 static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void)
 
 /**
+ * Run function before main() with low priority.
+ *
+ * The constructor will be run after prioritized constructors.
+ *
+ * @param func
+ *   Constructor function.
+ */
+#define RTE_INIT(func) \
+	RTE_INIT_PRIO(func, LAST)
+
+/**
  * Force a function to be inlined
  */
 #define __rte_always_inline inline __attribute__((always_inline))
-- 
2.11.0