From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF0D3A0567 for ; Fri, 13 Mar 2020 09:17:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B503E1C02E; Fri, 13 Mar 2020 09:17:09 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id E41553B5; Fri, 13 Mar 2020 09:17:06 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4C2C731B; Fri, 13 Mar 2020 01:17:06 -0700 (PDT) Received: from net-arm-thunderx2-02.shanghai.arm.com (net-arm-thunderx2-02.shanghai.arm.com [10.169.40.171]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 493793F67D; Fri, 13 Mar 2020 01:17:02 -0700 (PDT) From: Ruifeng Wang To: aconole@redhat.com, maicolgabriel@hotmail.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, yipeng1.wang@intel.com, sameh.gobriel@intel.com Cc: dev@dpdk.org, david.marchand@redhat.com, anatoly.burakov@intel.com, gavin.hu@arm.com, honnappa.nagarahalli@arm.com, juraj.linkes@pantheon.tech, nd@arm.com, Ruifeng Wang , stable@dpdk.org Date: Fri, 13 Mar 2020 16:16:11 +0800 Message-Id: <20200313081614.195335-2-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200313081614.195335-1-ruifeng.wang@arm.com> References: <20200225073236.135581-1-ruifeng.wang@arm.com> <20200313081614.195335-1-ruifeng.wang@arm.com> Subject: [dpdk-stable] [PATCH v3 1/4] test: enable tests to run in no-huge mode X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Reviewed-by: Gavin Hu --- 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 501de35da..316bf4d06 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(¶m, &acl_param, sizeof(param)); - param.socket_id = RTE_MAX_NUMA_NODES + 1; - - acx = rte_acl_create(¶m); - 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(¶m, &acl_param, sizeof(param)); + param.socket_id = RTE_MAX_NUMA_NODES + 1; + + acx = rte_acl_create(¶m); + 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 fbd5725c6..ab978ea68 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 441338ac0..bc412c308 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.17.1