From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 099B5A0577; Wed, 15 Apr 2020 09:06:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DCCB31D178; Wed, 15 Apr 2020 09:06:26 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id CD8771D14C for ; Wed, 15 Apr 2020 09:06:24 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id i19so16005430ioh.12 for ; Wed, 15 Apr 2020 00:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c7Ce6ECqtCuFNmJ5pOcdsFJnbW1x5wIP4GNfoHDHDvE=; b=B6on17xLFjkcowfIa1Pl1OgExRMBKhPPf1Dph78SVcMZpGFoMeR9p6oo5CQi35JOYb 3MubZDEWFn70iXdUN+HVbit1t7zuehm1pD0YSFgs7XdF+Pm94i/QtD8kxqIBIy9c8dnM v7TJmYPrXO4nxlaYrRcxH8YFBypKQcORi8/OD+9dC7cV/N5IAlEwycuau41g8hLfVRr9 IyWyZBovNdgmOxezvt44n1SshuasETT3TXxxIj4ePlkIv/S7n9Gs7+KjOUF+HEAL+/Bb x45KCVge366OQYXPftMbC5/jV/fS12BP4365CbsJ/JCiuJLOKrBH41FfYCZYThSuqken SNUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c7Ce6ECqtCuFNmJ5pOcdsFJnbW1x5wIP4GNfoHDHDvE=; b=AHuy0y8E29PGRuJiNOzGGTcYslMueoKpCEyUDHka+SCzUEKldKFtUXTw3Yd5xynJHi JJcv/kN9mT0q/tkpwUkGuEZJrpq2+n1Q3Ak1JYPAZDbwh0mWz1IJPK4NZxaL6sIbSTQw Vs1J7JWhdwJ3Zp8sF4o5+ph8RAF3VwOdj1jRU0cauZrYfhjCEHlmzO2MxtHZ7EAWqVPu AUedrVTlHyftUPJ9l+8l1IKO3vTlPs8GljSblWcg5xapeoa9tJVcNvveGIgCtt5AM1QT C5VRpOBcsBlLUs+6G6ETTlUOAPDkzHB2+VT1RDOKKJRB2lmkaFEDu/wAd1P8oZmirHu3 phPQ== X-Gm-Message-State: AGi0PuYMZakwHFAB6o05bm8L9Dy1S69dysAJn+kaJq6v5SNzk004Lyu9 s1nrFlHj6d2pXS7tZ/xltuFeY9vtJIo/4huT4Ml/dw== X-Google-Smtp-Source: APiQypLYq2rAR/Gbvr0WDghX2x38yYyip8DAjR4skV3J+RCNBvEno95alV8IlFY8Eb4cNotyeSQJWWkAJX7GWFeqO/M= X-Received: by 2002:a5d:8c93:: with SMTP id g19mr24873615ion.33.1586934384062; Wed, 15 Apr 2020 00:06:24 -0700 (PDT) MIME-Version: 1.0 References: <20200413091906.782-1-sarosh.arif@emumba.com> <20200415064238.24012-1-sarosh.arif@emumba.com> In-Reply-To: From: Sarosh Arif Date: Wed, 15 Apr 2020 12:06:13 +0500 Message-ID: To: Lukasz Wojciechowski Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2] app/test/test_distributor.c: prevent memory leakages from the pool 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Yes, I plan to work on them when I get time. On Wed, Apr 15, 2020 at 11:52 AM Lukasz Wojciechowski < l.wojciechow@partner.samsung.com> wrote: > > W dniu 15.04.2020 o 08:42, Sarosh Arif pisze: > > v2: > > remove double freeing of mbufs > > > > Signed-off-by: Sarosh Arif > > --- > > app/test/test_distributor.c | 9 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c > > index ba1f81cf8..5e972bb2e 100644 > > --- a/app/test/test_distributor.c > > +++ b/app/test/test_distributor.c > > @@ -128,6 +128,7 @@ sanity_test(struct worker_params *wp, struct > rte_mempool *p) > > printf("Line %d: Error, not all packets flushed. " > > "Expected %u, got %u\n", > > __LINE__, BURST, total_packet_count()); > > + rte_mempool_put_bulk(p, (void *)bufs, BURST); > > return -1; > > } > > > > @@ -153,6 +154,7 @@ sanity_test(struct worker_params *wp, struct > rte_mempool *p) > > printf("Line %d: Error, not all packets flushed. " > > "Expected %u, got %u\n", > > __LINE__, BURST, > total_packet_count()); > > + rte_mempool_put_bulk(p, (void *)bufs, BURST); > > return -1; > > } > > > > @@ -179,6 +181,7 @@ sanity_test(struct worker_params *wp, struct > rte_mempool *p) > > printf("Line %d: Error, not all packets flushed. " > > "Expected %u, got %u\n", > > __LINE__, BURST, total_packet_count()); > > + rte_mempool_put_bulk(p, (void *)bufs, BURST); > > return -1; > > } > > > > @@ -233,6 +236,7 @@ sanity_test(struct worker_params *wp, struct > rte_mempool *p) > > if (num_returned != BIG_BATCH) { > > printf("line %d: Missing packets, expected %d\n", > > __LINE__, num_returned); > > + rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH); > > return -1; > > } > > > > @@ -247,6 +251,7 @@ sanity_test(struct worker_params *wp, struct > rte_mempool *p) > > > > if (j == BIG_BATCH) { > > printf("Error: could not find source packet > #%u\n", i); > > + rte_mempool_put_bulk(p, (void *)many_bufs, > BIG_BATCH); > > return -1; > > } > > } > > > > 2.17.1 > > > The sanity_test is ok now and does not have any mempool leaks. > > What about other tests in this file: Do you plan to work on them also? > > -- > > Lukasz Wojciechowski > Principal Software Engineer > > Samsung R&D Institute Poland > Samsung Electronics > Office +48 22 377 88 25 > l.wojciechow@partner.samsung.com > >