Package: dpdk / 22.11.8-1~deb12u1

0001-eal-linux-force-iova-mode-va-with-no-huge-option.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Author: David Wilder <dwilder@us.ibm.com>
Description: eal/linux: force iova-mode va with no-huge option
 When using --no-huge option the iova-mode must be VA.
 Physical address are not guaranteed to be persistent with out
 hugepages. This change effectively makes "--no-huge" the same as
 "--no-huge --iova-mode=va".  When --no-huge is used setting --iova-mode=pa
 will have no effect.
Origin: https://patchwork.dpdk.org/project/dpdk/patch/20200402171241.13258-2-dwilder@us.ibm.com/
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1078,6 +1078,11 @@
 
 	phys_addrs = rte_eal_using_phys_addrs() != 0;
 
+	if (!phys_addrs) {
+		internal_conf->iova_mode = RTE_IOVA_VA;
+		RTE_LOG(INFO, EAL, "Physical addresses are unavailable, selecting IOVA as VA mode.\n");
+	}
+
 	/* if no EAL option "--iova-mode=<pa|va>", use bus IOVA scheme */
 	if (internal_conf->iova_mode == RTE_IOVA_DC) {
 		/* autodetect the IOVA mapping mode */
@@ -1086,18 +1091,7 @@
 		if (iova_mode == RTE_IOVA_DC) {
 			RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode.\n");
 
-			if (!phys_addrs) {
-				/* if we have no access to physical addresses,
-				 * pick IOVA as VA mode.
-				 */
-				iova_mode = RTE_IOVA_VA;
-				RTE_LOG(DEBUG, EAL, "Physical addresses are unavailable, selecting IOVA as VA mode.\n");
-#if defined(RTE_LIB_KNI) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
-			} else if (rte_eal_check_module("rte_kni") == 1) {
-				iova_mode = RTE_IOVA_PA;
-				RTE_LOG(DEBUG, EAL, "KNI is loaded, selecting IOVA as PA mode for better KNI performance.\n");
-#endif
-			} else if (is_iommu_enabled()) {
+			if (is_iommu_enabled()) {
 				/* we have an IOMMU, pick IOVA as VA mode */
 				iova_mode = RTE_IOVA_VA;
 				RTE_LOG(DEBUG, EAL, "IOMMU is available, selecting IOVA as VA mode.\n");
@@ -1108,6 +1102,12 @@
 				iova_mode = RTE_IOVA_PA;
 				RTE_LOG(DEBUG, EAL, "IOMMU is not available, selecting IOVA as PA mode.\n");
 			}
+#if defined(RTE_LIB_KNI) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+			if (rte_eal_check_module("rte_kni") == 1) {
+				iova_mode = RTE_IOVA_PA;
+				RTE_LOG(DEBUG, EAL, "KNI is loaded, selecting IOVA as PA mode for better KNI performance.\n");
+			}
+#endif
 		}
 #if defined(RTE_LIB_KNI) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
 		/* Workaround for KNI which requires physical address to work