[dpdk-dev] [PATCH v2 1/3] kni: refuse to initialise when IOVA is not PA

David Marchand david.marchand at redhat.com
Fri Jun 14 11:39:15 CEST 2019


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 at dpdk.org

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 lib/librte_kni/rte_kni.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index a0f1e37..a6bf323 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -97,6 +97,11 @@ enum kni_ops_status {
 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);
-- 
1.8.3.1



More information about the dev mailing list