From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
Subject: [dpdk-dev] [PATCH v1 2/2] eal: add last init priority
Date: Tue, 24 Apr 2018 13:28:53 +0200 [thread overview]
Message-ID: <b5af4fc8a3502b080925472d8028e006cdeb43f7.1524569193.git.gaetan.rivet@6wind.com> (raw)
In-Reply-To: <cover.1524569193.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1524569193.git.gaetan.rivet@6wind.com>
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
next prev parent reply other threads:[~2018-04-24 11:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 11:28 [dpdk-dev] [PATCH v1 0/2] Global Priorities Gaetan Rivet
2018-04-24 11:28 ` [dpdk-dev] [PATCH v1 1/2] eal: list acceptable init priorities Gaetan Rivet
2018-04-24 11:28 ` Gaetan Rivet [this message]
2018-04-24 11:41 ` [dpdk-dev] [PATCH v1 2/2] eal: add last init priority Shreyansh Jain
2018-04-25 2:10 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b5af4fc8a3502b080925472d8028e006cdeb43f7.1524569193.git.gaetan.rivet@6wind.com \
--to=gaetan.rivet@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).