summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Yoshimura <tyos@jp.ibm.com>2019-07-10 19:22:35 -0700
committerThomas Monjalon <thomas@monjalon.net>2019-07-11 11:28:20 +0200
commit22a55d2eb6ab7a096500f757edf8bbb0715deb28 (patch)
tree776ee5ce65f80421df764d0b5f12593e63837453
parenta99a311ba101ea7ebde256732bf65f512882d2b6 (diff)
downloaddpdk-22a55d2eb6ab7a096500f757edf8bbb0715deb28.zip
dpdk-22a55d2eb6ab7a096500f757edf8bbb0715deb28.tar.gz
dpdk-22a55d2eb6ab7a096500f757edf8bbb0715deb28.tar.xz
vfio: fix build on Linux < 4.2
The commit db90b4969e2e ("vfio: retry creating sPAPR DMA window") introduced a build breakage on old Linux. Linux <4.2 does not define ddw in struct vfio_iommu_spapr_tce_info. Without ddw, we cannot change window size and so should give up the creation. I just exculuded the retrying code if ddw is not supported. Fixes: db90b4969e2e ("vfio: retry creating sPAPR DMA window") Signed-off-by: Takeshi Yoshimura <tyos@jp.ibm.com> Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
-rw-r--r--lib/librte_eal/linux/eal/eal_vfio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/eal/eal_vfio.c
index 7053ebe..fadef42 100644
--- a/lib/librte_eal/linux/eal/eal_vfio.c
+++ b/lib/librte_eal/linux/eal/eal_vfio.c
@@ -1445,6 +1445,7 @@ vfio_spapr_create_new_dma_window(int vfio_container_fd,
/* create new DMA window */
ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, create);
if (ret) {
+#ifdef VFIO_IOMMU_SPAPR_INFO_DDW
/* try possible page_shift and levels for workaround */
uint32_t levels;
@@ -1463,6 +1464,7 @@ vfio_spapr_create_new_dma_window(int vfio_container_fd,
if (!ret)
break;
}
+#endif
if (ret) {
RTE_LOG(ERR, EAL, " cannot create new DMA window, "
"error %i (%s)\n", errno, strerror(errno));