From: Dave Wallace Date: Fri, 4 Apr 2025 03:47:00 +0000 (-0400) Subject: vpp: add VPP_PLATFORM to show version output X-Git-Tag: v25.10-rc0~112 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=7d456cc57c7f1000679037f76f4f0431a51942f8;p=vpp.git vpp: add VPP_PLATFORM to show version output - when building with VPP_PLATFORM=octeon10, the show version output does not include the VPP_PLATFORM which is included in the debian package name. Adding this to the version helps clarify the platform/package name in CSIT trending graphs in addition to matching installed debian package name for packages with non-default VPP_PLATFORM. Type: fix Change-Id: Ieb582a1db576f5e676b97becfdce6ebdfdd3ae41 Signed-off-by: Dave Wallace --- diff --git a/src/plugins/dev_ena/ena.c b/src/plugins/dev_ena/ena.c index ed5c47ed505..a81a33d5f22 100644 --- a/src/plugins/dev_ena/ena.c +++ b/src/plugins/dev_ena/ena.c @@ -13,7 +13,6 @@ static ena_aq_host_info_t host_info = { .os_type = 3, /* DPDK */ - .kernel_ver_str = VPP_BUILD_VER, .os_dist_str = VPP_BUILD_VER, .driver_version = { .major = 16, @@ -171,6 +170,8 @@ ena_init (vlib_main_t *vm, vnet_dev_t *dev) *ed->host_info = host_info; ed->host_info->num_cpus = vlib_get_n_threads (); + strncpy ((char *) ed->host_info->kernel_ver_str, VPP_BUILD_VER, + sizeof (ed->host_info->kernel_ver_str) - 1); ena_set_mem_addr (vm, dev, &host_attr.os_info_ba, ed->host_info); if ((rv = ena_aq_set_feature (vm, dev, ENA_ADMIN_FEAT_ID_HOST_ATTR_CONFIG, diff --git a/src/scripts/generate_version_h b/src/scripts/generate_version_h index e8379550186..42359b7aa9c 100755 --- a/src/scripts/generate_version_h +++ b/src/scripts/generate_version_h @@ -2,6 +2,11 @@ : ${VPP_BUILD_USER:=$(whoami)} : ${VPP_BUILD_HOST:=$(hostname)} : ${VPP_BUILD_TOPDIR:=$(git rev-parse --show-toplevel 2> /dev/null)} +if [ -n "${2}" ] && [ "${2}" != "default" ] ; then + VPP_PLATFORM="-${2}" +else + VPP_PLATFORM="" +fi DATE_FMT="+%Y-%m-%dT%H:%M:%S" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" VPP_BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT") @@ -29,6 +34,6 @@ cat > ${1} << __EOF__ #define VPP_BUILD_USER "$VPP_BUILD_USER" #define VPP_BUILD_HOST "$VPP_BUILD_HOST" #define VPP_BUILD_TOPDIR "$VPP_BUILD_TOPDIR" -#define VPP_BUILD_VER "$(scripts/version)" +#define VPP_BUILD_VER "$(scripts/version)${VPP_PLATFORM}" #endif __EOF__ diff --git a/src/vpp/CMakeLists.txt b/src/vpp/CMakeLists.txt index 84144e4d059..88766021ba9 100644 --- a/src/vpp/CMakeLists.txt +++ b/src/vpp/CMakeLists.txt @@ -20,7 +20,7 @@ add_custom_command( COMMAND mkdir ARGS -p ${CMAKE_CURRENT_BINARY_DIR}/app COMMAND scripts/generate_version_h - ARGS ${CMAKE_CURRENT_BINARY_DIR}/app/version.h + ARGS ${CMAKE_CURRENT_BINARY_DIR}/app/version.h ${VPP_PLATFORM} COMMENT "Generating VPP version.h" )