env_dpdk: do not use rte_version_xxx() variants

These variants did not exist in DPDK 20.11 which is
still supported by SPDK.

So we will instead need to scan the rte_version()
string to get these values.

Fixes issue #2715.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I79657002a7a605a38a0d98b944ac53c02fa6d78c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14661
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
Jim Harris 2022-09-22 11:42:43 +00:00 committed by Tomasz Zawadzki
parent 896a25fb16
commit 3d5971ecc6

View File

@ -15,9 +15,16 @@ static struct dpdk_fn_table *g_dpdk_fn_table;
int
dpdk_pci_init(void)
{
uint32_t year = rte_version_year();
uint32_t month = rte_version_month();
uint32_t minor = rte_version_minor();
uint32_t year;
uint32_t month;
uint32_t minor;
int count;
count = sscanf(rte_version(), "DPDK %u.%u.%u", &year, &month, &minor);
if (count != 3) {
SPDK_ERRLOG("Unrecognized DPDK version format '%s'\n", rte_version());
return -EINVAL;
}
/* Anything 23.x or higher is not supported. */
if (year > 22) {