Commit c8337cb6 authored by Seth Howell's avatar Seth Howell Committed by Ben Walker
Browse files

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: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/424609


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 8b45e466
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);