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 <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/387655
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-11-15 15:15:35 +01:00 committed by Ben Walker
parent db704770d6
commit 779dd1bc10
2 changed files with 13 additions and 0 deletions

View File

@ -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)

View File

@ -48,6 +48,9 @@
extern struct rte_pci_bus rte_pci_bus;
#endif
#include <rte_pci.h>
#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 1)
#include <rte_bus_pci.h>
#endif
#include <rte_dev.h>
/* x86-64 userspace virtual addresses use only the low 47 bits [0..46],