From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0085.outbound.protection.outlook.com [104.47.33.85]) by dpdk.org (Postfix) with ESMTP id 3A7E45599; Thu, 11 May 2017 12:31:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=V8GcUtMyve+4IQL7RFjqVFXVczn8oCzxerCoT12ShRM=; b=fGPdYW8NkP0t/qArZDNfK69AN1beMdf8JHE7dtzCRuOIinOsiNcFWtGFo5T+4o20r5Qe6jLnvixjGwK7BT+4+dTOhmniHR0NMbHdgG0V/A8CgUQ2dCAmfCtMey2D107DdOJwxNmXra60U9zKkOVKQPESSjhjDaOnlHf6qZOVJQM= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (111.93.218.67) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Thu, 11 May 2017 10:31:31 +0000 From: Santosh Shukla To: olivier.matz@6wind.com, dev@dpdk.org Cc: thomas.monjalon@6wind.com, shreyansh.jain@nxp.com, Santosh Shukla , stable@dpdk.org Date: Thu, 11 May 2017 16:00:44 +0530 Message-Id: <20170511103044.14298-2-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170511103044.14298-1-santosh.shukla@caviumnetworks.com> References: <20170511103044.14298-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0026.INDPRD01.PROD.OUTLOOK.COM (10.164.137.33) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86eedea5-646e-46f3-5d9f-08d49858e57f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 3:XfZQi9fhjyAMnubTPwynYK2YcxADe1QlSvwBHJs12LYnBi4d5OllniPJ6oiSP6YOpGnWHJy6UU4cQ1aSE/eH9/2mrI+7zUFBfgczfOOfUg1JcEToziRR5vHe3LDY6FLsFFD776jaA9Ixos34zb03zY3V3+f/zuXT3Iiz0uJ+2MqVTuwzz7uJmVamE4zkVop7z/RzV3CPWWLm9aWcuQUAziWn1DHg9AcTVke0vvjuWe0ntt8CIY3e5JvV85n4YEdKwbwjDkY12+cbutD+PMBsV1Rd+bqnHTxZkp3qsVmTtmr5LGrVuEBzSlRgCaXTf4EIV3cQ7KK+26mlPA52jjG9EQ==; 25:6WqFtt2bG7QkdeqB4HWuVYKfX9SahYVvMEL8hga0sAhYx19H3yvO3rwyHt8sFgWSQovtJ4ro/dIzzqeBgHGiBPR/MS9pX6HdWcdHqOAOwCOyjUj7S0qhYJOXJouEwIBrNTPZjUTNPpWDDMSvWt2vm17Puam0nCx/mfEyVj7ubmdx4d/TDP9IfkgfBnOF1U3xRb6IWTfeHXcb8ZYFIqX6HgdVlPCH4hscWN3CRMIcXEFe7MLHb6V6/1kmsxnjFZOR1top1rUxirLgmphgJ3Ydwx9P1Mc+S09mCw+lT8AEYcAFT13hkT++pykPi5uT9SGfCta2ET4/HvS8Y/2PCkYHdEQtonw5b8iD6t4kIBrWsaDgUAzQzXZUCl9M92hiykhUkTQy05QWTx5WwwGcjVjSQzq7F0ok719HLZ68Woylcas7d7F+slpNNRJLUXUug9XbNABG/9bzBveEctgAcRKhaCVQBR2dEIPa31WBGq+kcHA= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 31:4uhFSVoH/2gbA6uuopgGwcvpA3yTl3oLlq1HOVKxjtNgvZe2Bihuqhj8fSmy1rFvup7ugABs4r9t6RYSg3CTauAD8Mp41J2Kvc2A41PIHsbxVzFUI22bD7pbzgGLidFY8ntRN4q/tGOVqNgOdLmVj04ZMtawhd815yb/w2veOW0B7u6NjIPzW8vo7kNkrD1gFczgXSs7PJNJJjHB28F0ooa31EAdolb8X3mr5O72yoc=; 20:dQbK51jm0RFBLTy4F4UaUnjCna22xLxrAnpv4pQLhO5q/jCrYcyexzecLNsM2QZeE/gCvn0uTmn0JDOOpoaX+Gvj9Ienn4NVFDaOvm/bl3R3pWuiMqi0GnGKwvbCizDGCwqK0USKOBXy2Pi4Vft4/+B19wj5xyWr2hIRqUjdBB+1WZ8KcpsVCWjfzNE9hyW+MZjLk3vAqsEf4b8UTDWqYx8WW+DcKdldK5INvbfkKf9wQ7r6dajr9m6cCY2ZjtM1uKAiOc13AK0H/9Z9AlOwS9ORSf6IhjPILD/Snoep0lI8TPKc5/wSiynMg7OwcXVVAvzmeYoy7V2cIOfyXXH7GtMmk9LCw/Gv4TP3OrU4j9FaSKBoS5DJMhRZlKTY9aKb/hyrh5UAI9xK3ULw2HZ4//7rZQGjL5ri5zfHCG+tjHMwUjzhuCqSy34P51D9sK/r7akdUIbmSfGu59mWBsvzBS34EbBxZB1QaJQCBLWtgfTb45cbVXBT1DNsynj22M4lQLIr6991utJzZ/aoKoH2tasB4O/c7HyKHx1zLkGm2Prpaxmcf+bsJPOR7aplHAGeogGjbSy1F7GS91Jed/NrsHjywBnUEjrBOT5ziT1vMLM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(6041248)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(6072148); SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:zZXX1DpQf5ZR2FYijjTrJKdzB5tT4FufksfP4bf6LQRZMruYtQoAhu0+ayYwKWrwVQ0A4WiJxeeRdy5Lp1ANBCVKgaG92E3K5ShD0k5TyNo9Zs6WEPm/Kpzsx8tcNnQi0442mM1RfNrR5SHMZX6+AiExCHs7VL9kNC7GLAOT2SffA/V9MzBETXRNkgO+y7vvaLwm9AXVpfa4y7o5dk5oytSdGxWkbOkIYLZ5pcMD+ZtP4wYwNi/Ww2HsHbD0wqCzH/2oN95jh4bjLmUtsX+tLd8gY4s9x1Q6q0DHTcLdYcMwaNNVYvSGIPF7ObdAE887AyphGrmmOOo9tv72PyS5hrzfFUeBXLzzRIPIF90t2EF0do9tJdeqlXjebIgx2ECVt9Bhkwmg7zqMNPMPJXNhKVIr6MbSnwAmN70UbzOp5n+tAviLaPO2fUmiNe8BKpeRjKuhHJ1Q0AMfe+8+xImA1jidJZytQgOQxS2NU5H6djzEoqbGQyAWYUtSuYz2IgW77tDHvosKqwnmfDfBQqDBzWNX+U613vgns73bvGsKtUKTiVqwre+Rp3nqHUUC0H+9Ooc1bE9SNwG61fApudrrMlisXEBtySBYO9gS3UQyGdUv/ATLRHSlrHmDnK491kU3LdunQ+vNiQpTD+2TEmGbXZv0iiOmWBO40ch8pzLcrT624MVyWqs6g1R2NQ5hyvdhmCA+xzrMZ1QuWdexC+gC8c9z/+hTMXtw5A951uQjtZ833NiHh9v9IA8kFjeSLzrgJSIm4FFENveepup9Uzl0bA== X-Forefront-PRVS: 0304E36CA3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39850400002)(39400400002)(39410400002)(39840400002)(33646002)(36756003)(48376002)(50466002)(2950100002)(5660300001)(6512007)(66066001)(81166006)(6486002)(8676002)(72206003)(3846002)(305945005)(53936002)(7736002)(189998001)(50226002)(2906002)(47776003)(478600001)(6116002)(42882006)(5003940100001)(1076002)(50986999)(76176999)(6506006)(42186005)(8656002)(5890100001)(6666003)(5009440100003)(4326008)(110136004)(25786009)(38730400002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1718; 23:9zpNkxyT+vram+z7J3uP35uWsV20/88yXlBQba0?= =?us-ascii?Q?KTwq7mHqWrxD44Jf2EebkCJ+VKWQvoHRYDv3GKDajL2CUjru1FxqN/Lu2WaJ?= =?us-ascii?Q?gmtZLECP7wTIvzJJjIyEsGUF2IxfzNUTCWL53Nlg6XqUEQsUSB35ts5KODog?= =?us-ascii?Q?Zs++pU1JkEG9ntscuc1Rht6CG6J+4Pn2wmuDNGm3GaXMLR1toCrwLjbDDSXx?= =?us-ascii?Q?SlWG+TXW3qm/flCAkaRzo6eJ2VB7pbH3IlrEYk5IPiym2PB1yyt8lFDyLZNl?= =?us-ascii?Q?BQJ/3xxMhVR981nnBNB1UQc5UZtnTJXl+X9Ij5v+C8fv5/u6fmc6eFtqwQxY?= =?us-ascii?Q?FaFmHWmhwT3x43zPDs+x1dbRKL3U7gWtZl3lR63bH3Z5DRziiy6CDdwMhuy2?= =?us-ascii?Q?3FC7q4CCXvqFBJxj6G5wAR6zeHwAcnx1P4TVdXGh8LbRUFYo4EmNZXyS4C34?= =?us-ascii?Q?GQBVO+d7OXBTCV3xZYdJ/HuH5Ex7coJcYd3DtUzZQYMpuzM/XrxP+yPzXx6k?= =?us-ascii?Q?RHCIZryktorbMWk+4to2QN9z9caZB3OdcTtdnsVeEmWsCmqFxGXGaKyjWksk?= =?us-ascii?Q?zIW1yztDu9XMrK4K0k+QRiqpRH0JAO63mJMv3G0dM1x8h4MrBNRRWjYEMeur?= =?us-ascii?Q?54hxGQv5HHqb0oSzR/8gNIGIf3kI6Yhll6u9j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ATcIdHvLo3Ry+SFFIFR51PTLnQrAVtipIjmyS3uUvaPyHI0Zsp7NDy8f2SblXkSMsjiF/+Zh/MIqSN9OqHXtwrdXhg==; 5:Mx/iTynRz3udoUtTwpGg+sYeBmFlxprLL/hJhWVGJ2vqJh+7c4QcL/w07qOO7mlEJLjdZqkJQzlsladiMUx30v5CIazrYDa72PsbBtmn/9+yN6X13Nk2GnC4NQJr/IqOL6cmtgtMt94X3L53xi7v4g==; 24:K8s7pTzDZWBY1P3RYgEEUhrSdfn8eXSAeGhlM+dINW4NV5dp7WlI/rxarMO/+/wK4NXvtprggJsZDShfzz9oWyxfKOcz8HtKIs9Yh131IJU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 7:anqHnhJxtvxLXmNC/S/43D8wgKT7UNKG/9AfK6HJ7yaRjRCuPFaUT8Iq4UWxDHEVQN1vVeWkQp6q4xdGNyVJQ54+5+WfwgEkgj6TGwEA54SK1GeceRhsOh2s982MzuodDNVtUQW6oNbL4DdMMrWdulMkIleEXSVfbH0AXA01PXGRIgP4qr0WJHbTfW3GQJTgppNrrkaAygG7bT8aT3ChBIOQLdyTTfwv1rbc4UOBLC3E4ggIQp4r5b0nUDsDINgsCF4vSOQeLuQwXGI9ZDm3lpynIl5VovbSWNLo/oYdGdNJZFDR5JilECSNBuZlYvtzwalKaTUhYtwfjMRuK4pDcQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2017 10:31:31.4705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH 2/2] test/test_mbuf: Free mempool on exit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2017 10:31:35 -0000 Cc: stable@dpdk.org Signed-off-by: Santosh Shukla --- test/test/test_mbuf.c | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c index ba93ac783..d6cf4d611 100644 --- a/test/test/test_mbuf.c +++ b/test/test/test_mbuf.c @@ -784,6 +784,7 @@ test_refcnt_mbuf(void) { #ifdef RTE_MBUF_REFCNT_ATOMIC unsigned lnum, master, slave, tref; + int ret = -1; struct rte_mempool *refcnt_pool = NULL; struct rte_ring *refcnt_mbuf_ring = NULL; @@ -812,7 +813,7 @@ test_refcnt_mbuf(void) if (refcnt_mbuf_ring == NULL) { printf("%s: cannot allocate " MAKE_STRING(refcnt_mbuf_ring) "\n", __func__); - return -1; + goto err; } refcnt_stop_slaves = 0; @@ -839,8 +840,15 @@ test_refcnt_mbuf(void) rte_mempool_dump(stdout, refcnt_pool); rte_ring_dump(stdout, refcnt_mbuf_ring); -#endif + ret = 0; + +err: + rte_mempool_free(refcnt_pool); + rte_ring_free(refcnt_mbuf_ring); + return ret; +#else return 0; +#endif } #include @@ -1054,6 +1062,7 @@ test_mbuf_linearize_check(struct rte_mempool *pktmbuf_pool) static int test_mbuf(void) { + int ret = -1; struct rte_mempool *pktmbuf_pool = NULL; struct rte_mempool *pktmbuf_pool2 = NULL; @@ -1066,7 +1075,7 @@ test_mbuf(void) if (pktmbuf_pool == NULL) { printf("cannot allocate mbuf pool\n"); - return -1; + goto err; } /* create a specific pktmbuf pool with a priv_size != 0 and no data @@ -1076,31 +1085,31 @@ test_mbuf(void) if (pktmbuf_pool2 == NULL) { printf("cannot allocate mbuf pool\n"); - return -1; + goto err; } /* test multiple mbuf alloc */ if (test_pktmbuf_pool(pktmbuf_pool) < 0) { printf("test_mbuf_pool() failed\n"); - return -1; + goto err; } /* do it another time to check that all mbufs were freed */ if (test_pktmbuf_pool(pktmbuf_pool) < 0) { printf("test_mbuf_pool() failed (2)\n"); - return -1; + goto err; } /* test that the pointer to the data on a packet mbuf is set properly */ if (test_pktmbuf_pool_ptr(pktmbuf_pool) < 0) { printf("test_pktmbuf_pool_ptr() failed\n"); - return -1; + goto err; } /* test data manipulation in mbuf */ if (test_one_pktmbuf(pktmbuf_pool) < 0) { printf("test_one_mbuf() failed\n"); - return -1; + goto err; } @@ -1110,45 +1119,50 @@ test_mbuf(void) */ if (test_one_pktmbuf(pktmbuf_pool) < 0) { printf("test_one_mbuf() failed (2)\n"); - return -1; + goto err; } if (test_pktmbuf_with_non_ascii_data(pktmbuf_pool) < 0) { printf("test_pktmbuf_with_non_ascii_data() failed\n"); - return -1; + goto err; } /* test free pktmbuf segment one by one */ if (test_pktmbuf_free_segment(pktmbuf_pool) < 0) { printf("test_pktmbuf_free_segment() failed.\n"); - return -1; + goto err; } if (testclone_testupdate_testdetach(pktmbuf_pool) < 0) { printf("testclone_and_testupdate() failed \n"); - return -1; + goto err; } if (test_attach_from_different_pool(pktmbuf_pool, pktmbuf_pool2) < 0) { printf("test_attach_from_different_pool() failed\n"); - return -1; + goto err; } if (test_refcnt_mbuf()<0){ printf("test_refcnt_mbuf() failed \n"); - return -1; + goto err; } if (test_failing_mbuf_sanity_check(pktmbuf_pool) < 0) { printf("test_failing_mbuf_sanity_check() failed\n"); - return -1; + goto err; } if (test_mbuf_linearize_check(pktmbuf_pool) < 0) { printf("test_mbuf_linearize_check() failed\n"); - return -1; + goto err; } - return 0; + ret = 0; + +err: + rte_mempool_free(pktmbuf_pool); + rte_mempool_free(pktmbuf_pool2); + return ret; } REGISTER_TEST_COMMAND(mbuf_autotest, test_mbuf); -- 2.11.0