lib/idxd: fail init if IOMMU is not enabled

Currently the idxd driver requires VFIO so avoid unexpected errors
if someone tries without it (with UIO).

Temp workaround for issue #2316

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I430cd2193bc8dbd6939af7d0ca799832e7a73213
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11816
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
paul luse 2022-03-04 07:22:47 -07:00 committed by Tomasz Zawadzki
parent adc36d5be3
commit 75209b1d53

View File

@ -296,6 +296,14 @@ spdk_idxd_probe(void *cb_ctx, spdk_idxd_attach_cb attach_cb)
return -1;
}
/* The idxd library doesn't support UIO at the moment, so fail init
* if the IOMMU is disabled. TODO: remove once driver supports UIO.
*/
if (spdk_iommu_is_enabled() == false) {
SPDK_ERRLOG("The IDXD driver currently requires the IOMMU which is disabled. Please re-enable to use IDXD\n");
return -EINVAL;
}
return g_idxd_impl->probe(cb_ctx, attach_cb);
}