DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <david.marchand@redhat.com>
Subject: [PATCH] eal: add warning for incompatibe requested IOVA mode
Date: Tue, 6 Jun 2023 18:39:21 +0300	[thread overview]
Message-ID: <20230606153921.8074-1-viacheslavo@nvidia.com> (raw)

The DPDK can be compiled to be run in IOVA VA mode with
'enable_iova_as_pa=false' meson option. It disables support
of the physical address field in the mbufs and application
can not be run in 'IOVA as PA mode'.

The patch adds warning if some bus requires the 'IOVA as PA'
mode in runtime and the 'enable_iova_as_pa=false' meson option
was configured on build.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 lib/eal/common/eal_common_bus.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
index deb9fb8a12..acac14131a 100644
--- a/lib/eal/common/eal_common_bus.c
+++ b/lib/eal/common/eal_common_bus.c
@@ -239,9 +239,13 @@ rte_bus_get_iommu_class(void)
 			rte_bus_name(bus),
 			bus_iova_mode == RTE_IOVA_DC ? "DC" :
 			(bus_iova_mode == RTE_IOVA_PA ? "PA" : "VA"));
-		if (bus_iova_mode == RTE_IOVA_PA)
+		if (bus_iova_mode == RTE_IOVA_PA) {
 			buses_want_pa = true;
-		else if (bus_iova_mode == RTE_IOVA_VA)
+			if (!RTE_IOVA_IN_MBUF)
+				RTE_LOG(WARNING, EAL,
+					"Bus %s wants IOVA as PA not compatible with 'enable_iova_as_pa=false' build option.\n",
+					rte_bus_name(bus));
+		} else if (bus_iova_mode == RTE_IOVA_VA)
 			buses_want_va = true;
 	}
 	if (buses_want_va && !buses_want_pa) {
-- 
2.18.1


             reply	other threads:[~2023-06-06 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 15:39 Viacheslav Ovsiienko [this message]
2023-06-12  9:55 ` Burakov, Anatoly
2023-06-12 17:29   ` Thomas Monjalon

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=20230606153921.8074-1-viacheslavo@nvidia.com \
    --to=viacheslavo@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).