DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: aconole@redhat.com, ruifeng.wang@arm.com,
	maicolgabriel@hotmail.com, bruce.richardson@intel.com,
	stable@dpdk.org, Gavin Hu <gavin.hu@arm.com>,
	Yipeng Wang <yipeng1.wang@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Sameh Gobriel <sameh.gobriel@intel.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH v4 2/5] test: skip subtests in no-huge mode
Date: Mon, 23 Mar 2020 20:59:23 +0100	[thread overview]
Message-ID: <20200323195926.12182-3-david.marchand@redhat.com> (raw)
In-Reply-To: <20200323195926.12182-1-david.marchand@redhat.com>

From: Ruifeng Wang <ruifeng.wang@arm.com>

When running with '--no-huge' flag, tests failed with messages as:
    ACL context creation with invalid NUMA should have failed!
    fbk hash creation should have failed
    test_table_pipeline: Check pipeline invalid params failed.

These cases test against invalid socket ID as input parameter, and
expect error return. But function calls return success because
invalid sock ID is overwritten to SOCKET_ID_ANY when in no-huge mode.

The tests against invalid socket ID are skipped in no-huge mode.

Fixes: 5640171c528a ("malloc: fix external heap allocation in no-huge mode")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
---
 app/test/test_acl.c            | 22 ++++++++++++----------
 app/test/test_hash.c           |  7 +++++--
 app/test/test_table_pipeline.c | 12 +++++++-----
 3 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/app/test/test_acl.c b/app/test/test_acl.c
index 501de35da1..316bf4d065 100644
--- a/app/test/test_acl.c
+++ b/app/test/test_acl.c
@@ -1397,16 +1397,18 @@ test_invalid_parameters(void)
 	} else
 		rte_acl_free(acx);
 
-	/* invalid NUMA node */
-	memcpy(&param, &acl_param, sizeof(param));
-	param.socket_id = RTE_MAX_NUMA_NODES + 1;
-
-	acx = rte_acl_create(&param);
-	if (acx != NULL) {
-		printf("Line %i: ACL context creation with invalid NUMA "
-				"should have failed!\n", __LINE__);
-		rte_acl_free(acx);
-		return -1;
+	if (rte_eal_has_hugepages()) {
+		/* invalid NUMA node */
+		memcpy(&param, &acl_param, sizeof(param));
+		param.socket_id = RTE_MAX_NUMA_NODES + 1;
+
+		acx = rte_acl_create(&param);
+		if (acx != NULL) {
+			printf("Line %i: ACL context creation with invalid "
+					"NUMA should have failed!\n", __LINE__);
+			rte_acl_free(acx);
+			return -1;
+		}
 	}
 
 	/* NULL name */
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index fbd5725c68..ab978ea689 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -1136,8 +1136,11 @@ fbk_hash_unit_test(void)
 	handle = rte_fbk_hash_create(&invalid_params_7);
 	RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed");
 
-	handle = rte_fbk_hash_create(&invalid_params_8);
-	RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed");
+	if (rte_eal_has_hugepages()) {
+		handle = rte_fbk_hash_create(&invalid_params_8);
+		RETURN_IF_ERROR_FBK(handle != NULL,
+					"fbk hash creation should have failed");
+	}
 
 	handle = rte_fbk_hash_create(&invalid_params_same_name_1);
 	RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation should have succeeded");
diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c
index 441338ac01..bc412c3081 100644
--- a/app/test/test_table_pipeline.c
+++ b/app/test/test_table_pipeline.c
@@ -190,11 +190,13 @@ check_pipeline_invalid_params(void)
 		goto fail;
 	}
 
-	p = rte_pipeline_create(&pipeline_params_3);
-	if (p != NULL) {
-		RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid "
-			"socket\n", __func__);
-		goto fail;
+	if (rte_eal_has_hugepages()) {
+		p = rte_pipeline_create(&pipeline_params_3);
+		if (p != NULL) {
+			RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with "
+				"invalid socket\n", __func__);
+			goto fail;
+		}
 	}
 
 	/* Check pipeline consistency */
-- 
2.23.0


  parent reply	other threads:[~2020-03-23 19:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 19:59 [dpdk-dev] [PATCH v4 0/5] no-huge unit test David Marchand
2020-03-23 19:59 ` [dpdk-dev] [PATCH v4 1/5] test: load drivers when required David Marchand
2020-03-23 21:01   ` Aaron Conole
2020-03-23 19:59 ` David Marchand [this message]
2020-03-23 19:59 ` [dpdk-dev] [PATCH v4 3/5] test: allow no-huge mode for fast-tests David Marchand
2020-03-23 19:59 ` [dpdk-dev] [PATCH v4 4/5] ci: run tests even without hugepage David Marchand
2020-03-23 19:59 ` [dpdk-dev] [PATCH v4 5/5] ci: enable unit test for aarch64 David Marchand
2020-03-24 10:06 ` [dpdk-dev] [PATCH v4 0/5] no-huge unit test David Marchand

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=20200323195926.12182-3-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=aconole@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=gavin.hu@arm.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=maicolgabriel@hotmail.com \
    --cc=ruifeng.wang@arm.com \
    --cc=sameh.gobriel@intel.com \
    --cc=stable@dpdk.org \
    --cc=yipeng1.wang@intel.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).