DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default
@ 2017-11-01  1:07 Ferruh Yigit
  2017-11-01  2:17 ` Tan, Jianfeng
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Ferruh Yigit @ 2017-11-01  1:07 UTC (permalink / raw)
  To: Thomas Monjalon, Bruce Richardson, Sergio Gonzalez Monroy
  Cc: dev, Ferruh Yigit, Jianfeng Tan, Santosh Shukla

Fix kernel crash with KNI because KNI requires physical addresses.

A config option introduced to disable IOVA mode detection and to set it
to physical address by default. Disabling config option will enable IOVA
mode detection.

When there is no intension to use KNI, it is safe to enable detection.

Config option disable IOVA mode detection by default to be sure only who
is aware of result enable it.

Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Jianfeng Tan <jianfeng.tan@intel.com>
Cc: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Cc: Thomas Monjalon <thomas@monjalon.net>
---
 config/common_base                | 5 +++++
 lib/librte_eal/bsdapp/eal/eal.c   | 4 ++++
 lib/librte_eal/linuxapp/eal/eal.c | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/config/common_base b/config/common_base
index 82ee75456..903e7685b 100644
--- a/config/common_base
+++ b/config/common_base
@@ -107,6 +107,11 @@ CONFIG_RTE_MALLOC_DEBUG=n
 CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n
 
 #
+# Disabling PHYS_IOVA may crash kernel for KNI, use with caution
+#
+CONFIG_RTE_EAL_USE_PHYS_IOVA=y
+
+#
 # Recognize/ignore the AVX/AVX512 CPU flags for performance/power testing.
 # AVX512 is marked as experimental for now, will enable it after enough
 # field test and possible optimization.
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 09112b6f9..db485951b 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -570,8 +570,12 @@ rte_eal_init(int argc, char **argv)
 		return -1;
 	}
 
+#ifdef RTE_EAL_USE_PHYS_IOVA
+	rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA;
+#else
 	/* autodetect the iova mapping mode (default is iova_pa) */
 	rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class();
+#endif
 
 	if (internal_config.no_hugetlbfs == 0 &&
 			internal_config.process_type != RTE_PROC_SECONDARY &&
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 017c402ed..1775bb33f 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -805,8 +805,12 @@ rte_eal_init(int argc, char **argv)
 		return -1;
 	}
 
+#ifdef RTE_EAL_USE_PHYS_IOVA
+	rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA;
+#else
 	/* autodetect the iova mapping mode (default is iova_pa) */
 	rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class();
+#endif
 
 	if (internal_config.no_hugetlbfs == 0 &&
 			internal_config.process_type != RTE_PROC_SECONDARY &&
-- 
2.13.6

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-11-01 18:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01  1:07 [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default Ferruh Yigit
2017-11-01  2:17 ` Tan, Jianfeng
2017-11-01  6:32   ` Ferruh Yigit
2017-11-01  6:37     ` Tan, Jianfeng
2017-11-01  7:29       ` Ferruh Yigit
2017-11-01  7:55         ` Tan, Jianfeng
2017-11-01  3:54 ` santosh
2017-11-01  4:02 ` Jerin Jacob
2017-11-01  6:21   ` Ferruh Yigit
2017-11-01  6:54     ` Jerin Jacob
2017-11-01  7:39       ` Tan, Jianfeng
2017-11-01  8:26         ` Jerin Jacob
2017-11-01  8:53           ` Tan, Jianfeng
2017-11-01 18:31             ` Ferruh Yigit
2017-11-01  8:12       ` Ferruh Yigit
2017-11-01 10:31 ` Thomas Monjalon
2017-11-01 11:06   ` santosh
2017-11-01 18:22     ` Ferruh Yigit
2017-11-01 18:11   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).