DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stanislaw Kardach <kda@semihalf.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, Stanislaw Kardach <kda@semihalf.com>
Subject: [dpdk-dev] [PATCH v2 2/3] test: disable no-huge where it's not necessary
Date: Fri,  4 Jun 2021 16:16:00 +0200	[thread overview]
Message-ID: <20210604141601.275430-3-kda@semihalf.com> (raw)
In-Reply-To: <20210604141601.275430-1-kda@semihalf.com>

In tests where no-shconf flag is used, no-huge is also passed due to
compatibility with FreeBSD system, as described in: b5d878e6d.
However on Linux systems with RTE_IOVA_PA (lack of or an incompatible
IOMMU) this causes issues since hugepages are required by EAL.
Therefore replace all occurrences of no_huge which don't actually test
the no-huge logic with a execution environment conditional
no_huge_compat to indicate that it is passed as a compatibility flag,
not as a requirement for a test itself.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Fixes: b5d878e6db56 ("test: fix EAL flags autotest on FreeBSD")
Cc: anatoly.burakov@intel.com
---
 app/test/test_eal_flags.c | 50 ++++++++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 19 deletions(-)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 462dc63842..e2248a5d9a 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -29,6 +29,17 @@
 #define mp_flag "--proc-type=secondary"
 #define no_hpet "--no-hpet"
 #define no_huge "--no-huge"
+/* FreeBSD does not support running multiple primary processes, hence for tests
+ * requiring no-shconf, no-huge is also required.
+ * On Linux on the other hand no-huge is not needed so don't pass it as it
+ * would break cases when IOMMU is not able to provide IOVA translation
+ * (rte_eal_iova_mode() == RTE_IOVA_PA).
+ */
+#ifdef RTE_EXEC_ENV_LINUX
+#define no_huge_compat ""
+#else
+#define no_huge_compat no_huge
+#endif
 #define no_shconf "--no-shconf"
 #define allow "--allow"
 #define vdev "--vdev"
@@ -354,18 +365,18 @@ test_invalid_vdev_flag(void)
 #endif
 
 	/* Test with invalid vdev option */
-	const char *vdevinval[] = {prgname, prefix, no_huge,
-				vdev, "eth_dummy"};
+	const char * const vdevinval[] = {prgname, prefix, no_huge_compat,
+					  vdev, "eth_dummy"};
 
 	/* Test with valid vdev option */
-	const char *vdevval1[] = {prgname, prefix, no_huge,
-	vdev, "net_ring0"};
+	const char * const vdevval1[] = {prgname, prefix, no_huge_compat,
+					 vdev, "net_ring0"};
 
-	const char *vdevval2[] = {prgname, prefix, no_huge,
-	vdev, "net_ring0,args=test"};
+	const char * const vdevval2[] = {prgname, prefix, no_huge_compat,
+					 vdev, "net_ring0,args=test"};
 
-	const char *vdevval3[] = {prgname, prefix, no_huge,
-	vdev, "net_ring0,nodeaction=r1:0:CREATE"};
+	const char * const vdevval3[] = {prgname, prefix, no_huge_compat,
+		vdev, "net_ring0,nodeaction=r1:0:CREATE"};
 
 	if (launch_proc(vdevinval) == 0) {
 		printf("Error - process did run ok with invalid "
@@ -674,19 +685,20 @@ test_invalid_n_flag(void)
 #endif
 
 	/* -n flag but no value */
-	const char *argv1[] = { prgname, prefix, no_huge, no_shconf,
-				"-n"};
+	const char * const argv1[] = { prgname, prefix, no_huge_compat,
+				       no_shconf, "-n"};
 	/* bad numeric value */
-	const char *argv2[] = { prgname, prefix, no_huge, no_shconf,
-				"-n", "e" };
+	const char * const argv2[] = { prgname, prefix, no_huge_compat,
+				       no_shconf, "-n", "e" };
 	/* zero is invalid */
-	const char *argv3[] = { prgname, prefix, no_huge, no_shconf,
-				"-n", "0" };
+	const char * const argv3[] = { prgname, prefix, no_huge_compat,
+				       no_shconf, "-n", "0" };
 	/* sanity test - check with good value */
-	const char *argv4[] = { prgname, prefix, no_huge, no_shconf,
-				"-n", "2" };
+	const char * const argv4[] = { prgname, prefix, no_huge_compat,
+				       no_shconf, "-n", "2" };
 	/* sanity test - check with no -n flag */
-	const char *argv5[] = { prgname, prefix, no_huge, no_shconf};
+	const char * const argv5[] = { prgname, prefix, no_huge_compat,
+				       no_shconf};
 
 	if (launch_proc(argv1) == 0
 			|| launch_proc(argv2) == 0
@@ -878,7 +890,7 @@ test_misc_flags(void)
 	const char *argv5[] = {prgname, prefix, mp_flag, "--syslog", "error"};
 	/* With no-sh-conf, also use no-huge to ensure this test runs on BSD */
 	const char *argv6[] = {prgname, "-m", DEFAULT_MEM_SIZE,
-			no_shconf, nosh_prefix, no_huge};
+			no_shconf, nosh_prefix, no_huge_compat};
 
 	/* With --huge-dir */
 	const char *argv7[] = {prgname, "-m", DEFAULT_MEM_SIZE,
@@ -920,7 +932,7 @@ test_misc_flags(void)
 
 	/* With process type as auto-detect with no-shconf */
 	const char * const argv17[] = {prgname, "--proc-type=auto",
-			no_shconf, nosh_prefix, no_huge};
+			no_shconf, nosh_prefix, no_huge_compat};
 
 	/* With process type as --create-uio-dev flag */
 	const char * const argv18[] = {prgname, "--file-prefix=uiodev",
-- 
2.27.0


  parent reply	other threads:[~2021-06-04 14:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 14:15 [dpdk-dev] [PATCH v2 0/3] Increase test compatibility with PA IOVA Stanislaw Kardach
2021-06-04 14:15 ` [dpdk-dev] [PATCH v2 1/3] test: disable no-huge test " Stanislaw Kardach
2021-06-04 14:16 ` Stanislaw Kardach [this message]
2021-06-04 14:16 ` [dpdk-dev] [PATCH v2 3/3] test: fix the -n unit test description Stanislaw Kardach
2021-06-10  7:51 ` [dpdk-dev] [PATCH v2 0/3] Increase test compatibility with PA IOVA Stanislaw Kardach

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=20210604141601.275430-3-kda@semihalf.com \
    --to=kda@semihalf.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    /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).