summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Monjalon <thomas.monjalon@6wind.com>2013-04-16 11:44:12 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-10-09 16:39:44 +0200
commit0740028fc123036abe839903011619d0bce12a9f (patch)
treea4150551f5e15d140ee4253d2f7d91bb45749b7f
parente4f0b29735cb11414e28dd6836c800c3742e48fc (diff)
downloaddpdk-0740028fc123036abe839903011619d0bce12a9f.zip
dpdk-0740028fc123036abe839903011619d0bce12a9f.tar.gz
dpdk-0740028fc123036abe839903011619d0bce12a9f.tar.xz
version: 1.5.0r1 and add helper macrosv1.5.0r1
Applications can test versions, for compatibility, this way: #if RTE_VERSION >= RTE_VERSION_NUM(1,2,3,4) RTE_VERSION was already defined for use with rte_config. It is moved in rte_version.h and updated to current version number. Note that the first tag having this helper is 1.2.3r2. Releases r0 have not this patch. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
-rw-r--r--lib/librte_eal/common/include/rte_eal.h1
-rw-r--r--lib/librte_eal/common/include/rte_version.h29
2 files changed, 25 insertions, 5 deletions
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index 31826cf..f3bbada 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -46,7 +46,6 @@
extern "C" {
#endif
-#define RTE_VERSION 1 /**< The version of the RTE configuration structure. */
#define RTE_MAGIC 19820526 /**< Magic number written by the main partition when ready. */
/**
diff --git a/lib/librte_eal/common/include/rte_version.h b/lib/librte_eal/common/include/rte_version.h
index 9326687..7f08262 100644
--- a/lib/librte_eal/common/include/rte_version.h
+++ b/lib/librte_eal/common/include/rte_version.h
@@ -67,13 +67,32 @@ extern "C" {
#define RTE_VER_PATCH_LEVEL 0
/**
+ * Patch release number i.e. the w in x.y.zrw
+ */
+#define RTE_VER_PATCH_RELEASE 1
+
+/**
+ * Macro to compute a version number usable for comparisons
+ */
+#define RTE_VERSION_NUM(a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
+
+/**
+ * All version numbers in one to compare with RTE_VERSION_NUM()
+ */
+#define RTE_VERSION RTE_VERSION_NUM( \
+ RTE_VER_MAJOR, \
+ RTE_VER_MINOR, \
+ RTE_VER_PATCH_LEVEL, \
+ RTE_VER_PATCH_RELEASE)
+
+/**
* Extra string to be appended to version number,
* for example: pre1, EAR, final etc.
*/
-#define RTE_VER_SUFFIX "pre-release"
+#define RTE_VER_SUFFIX ""
/**
- * Function returning string of version number: "RTE x.y.z"
+ * Function returning string of version number: "RTE x.y.zrw"
* @return
* string
*/
@@ -83,13 +102,15 @@ rte_version(void) {
return RTE_VER_PREFIX" "
RTE_STR(RTE_VER_MAJOR)"."
RTE_STR(RTE_VER_MINOR)"."
- RTE_STR(RTE_VER_PATCH_LEVEL)
+ RTE_STR(RTE_VER_PATCH_LEVEL)"r"
+ RTE_STR(RTE_VER_PATCH_RELEASE)
"-"RTE_VER_SUFFIX;
else
return RTE_VER_PREFIX" "
RTE_STR(RTE_VER_MAJOR)"."
RTE_STR(RTE_VER_MINOR)"."
- RTE_STR(RTE_VER_PATCH_LEVEL);
+ RTE_STR(RTE_VER_PATCH_LEVEL)"r"
+ RTE_STR(RTE_VER_PATCH_RELEASE);
}
#ifdef __cplusplus