From ca5c92c47a1eaa9271112719c7c37647265bff6e Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Wed, 15 Nov 2017 15:15:35 +0100 Subject: [PATCH] env/dpdk: compile with rte_pci and rte_bus_pci for DPDK 17.11-rc1 DPDK 17.11-rc1 moved a part of it's eal code into two separate libraries. Change-Id: Ibcea448487a001c30abb68447e3fe2104ba9a7c3 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/387655 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-on: https://review.gerrithub.io/387912 --- lib/env_dpdk/env.mk | 10 ++++++++++ lib/env_dpdk/env_internal.h | 3 +++ 2 files changed, 13 insertions(+) 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],