lib: set version 1.2.3r2 and more helper macros
PATCH 1/1 lib: set version 1.2.3r2 and more helper macros
Applications can test versions, for compatibility, this way:
#if RTE_VERSION >= RTE_VERSION_NUM(1,2,3,4) Previous versions can be tested with: #ifndef RTE_VERSION_NUM
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 will be 1.2.3r2.
--- lib/librte_eal/common/include/rte_eal.h | 1 - lib/librte_eal/common/include/rte_version.h | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-)
lib/librte_eal/common/include/rte_eal.h +0 -1
@@ -50,7 +50,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. */ /**
lib/librte_eal/common/include/rte_version.h +15 -2
@@ -63,10 +63,22 @@ extern "C" {*/ #define RTE_VER_PATCH_LEVEL 3 +/** +* Patch release number i.e. the w in x.y.zrw +*/ +#define RTE_VER_PATCH_RELEASE 2 + +#define RTE_VERSION_NUM (a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d)) +#define RTE_VERSION RTE_VERSION_NUM( \ + RTE_VER_MAJOR, \ + RTE_VER_MINOR, \ + RTE_VER_PATCH_LEVEL, \ + RTE_VER_PATCH_RELEASE) +#define RTE_VER_PREFIX "RTE"/** -* Function returning string of version number: "RTE x.y.z" +* Function returning string of version number: "RTE x.y.zrw" * @return * string */
@@ -75,7 +87,8 @@ 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 ); }#ifdef __cplusplus
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1367940644-13357-1-git-send-email-thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
Hi Thomas,
lib/librte_eal/common/include/rte_version.h rte_version(void) { · line 94
Quoted 10 lines
lib/librte_eal/common/include/rte_version.h +2
-1@@ -75,7 +87,8 @@ 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 ); }#ifdef __cplusplus
In this patch, do you think it could be useful to add a #ifdef RTE_VER_PATCH_RELEASE ? The idea is to return "1.2.3" if there is no patch release and "1.2.3r4" in the dpdk.org case. As a result this patch would be integrable in Intel DPDK mainline.
The other lines of the patch look good to me.
Olivier
A message that is not in the archive (sent off-list or not yet received): [email protected]
17/05/2013 11:12, Olivier MATZ :
Quoted 11 lines
Quoted 11 lines
lib/librte_eal/common/include/rte_version.h +2
-1@@ -75,7 +87,8 @@ 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 );
Quoted 7 lines
Quoted 1 line
}
In this patch, do you think it could be useful to add a #ifdef
RTE_VER_PATCH_RELEASE? The idea is to return "1.2.3" if there is no patch release and "1.2.3r4" in the dpdk.org case. As a result this patch would be integrable in Intel DPDK mainline.
This patch introduce RTE_VER_PATCH_RELEASE so #ifdef RTE_VER_PATCH_RELEASE is always true. I don't see why a commercial version of the DPDK would like to apply part of this patch.
Signature · 1 line
Thomas
A message that is not in the archive (sent off-list or not yet received): 201305171646.00572.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
Hi Thomas,
Quoted 3 lines
This patch introduce
RTE_VER_PATCH_RELEASEso #ifdefRTE_VER_PATCH_RELEASEis always true. I don't see why a commercial version of the DPDK would like to apply part of this patch.
ok this was just a comment in case of.