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 7EABCA0C4C for ; Wed, 1 Dec 2021 11:31:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7610840140; Wed, 1 Dec 2021 11:31:57 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 30AE740140 for ; Wed, 1 Dec 2021 11:31:56 +0100 (CET) Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A40E33F1BC for ; Wed, 1 Dec 2021 10:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638354715; bh=kj9QDTXSTQY2KO632BDOqEfcRJ5bJl3YfbznB1XQeKo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=s0lwHJaTZHAhiIzLOh//Jh9stEK66+rCxUt9QWizBgLFDrJg0oDVY4VqcJJZeUDY2 Yx0Sigx7rfipMtTsX4yxqZwyQeKPCMmP+j4Bgzfn4spAVKLiTTkQRx34dWH3FhNamK b9mezBNrveVJSX7ZKGknTSZ4VQQhu6ANC+pm0ZKuB3Yr0Upk98jL+fKI3YaTMhYKnq MMGu1bX1hGHYMYEqnRz+EVLyTqZ7iwaEm/uwGafpLv278oObrYGI5FHiaOGI9rEa0L nOPonfcuA6EeqpWzUVULeEYkFtjUd/UxWEvdIQIKEjyB0DtV4xtGQb6dPFMGX8M0vy gZDytoO6U48kg== Received: by mail-qk1-f197.google.com with SMTP id br9-20020a05620a460900b0046ad784c791so32499496qkb.4 for ; Wed, 01 Dec 2021 02:31:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kj9QDTXSTQY2KO632BDOqEfcRJ5bJl3YfbznB1XQeKo=; b=wCNsR+pojV5xbbjQNDuRmGy9z3SqxBH9SbnHVQXl87Leb+yYoJzbxTsvre8F+v778i OgPssPM3IHp5BM1Jd5z9+YWYt0OiT3Bdxbdr9Skf2s58bjwvuMsSyD+TX2wkw1CIElLP prRGZR/H2ZK0mAvSuKWtniUpQgBsNFALU83b0maNyyV5osaGctjJeRIzD40pvJPnfPOU gnddQXZjpfJCvcC1UKdszjwNewwfgqDs0etSfYz8cwaVLCl3kFdYgqd25Ib7a0483VeN fqquj2kanzENr4roitlgRJSK+VAafhQAJJBrWqyBH1jX6n97MjXgZdQlyWM0xyhb+xts b+0Q== X-Gm-Message-State: AOAM533X50djcK78h93VRXvtf1dxFvNbNvIm4Or4eB7gywh/Cap1eKO5 aWtYlzdB8sMMmtFDiCr5V/Q+UlRz0pk62acA7252AcCdL1hHm90E5NIvPEqpbDW9sDUh15KdpGS QHy3yGQ6U57qgzTHB18HSFnB1VO1Pbviqwf7x9VIN X-Received: by 2002:a05:620a:1aa0:: with SMTP id bl32mr5149605qkb.140.1638354713747; Wed, 01 Dec 2021 02:31:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoYVqnHTButD/CJBAOxHLR4L9754hktiIntX+KzoPgC37N5TDH1RoVrBuiTVR+PUZcimvdl4HaWxURpsNUx3Q= X-Received: by 2002:a05:620a:1aa0:: with SMTP id bl32mr5149580qkb.140.1638354713501; Wed, 01 Dec 2021 02:31:53 -0800 (PST) MIME-Version: 1.0 References: <20211201081332.1591507-1-joyce.kong@arm.com> In-Reply-To: <20211201081332.1591507-1-joyce.kong@arm.com> From: Christian Ehrhardt Date: Wed, 1 Dec 2021 11:31:27 +0100 Message-ID: Subject: Re: [PATCH 19.11] test/func_reentrancy: free memzones after test To: Joyce Kong Cc: stable@dpdk.org, nd@arm.com, Ruifeng Wang , Feifei Wang , Olivier Matz , David Marchand Content-Type: text/plain; charset="UTF-8" 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 On Wed, Dec 1, 2021 at 9:13 AM Joyce Kong wrote: > > [ upstream commit d5559ac589953fa9f018aa581032e0f74bd49729 ] > Thanks, applied > 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") > Cc: stable@dpdk.org > > 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 | 30 +++++++++++++++++++++++------- > 1 file changed, 23 insertions(+), 7 deletions(-) > > diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c > index 4767c0cfa..969c6eb0f 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); > > @@ -420,8 +439,7 @@ launch_test(struct test_case *pt_case) > { > int ret = 0; > unsigned lcore_id; > - unsigned cores_save = rte_lcore_count(); > - unsigned cores = RTE_MIN(cores_save, MAX_LCORES); > + unsigned cores = RTE_MIN(rte_lcore_count(), MAX_LCORES); > unsigned count; > > if (pt_case->func == NULL) > @@ -442,14 +460,12 @@ launch_test(struct test_case *pt_case) > if (pt_case->func(pt_case->arg) < 0) > ret = -1; > > - cores = cores_save; > RTE_LCORE_FOREACH_SLAVE(lcore_id) { > - if (cores == 1) > - break; > - cores--; > if (rte_eal_wait_lcore(lcore_id) < 0) > ret = -1; > + } > > + RTE_LCORE_FOREACH_SLAVE(lcore_id) { > if (pt_case->clean != NULL) > pt_case->clean(lcore_id); > } > -- > 2.25.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd