From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id A3BBD1B79A for ; Wed, 7 Feb 2018 10:00:20 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5B71520C39; Wed, 7 Feb 2018 04:00:20 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 07 Feb 2018 04:00:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zD3G5jLGK/fCeee3/ wYMGXpSe7l1Ez/CsGvDUHqvRjw=; b=mYBb2L2cOmLqec2GdP1Ikoc9vLlXFySsV 89XWAyxomX1pcsMQhU/CINCflp3vt+8+uy8RfJP6L8L1KXlr2Ex0Ic3lTMmvZAsJ v3NNt3Lg0DFkhygSOFJYVs0cBSRBKvsgiZeIPa/+X3XgHhkoMZ+WRSP7br34IYKy EU8aXifTebn2gi+tLXJSRajrQeoIWDJKrg01MRLGXbAu0r04iA60t1gI6TAllWXu XfHX736yTLeJP0oB9JUC9gpD6FwenQ1rO9X2wWqbaNtkM+jmHwyC+fcaGD0U/3zz ht37OLnTnKQEaJtZbOtu1v+Pbgb0416IQPYdCXkn53+2M/n3z8shw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=zD3G5jLGK/fCeee3/wYMGXpSe7l1Ez/CsGvDUHqvRjw=; b=E8w9HmLZ khhqMnaac4tryNHgQ975wYU+n/07DeD2IyoPL0jOjUoEIm1R2PD6tmoZxRdtozy3 /pyHcf9n4mk5P47/g4R1XrGIczOikIo0d28P5GX80LizYmZdSj7Fhcc/DY2UzU0/ 0EB/V9D97g/fYDRi9Z8+LYDjk4Tk7gFw1LXMOueMxn07UFZA5CO7lJxvUs35o5GH JSgIOeuhQ49McdbthpzBtXVjjshodOO4CJgqiH6ypKlDQ/BOM7NdSYmvdRuObcgu 1m0jgpzBFJwB/DF6DomS/D7EIah7l/l7hTy8JqrnPlIaKBf0NinuyUq82q8Mh1W5 DFAn2qlz0mQFsw== X-ME-Sender: Received: from localhost.localdomain (unknown [182.84.161.100]) by mail.messagingengine.com (Postfix) with ESMTPA id 2811324636; Wed, 7 Feb 2018 04:00:17 -0500 (EST) From: Yuanhan Liu To: Anatoly Burakov Cc: Cristian Dumitrescu , dpdk stable Date: Wed, 7 Feb 2018 16:57:16 +0800 Message-Id: <1517993838-26692-22-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> References: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'test/table: fix memory leak' has been queued to LTS release 17.11.1 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: , X-List-Received-Date: Wed, 07 Feb 2018 09:00:21 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/09/18. So please shout if anyone has objections. Thanks. --yliu --- >>From bb09db9f5aab59f919e1b5464b9e69017883cc8b Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Tue, 6 Feb 2018 13:35:41 +0000 Subject: [PATCH] test/table: fix memory leak [ upstream commit c1d30e443b624f8281b08ae7651feaf4b5ba1a09 ] Always deallocate allocated resources after the test is done. Fixes: 5205954791cb ("app/test: packet framework unit tests") Signed-off-by: Anatoly Burakov Acked-by: Cristian Dumitrescu --- test/test/test_table.c | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/test/test/test_table.c b/test/test/test_table.c index db7d4e6..c5a6e00 100644 --- a/test/test/test_table.c +++ b/test/test/test_table.c @@ -84,6 +84,14 @@ uint64_t pipeline_test_hash(void *key, } static void +app_free_resources(void) { + int i; + for (i = 0; i < N_PORTS; i++) + rte_ring_free(rings_rx[i]); + rte_mempool_free(pool); +} + +static void app_init_mbuf_pools(void) { /* Init the buffer pool */ @@ -142,18 +150,20 @@ app_init_rings(void) static int test_table(void) { - int status, failures; + int status, ret; unsigned i; - failures = 0; + ret = TEST_SUCCESS; app_init_rings(); app_init_mbuf_pools(); printf("\n\n\n\n************Pipeline tests************\n"); - if (test_table_pipeline() < 0) - return -1; + if (test_table_pipeline() < 0) { + ret = TEST_FAILED; + goto end; + } printf("\n\n\n\n************Port tests************\n"); for (i = 0; i < n_port_tests; i++) { @@ -161,8 +171,8 @@ test_table(void) if (status < 0) { printf("\nPort test number %d failed (%d).\n", i, status); - failures++; - return -1; + ret = TEST_FAILED; + goto end; } } @@ -172,8 +182,8 @@ test_table(void) if (status < 0) { printf("\nTable test number %d failed (%d).\n", i, status); - failures++; - return -1; + ret = TEST_FAILED; + goto end; } } @@ -183,21 +193,23 @@ test_table(void) if (status < 0) { printf("\nCombined table test number %d failed with " "reason number %d.\n", i, status); - failures++; - return -1; + ret = TEST_FAILED; + goto end; } } - if (failures) - return -1; - #ifdef RTE_LIBRTE_ACL printf("\n\n\n\n************ACL tests************\n"); - if (test_table_acl() < 0) - return -1; + if (test_table_acl() < 0) { + ret = TEST_FAILED; + goto end; + } #endif - return 0; +end: + app_free_resources(); + + return ret; } REGISTER_TEST_COMMAND(table_autotest, test_table); -- 2.7.4