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 BB5F7A0547; Fri, 30 Jul 2021 13:27:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F6004067A; Fri, 30 Jul 2021 13:27:32 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id BB5E140042 for ; Fri, 30 Jul 2021 13:27:30 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id m12so6093485wru.12 for ; Fri, 30 Jul 2021 04:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gFHq3/tIpaaATLKcfrnRHZlMR5QqaWSt0O3+MSbqosw=; b=CHYKISEmY7Jdrd5uNQqITHLVZaS6kzy44shb6nn+gDRDLJM7dfIpz9uJECco0yjUY0 lx8A6jLgScLAoihRzw8QLIMVUcjqSiOfiw3G+wsra/Y4EiiGMyRUhCzNBQuYi4W1AnYQ YN1zLPQUdRjuP9r3fUtU8K9V+QUEvHHOh12azH5xtHdRVR/+mpkP/07nbwvnE7FvaQws c/qJI78+g+LAHpZrzWbMlxPK4w4bwffHUtU7Yr4/YOLw8yVKJpAyexdRFOnfsQLB7q+S C5jj020JDFw2MeJW6yl0jx8LV5/4Y2iqmM6KxNNS8pnCS5jDS27fKFZeeUS6GQSlJ51s Vz0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gFHq3/tIpaaATLKcfrnRHZlMR5QqaWSt0O3+MSbqosw=; b=hPgl4DR7lC4MU+8zzJmnWf1GVeEtE6UrX+hSD2LXuQ8iBlboHlZWn2ubf+/g5gxTLR AGWxZl1ocZQqdyln+bzNzqqEWDeCTtplMuz+FOpK00RoshG3wkq2HvGSFRl/vXBZfN65 OZYav8VUwiuRIxtlE8neStjGVqjfKkBdKg0RpjOR01ux9MmvriIzGBxi27bsa8kWn0pD z8ZJcHhIelE2O2+BevWUIgx3Y1LNDZF3GpKSDAb0tMisNkO/T+ws6gD/TiiNbVP3Y+t8 TYEmltCZx5omBTO9+ytTe9PX31WAWfv0F/4bsMt4r+ZOyFj779g9wzqmqhLvH2TFg3CV rKhQ== X-Gm-Message-State: AOAM530q7SR8sh+K+eaA9FN/tSeE+Q1vDukxZTh8PIi1kvURbiSlzCXN NV5+hz4uimZzJKc0U/GvVH7dag== X-Google-Smtp-Source: ABdhPJwwj+90/KWylVgcNlmFkT6O43++V+CrsqivBd9tFpOw5YjVTnYF6ydsi8bRUkranv8RRMJZlA== X-Received: by 2002:adf:ffc3:: with SMTP id x3mr2419734wrs.136.1627644450478; Fri, 30 Jul 2021 04:27:30 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id m64sm1623234wmm.41.2021.07.30.04.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 04:27:29 -0700 (PDT) Date: Fri, 30 Jul 2021 13:27:29 +0200 From: Olivier Matz To: Joyce Kong Cc: anatoly.burakov@intel.com, andrew.rybchenko@oktetlabs.ru, yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com, vladimir.medvedkin@intel.com, konstantin.ananyev@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, dev@dpdk.org, nd@arm.com, stable@dpdk.org Message-ID: References: <20210728073322.27011-1-joyce.kong@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210728073322.27011-1-joyce.kong@arm.com> Subject: Re: [dpdk-dev] [PATCH v1] test/func_reentrancy: free memzones after creating test case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Joyce, On Wed, Jul 28, 2021 at 02:33:22AM -0500, Joyce Kong wrote: > 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. > > Fixes: 104a92bd026f ("app: add reentrancy tests") > Fixes: 995eec619024 ("test: clean up memory for function reentrancy test") > Cc: stable@dpdk.org > > Signed-off-by: Joyce Kong > Reviewed-by: Ruifeng Wang > Reviewed-by: Feifei Wang > --- > app/test/test_func_reentrancy.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c > index 231c99a9eb..e4e9c2cc7c 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); > > @@ -454,6 +473,9 @@ launch_test(struct test_case *pt_case) > pt_case->clean(lcore_id); > } > > + if (pt_case->clean != NULL) > + pt_case->clean(rte_get_main_lcore()); > + Is it the same issue? It looks it adds the missing frees for the main thread (not only "fr_test_once"). I don't think it requires another patch, but a word could be added about it in the commit log. > count = rte_atomic32_read(&obj_count); > if (count != 1) { > printf("%s: common object allocated %d times (should be 1)\n", > -- > 2.17.1 >