From: David Marchand Date: Fri, 14 Jun 2019 09:39:15 +0000 (+0200) Subject: kni: abort when IOVA is not PA X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fe8fc6b0b7eaf9078d804d57221000a494753997;p=dpdk.git kni: abort when IOVA is not PA If a forced iova-mode has been passed at init, kni is not supposed to work. Fixes: 075b182b54ce ("eal: force IOVA to a particular mode") Cc: stable@dpdk.org Signed-off-by: David Marchand --- diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 00104a35d2..e60de2cdb0 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -97,6 +97,11 @@ static volatile int kni_fd = -1; int rte_kni_init(unsigned int max_kni_ifaces __rte_unused) { + if (rte_eal_iova_mode() != RTE_IOVA_PA) { + RTE_LOG(ERR, KNI, "KNI requires IOVA as PA\n"); + return -1; + } + /* Check FD and open */ if (kni_fd < 0) { kni_fd = open("/dev/" KNI_DEVICE, O_RDWR);