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 31E83A0577; Wed, 15 Apr 2020 08:46:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 43E941D14B; Wed, 15 Apr 2020 08:46:20 +0200 (CEST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by dpdk.org (Postfix) with ESMTP id 8B1631D146 for ; Wed, 15 Apr 2020 08:46:18 +0200 (CEST) Received: by mail-lj1-f182.google.com with SMTP id k21so2471717ljh.2 for ; Tue, 14 Apr 2020 23:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1W3KgRM8m/M+ODWrz15U9yQUo9otbJ1cdi13f1ZXKe4=; b=Z0ibp0N9lO1q4RRFLnw7G1TVn7i3+rV3qj6oe14jrrFGOicyqWD3QflYLC5Eq3C/TD ixIwbObU0gxhkqlU0bTAQpMbzPsmpD4ymC2wBMGsnUqweHlGWtvPefmF82E9fM7eM1QB SpNRhCgZyhAJ+pSgsEUZdYRdA+7R3ccd5TRZDsBThX63yJMF9gACofrLp7ZOLaf7svRq s4s+D7R1FQP3P1/6AmEN1FbuhBXIYwvaBDuiMSgW7YeDVEZHd6xRiOh1wWnLYU4lhmaB 43eQOsfPDXmLrr8HDpLZN+aEn1UwPN2JL9MKw4v86JLJnjMY8Li0okR1VtIfH+HDX/pm sakQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1W3KgRM8m/M+ODWrz15U9yQUo9otbJ1cdi13f1ZXKe4=; b=Fv60XQ/BHdj2ysaozDF3lABBgARQdTaGvQPqhovvFEUsgzH1FZXGO2JoDT88mnWGUd ODpHFL1CPN2Mk9rsTNICnmiD85/kwTCpVAvUV0ioSGRp9j29NQQE1NkGe8LYdU455zOD MPYf/VMBX7fmnOikWnKPGzFeTNWF9Hqu74MXW7JxGbE+Ls/8kiHa7EDMG8ci+1pAdrQ6 INhv9+3ci2wi1zhL9HF9gbQCeCiAAHZqkglJUlMIaUplfd9eI34T2y12jT5atYdex+DO 1RMUa1bVNQLS03nDzZVXn4RUrsYnaCZVxKU/E+ML50/fLU+AXrqS6Add5IZilPFN58pJ HrdA== X-Gm-Message-State: AGi0PubERRFl23GqtH1y1mwtTeRQS6ETWAAoWF1B20Q3RwWkbSHARjqo VnTPbH/djVw7Paah1zdJCc2FD+znX+A= X-Google-Smtp-Source: APiQypIjVoFipXfh6kxdQBry1bK67P96DuU5Ndqht7ObTsx4tZiH1pbrGgud8ZyQ2yU1euodo8Dqmw== X-Received: by 2002:a05:651c:289:: with SMTP id b9mr2431579ljo.44.1586933177730; Tue, 14 Apr 2020 23:46:17 -0700 (PDT) Received: from localhost.localdomain ([39.40.22.141]) by smtp.gmail.com with ESMTPSA id a19sm11884149lff.11.2020.04.14.23.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 23:46:17 -0700 (PDT) From: Sarosh Arif To: dev@dpdk.org Cc: Sarosh Arif Date: Wed, 15 Apr 2020 11:42:38 +0500 Message-Id: <20200415064238.24012-1-sarosh.arif@emumba.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413091906.782-1-sarosh.arif@emumba.com> References: <20200413091906.782-1-sarosh.arif@emumba.com> Subject: [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" 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