From: David Wilder <dwilder@us.ibm.com>
To: aconole@redhat.com, maicolgabriel@hotmail.com,
thomas@monjalon.net, ferruh.yigit@intel.com,
arybchenko@solarflare.com
Cc: dev@dpdk.org, ruifeng.wang@arm.com, david.marchand@redhat.com,
drc@linux.vnet.ibm.com, jerinjacobk@gmail.com, wilder@us.ibm.com
Subject: [dpdk-dev] [PATCH v4 1/4] eal/linux: force iova-mode va with no-huge option
Date: Thu, 2 Apr 2020 10:12:38 -0700 [thread overview]
Message-ID: <20200402171241.13258-2-dwilder@us.ibm.com> (raw)
In-Reply-To: <20200402171241.13258-1-dwilder@us.ibm.com>
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.
Signed-off-by: David Wilder <dwilder@us.ibm.com>
---
lib/librte_eal/linux/eal.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c
index 9530ee55f..44e950f9c 100644
--- a/lib/librte_eal/linux/eal.c
+++ b/lib/librte_eal/linux/eal.c
@@ -1060,6 +1060,11 @@ rte_eal_init(int argc, char **argv)
phys_addrs = rte_eal_using_phys_addrs() != 0;
+ if (!phys_addrs) {
+ internal_config.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_config.iova_mode == RTE_IOVA_DC) {
/* autodetect the IOVA mapping mode */
@@ -1068,18 +1073,7 @@ rte_eal_init(int argc, char **argv)
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_LIBRTE_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 perfomance.\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");
@@ -1090,6 +1084,12 @@ rte_eal_init(int argc, char **argv)
iova_mode = RTE_IOVA_PA;
RTE_LOG(DEBUG, EAL, "IOMMU is not available, selecting IOVA as PA mode.\n");
}
+#if defined(RTE_LIBRTE_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 perfomance.\n");
+ }
+#endif
}
#if defined(RTE_LIBRTE_KNI) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
/* Workaround for KNI which requires physical address to work
--
2.25.0
next prev parent reply other threads:[~2020-04-02 17:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 17:12 [dpdk-dev] [PATCH v4 0/4] add travis ci support for ppc64le David Wilder
2020-04-02 17:12 ` David Wilder [this message]
2020-04-02 17:12 ` [dpdk-dev] [PATCH v4 2/4] devtools: allow test-null.sh to run on ppc64le David Wilder
2020-04-02 17:12 ` [dpdk-dev] [PATCH v4 3/4] ci: add travis ci support for native ppc64le David Wilder
2020-04-02 17:12 ` [dpdk-dev] [PATCH v4 4/4] ci: enable unit test for ppc64le David Wilder
2021-03-25 15:06 ` [dpdk-dev] [PATCH v4 0/4] add travis ci support " David Marchand
2021-04-15 14:45 ` Christian Ehrhardt
2021-04-19 12:22 ` Luca Boccassi
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=20200402171241.13258-2-dwilder@us.ibm.com \
--to=dwilder@us.ibm.com \
--cc=aconole@redhat.com \
--cc=arybchenko@solarflare.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=drc@linux.vnet.ibm.com \
--cc=ferruh.yigit@intel.com \
--cc=jerinjacobk@gmail.com \
--cc=maicolgabriel@hotmail.com \
--cc=ruifeng.wang@arm.com \
--cc=thomas@monjalon.net \
--cc=wilder@us.ibm.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).