From a26adb0d6c43dd92776a1edf1dcae5b106197bee Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 19 Nov 2020 08:33:17 +0100 Subject: [PATCH] env_dpdk/pci: fix check on 20.11 EAL API change RTE_DEV_ALLOWED is an enum and has no associated define, hence checking for its presence will always be false. We could test for RTE_DEV_WHITELISTED define, but this macro added for deprecation warning will be dropped in the future. Switch to a check on DPDK version. Fixes: 10ed0eb75593 ("env_dpdk/pci: adapt to 20.11 EAL changes") Signed-off-by: David Marchand Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5165 (master) (cherry picked from commit 2e9cd9d7b02a5a36d6ac3bf3b5339dbf63e18c70) Change-Id: I75270977b580065b36c753266cbaa5fb73f99eb1 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5175 Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris --- lib/env_dpdk/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index 3af26a6c4e..cf7758ed1c 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -41,7 +41,7 @@ #define SYSFS_PCI_DRIVERS "/sys/bus/pci/drivers" /* Compatibility for versions < 20.11 */ -#ifndef RTE_DEV_ALLOWED +#if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0) #define RTE_DEV_ALLOWED RTE_DEV_WHITELISTED #define RTE_DEV_BLOCKED RTE_DEV_BLACKLISTED #define RTE_BUS_SCAN_ALLOWLIST RTE_BUS_SCAN_WHITELIST