env/dpdk: make SPDK can compile with DPDK 17.05

Change-Id: Id69a162b6f2abfdcd4d41b368cfcde52665eb904
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Changpeng Liu 2017-04-29 10:16:32 +08:00 committed by Jim Harris
parent 01af49aa04
commit 80e4f5ae8b
2 changed files with 10 additions and 2 deletions

View File

@ -51,9 +51,13 @@
#include <stdbool.h>
#include <rte_config.h>
#include <rte_eal.h>
#include <rte_pci.h>
#include <rte_version.h>
#include <rte_eal.h>
#if RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 0)
#include <rte_bus.h>
extern struct rte_pci_bus rte_pci_bus;
#endif
#include <rte_pci.h>
#include <rte_dev.h>
struct spdk_pci_enum_ctx {

View File

@ -170,7 +170,11 @@ spdk_pci_get_device(struct spdk_pci_addr *pci_addr)
addr.devid = pci_addr->dev;
addr.function = pci_addr->func;
#if RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 0)
FOREACH_DEVICE_ON_PCIBUS(dev) {
#else
TAILQ_FOREACH(dev, &pci_device_list, next) {
#endif
rc = rte_eal_compare_pci_addr(&dev->addr, &addr);
if (rc < 0) {
continue;