From c8337cb68a18812fd9d4577d0fbd73ac845daedd Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 4 Sep 2018 15:32:37 -0700 Subject: [PATCH] env_dpdk: Include get_iommu_class after v17.08 the function pointer .get_iommu_class was not defined until v17.11 of dpdk so this function causes packaged versions of dpdk <17.11 to fail to compile with SPDK. Adding a couple preporocessor directives to avoid this problem. Change-Id: I70cf44877ddd712d42d117e6fa5f82494675d603 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/424609 Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System --- lib/env_dpdk/vtophys.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/env_dpdk/vtophys.c b/lib/env_dpdk/vtophys.c index 025456e89..4ae20f580 100644 --- a/lib/env_dpdk/vtophys.c +++ b/lib/env_dpdk/vtophys.c @@ -654,6 +654,7 @@ spdk_bus_find_device(const struct rte_device *start, return NULL; } +#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3) static enum rte_iova_mode spdk_bus_get_iommu_class(void) { /* Since we register our PCI drivers after EAL init, we have no chance @@ -667,12 +668,15 @@ spdk_bus_get_iommu_class(void) { */ return RTE_IOVA_VA; } +#endif struct rte_bus spdk_bus = { .scan = spdk_bus_scan, .probe = spdk_bus_probe, .find_device = spdk_bus_find_device, +#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3) .get_iommu_class = spdk_bus_get_iommu_class, +#endif }; RTE_REGISTER_BUS(spdk, spdk_bus);