From d33042fb1193652bb38681ab5761851a8e33a7ba Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Mon, 19 Dec 2022 13:41:34 +0100 Subject: [PATCH] env_dpdk: do not use rte_version_release() Patch below started checking development version of DPDK using rte_version_release(): (32e6ffb) env_dpdk: add support for DPDK main branch for 23.03 rte_version_release() is present starting with DPDK 21.11, so it broke earlier versions like DPDK 20.11 packaged on Fedora 35. SPDK supports only last two DPDK LTS versions, which does not include DPDK 20.11. Yet there is no need to break older versions unnecessarily. Another aspect is that rte_version_release() is marked as experimental, so it could change in the future. Only using stable rte_version(), helps with forwards compatibility too. Change-Id: Id17d643a12dcfc03c2d4688d1bc5030dc339f428 Signed-off-by: Tomasz Zawadzki Reported-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16017 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Reviewed-by: Michal Berger --- lib/env_dpdk/pci_dpdk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/env_dpdk/pci_dpdk.c b/lib/env_dpdk/pci_dpdk.c index b8e134a1e..773ee46f8 100644 --- a/lib/env_dpdk/pci_dpdk.c +++ b/lib/env_dpdk/pci_dpdk.c @@ -19,18 +19,19 @@ dpdk_pci_init(void) uint32_t year; uint32_t month; uint32_t minor; + char release[32] = {0}; /* Max size of DPDK version string */ int count; - count = sscanf(rte_version(), "DPDK %u.%u.%u", &year, &month, &minor); - if (count != 3) { + count = sscanf(rte_version(), "DPDK %u.%u.%u%s", &year, &month, &minor, release); + if (count != 3 && count != 4) { SPDK_ERRLOG("Unrecognized DPDK version format '%s'\n", rte_version()); return -EINVAL; } /* Add support for DPDK main branch. - * Version release 99 is reserved for DPDK releases, other are used for development versions. + * Only DPDK in development has additional suffix past minor version. */ - if (rte_version_release() != 99) { + if (strlen(release) != 0) { if (year == 23 && month == 3 && minor == 0) { g_dpdk_fn_table = &fn_table_2211; SPDK_NOTICELOG("DPDK version 23.03.0 not supported yet. Enabled only for validation.\n");