diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index 66274692a..6a1f87c6e 100644 --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -76,6 +76,16 @@ ifneq ($(wildcard $(DPDK_ABS_DIR)/lib/librte_malloc.*),) DPDK_LIB_LIST += rte_malloc endif +# librte_pci and librte_bus_pci were added in DPDK 17.11. Link these libraries conditionally +# based on their existence to maintain backward compatibility. +ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_pci.*)) +DPDK_LIB_LIST += rte_pci +endif + +ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_bus_pci.*)) +DPDK_LIB_LIST += rte_bus_pci +endif + DPDK_LIB = $(DPDK_LIB_LIST:%=$(DPDK_ABS_DIR)/lib/lib%$(DPDK_LIB_EXT)) ENV_CFLAGS = $(DPDK_INC) diff --git a/lib/env_dpdk/env_internal.h b/lib/env_dpdk/env_internal.h index fad164d0e..2f5826c8b 100644 --- a/lib/env_dpdk/env_internal.h +++ b/lib/env_dpdk/env_internal.h @@ -48,6 +48,9 @@ extern struct rte_pci_bus rte_pci_bus; #endif #include +#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 1) +#include +#endif #include /* x86-64 userspace virtual addresses use only the low 47 bits [0..46],