DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Cc: skhare@vmware.com, Chas Williams <chas3@att.com>
Subject: [dpdk-dev] [PATCH] eal: add option to force IOVA as PA mode
Date: Wed, 29 Nov 2017 21:57:21 -0500	[thread overview]
Message-ID: <20171130025721.4301-1-3chas3@gmail.com> (raw)

From: Chas Williams <chas3@att.com>

The IOMMU in some machines report that they can only support
limited widths.  IOVA virtual addresses may exceed this width
making the use of IOVA virtual addresses difficult.  The option
CONFIG_RTE_LIBRTE_USE_PHYS_IOVA can used to force IOVA physical
address usage.

Signed-off-by: Chas Williams <chas3@att.com>
---
 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 e74febe..06b3ded 100644
--- a/config/common_base
+++ b/config/common_base
@@ -820,3 +820,8 @@ CONFIG_RTE_APP_CRYPTO_PERF=y
 # Compile the eventdev application
 #
 CONFIG_RTE_APP_EVENTDEV=y
+
+#
+# Force IOVA physical addresses in VFIO
+#
+CONFIG_RTE_LIBRTE_USE_PHYS_IOVA=n
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 369a682..b396285 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -569,8 +569,12 @@ rte_eal_init(int argc, char **argv)
 		return -1;
 	}
 
+#ifdef RTE_LIBRTE_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 229eec9..13b02fd 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -804,8 +804,12 @@ rte_eal_init(int argc, char **argv)
 		return -1;
 	}
 
+#ifdef RTE_LIBRTE_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
 
 	/* Workaround for KNI which requires physical address to work */
 	if (rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA &&
-- 
2.9.5

             reply	other threads:[~2017-11-30  2:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30  2:57 Chas Williams [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-11-30  2:57 Chas Williams
2017-11-30  9:17 ` Thomas Monjalon
2017-12-03  0:23   ` Chas Williams
2018-01-12  0:12     ` Thomas Monjalon
2018-01-12  3:28       ` Chas Williams
2017-12-01  5:48 ` Hemant Agrawal
2017-12-03  0:25   ` Chas Williams
2017-11-30  2:56 Chas Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171130025721.4301-1-3chas3@gmail.com \
    --to=3chas3@gmail.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=skhare@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).