From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06B38A034F for ; Wed, 10 Nov 2021 07:37:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 001DA40142; Wed, 10 Nov 2021 07:37:07 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2052.outbound.protection.outlook.com [40.107.96.52]) by mails.dpdk.org (Postfix) with ESMTP id 13C79410F2 for ; Wed, 10 Nov 2021 07:37:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l+38Jq3xz0Kc0xKXlrKI8MOIfxRQHtX8PUTvXz6SUe5Xppfu10fL6BBBzH3Rb7EhNeyC3Rd6qn3gaZ/6AsHm8Zd/K/gPDEfB2Z8yhYvzlBKC/SiZHXWWjgjJd6ikvgSv22dlBVtqHpO+m0NhaofPtG0kpQ9MppL2fPY3KzeS6G8Fa91gBy26/EKHCP71dQTrzv2Vz5L3IkI9Fr8Pp7AY5LF3dTR6LEBOopALBNXE8wyCMiF/wc3nbdB20P7TXAlTzPCtX94UXph+RKCJjIhi1Weo1NS/M84mGSFFFYrPLZzkRiiE4/pE6FL1+4dc/Eh3qcYOSqPpyRCWE84UN6re+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oEW1k5w+8UFANqM5KvYIq91e1k7Ga1bqLo9DbIR6j/s=; b=Xt8kLFqTSlRQ7XeHBhRB5ENhZ3fYaXt99QQr6LIr9Wi5TEnq05YrJFqmmo/qcVDLS/nJHrzxho/TVaC7h3vulaZe6TIWMGNCf2OxVLbx4aUnycjlD4W3vrEfaGP/Dbfk5jxzrxu4kZxfFtKdRYgERk4G8RNzILLzKNX5FN+iTWsswlwWCa1fhqvbDkdhpYtUS/qK3zXlIyhtV/StIyjbu2/TVq4A0gUPT3sYe1JbKcZG+8kKsK9mk9soBC2wkIUOajbwuTIIlvZr9Nz3R5dove+8N4jfJgo3sTL3YmwYYm+5ca78dUEMhSNceLyYE00B38nw40i4cDceJ4BRw9bW1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=6wind.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oEW1k5w+8UFANqM5KvYIq91e1k7Ga1bqLo9DbIR6j/s=; b=QE5yojHD6c/uSODodk1uYjNZAL3GBeTo7ZzR/nHWe9Zq+t9o1v++2BZ0tCgxzxTmOB+mCK2uV6oA7RpVAKAgUdzY/ffMdrOEpCo+31n1Yx/9D/u1WnXhGEI3dHczLXv9/ykC0YcJdB0ydRZkzLBEPwUWMoiJvN2hGlIKnw609E7VA9B1DqQ95hpT5KqfK6tOjF9LoQAvbDfyIS6xZjTSoCxFOwc+0AzUUlSrZmojr5pQdfrg2XVWKIrQRAVSdvrqP/B2LKK1jl464QW5bJzzKoCexYtRvHIdoG7l3I02ecA6M906olQopE7QrSD2jgyLlRjmY54jKwakAHCr9MWAfA== Received: from DM6PR06CA0017.namprd06.prod.outlook.com (2603:10b6:5:120::30) by CY4PR1201MB0200.namprd12.prod.outlook.com (2603:10b6:910:1d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:37:04 +0000 Received: from DM6NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::97) by DM6PR06CA0017.outlook.office365.com (2603:10b6:5:120::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:37:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT004.mail.protection.outlook.com (10.13.172.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:37:03 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:37:01 +0000 From: Xueming Li To: Joyce Kong CC: Luca Boccassi , Ruifeng Wang , Feifei Wang , Olivier Matz , David Marchand , dpdk stable Date: Wed, 10 Nov 2021 14:28:48 +0800 Message-ID: <20211110063216.2744012-45-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7a2dde4-22bf-4efb-6c30-08d9a41481fb X-MS-TrafficTypeDiagnostic: CY4PR1201MB0200: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tknfBqEAGNXuJHJ9sqluzhkzKWz0TLiRPcQuMh9kfUYNs7dQk0vO9s6aWBTbEEcG9BQddAIt8p4SF1cGrORltzfe6xsANnrPoLMKGHafUbArEtoTVHuOUNxbkH+f2QCf7rcR2Sww8dk3yBvsFD5q/VHET36Lv1GS+ry496wx8wrf+Dtw5luoWF4eNuuZNPpe6XooEVh8c+os+PliL0iQz3TzqXWX8mcZIn1E3gy3YlinST6r0vuGz7Iyt0KeGaIEkYHX/2SckX0YcFt/k8j3mXKpOX8UzU0lLQPNPmVl2n1s1ouEPr2yuaPgB4XEFQ8cUl2Qzwa4DJZP5veMI4vjXbwFkCX/4NxVT9YvD5Yemn2X0a9lnS6XhOXVGqjjLupuvqej4N+yRNuXAXOi081WN8tFwSw/X12HeTs4B5VAHG3ZBoNthrp7YxCf5uNaKHKBYrVQwxKcgc9IwixZc4YWI/KWmn5K03vkjzNDvtu5xUjB4oKKbRS/21/zSaQ/wWnwV/3gmUvypon6PDtbsJ3LTG0bK3WqVgzA8KATSqo8zAgYg8v1LRfTUfKgGnfcfopdEcfS2fkR7pUAdrP10JPtLsNiYPJpB1QdctUUNt2okis9ubk92ThgV7RNMlWNuurkozmrnsyXcismsWwsgBLoSapiGrHn9lMEKs+YyrNdRupsXapnUHK/O42zsOAfm+2VHfDSQQXNU5+6nE98IVInwrWb4UnJm7rUMAwy2UqnLjqybCYoR6mgN3/fgo+093Ip+gLNG1GKj4hVxTalpaj80tWcuL9xzlWaHzwqTGNz7kfNt9w24QCm1ZgDKvqq442HLLVQAHqxtAIE7VSe9blMfQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(2906002)(36860700001)(8936002)(6286002)(82310400003)(86362001)(6666004)(356005)(508600001)(53546011)(7636003)(70586007)(36756003)(316002)(54906003)(4001150100001)(966005)(6916009)(36906005)(426003)(186003)(2616005)(26005)(336012)(55016002)(5660300002)(4326008)(7696005)(83380400001)(8676002)(47076005)(1076003)(16526019)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:37:03.5605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7a2dde4-22bf-4efb-6c30-08d9a41481fb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0200 Subject: [dpdk-stable] patch 'test/func_reentrancy: free memzones after test' has been queued to stable release 20.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/8192dfc388446d9f199f105c244898f1d5843a1e Thanks. Xueming Li --- >From 8192dfc388446d9f199f105c244898f1d5843a1e Mon Sep 17 00:00:00 2001 From: Joyce Kong Date: Sun, 22 Aug 2021 21:57:40 -0500 Subject: [PATCH] test/func_reentrancy: free memzones after test Cc: Xueming Li [ upstream commit d5559ac589953fa9f018aa581032e0f74bd49729 ] Function reentrancy test limits maximum number of iterations simultaneously, however it doesn't free the 'fr_test_once' memzones after the fact, so introduce freeing 'fr_test_once' in ring/mempool/hash/fbk/lpm_clean. Meanwhile, add the missing free for test case on main thread. Fixes: 104a92bd026f ("app: add reentrancy tests") Fixes: 995eec619024 ("test: clean up memory for function reentrancy test") Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Reviewed-by: Feifei Wang Reviewed-by: Olivier Matz Acked-by: David Marchand --- app/test/test_func_reentrancy.c | 35 ++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c index 231c99a9eb..838ab6f0f9 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -89,6 +89,10 @@ ring_clean(unsigned int lcore_id) char ring_name[MAX_STRING_SIZE]; int i; + rp = rte_ring_lookup("fr_test_once"); + if (rp != NULL) + rte_ring_free(rp); + for (i = 0; i < MAX_ITER_MULTI; i++) { snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_id, i); @@ -148,7 +152,10 @@ mempool_clean(unsigned int lcore_id) char mempool_name[MAX_STRING_SIZE]; int i; - /* verify all ring created successful */ + mp = rte_mempool_lookup("fr_test_once"); + if (mp != NULL) + rte_mempool_free(mp); + for (i = 0; i < MAX_ITER_MULTI; i++) { snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_id, i); @@ -208,6 +215,10 @@ hash_clean(unsigned lcore_id) struct rte_hash *handle; int i; + handle = rte_hash_find_existing("fr_test_once"); + if (handle != NULL) + rte_hash_free(handle); + for (i = 0; i < MAX_ITER_MULTI; i++) { snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_id, i); @@ -272,6 +283,10 @@ fbk_clean(unsigned lcore_id) struct rte_fbk_hash_table *handle; int i; + handle = rte_fbk_hash_find_existing("fr_test_once"); + if (handle != NULL) + rte_fbk_hash_free(handle); + for (i = 0; i < MAX_ITER_MULTI; i++) { snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_id, i); @@ -338,6 +353,10 @@ lpm_clean(unsigned int lcore_id) struct rte_lpm *lpm; int i; + lpm = rte_lpm_find_existing("fr_test_once"); + if (lpm != NULL) + rte_lpm_free(lpm); + for (i = 0; i < MAX_LPM_ITER_TIMES; i++) { snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_id, i); @@ -418,11 +437,10 @@ struct test_case test_cases[] = { static int launch_test(struct test_case *pt_case) { + unsigned int lcore_id; + unsigned int cores; + unsigned int count; int ret = 0; - unsigned lcore_id; - unsigned cores_save = rte_lcore_count(); - unsigned cores = RTE_MIN(cores_save, MAX_LCORES); - unsigned count; if (pt_case->func == NULL) return -1; @@ -430,6 +448,7 @@ launch_test(struct test_case *pt_case) rte_atomic32_set(&obj_count, 0); rte_atomic32_set(&synchro, 0); + cores = RTE_MIN(rte_lcore_count(), MAX_LCORES); RTE_LCORE_FOREACH_WORKER(lcore_id) { if (cores == 1) break; @@ -442,14 +461,12 @@ launch_test(struct test_case *pt_case) if (pt_case->func(pt_case->arg) < 0) ret = -1; - cores = cores_save; RTE_LCORE_FOREACH_WORKER(lcore_id) { - if (cores == 1) - break; - cores--; if (rte_eal_wait_lcore(lcore_id) < 0) ret = -1; + } + RTE_LCORE_FOREACH(lcore_id) { if (pt_case->clean != NULL) pt_case->clean(lcore_id); } -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:04.076286617 +0800 +++ 0044-test-func_reentrancy-free-memzones-after-test.patch 2021-11-10 14:17:01.797413358 +0800 @@ -1 +1 @@ -From d5559ac589953fa9f018aa581032e0f74bd49729 Mon Sep 17 00:00:00 2001 +From 8192dfc388446d9f199f105c244898f1d5843a1e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit d5559ac589953fa9f018aa581032e0f74bd49729 ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org