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 E85DCA04AA; Tue, 8 Sep 2020 12:22:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 97CCA1B9B7; Tue, 8 Sep 2020 12:22:44 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id CD0E92BAB for ; Tue, 8 Sep 2020 12:22:42 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id y15so3971293wmi.0 for ; Tue, 08 Sep 2020 03:22:42 -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 :mime-version:content-transfer-encoding; bh=J3BkEuXX33QUGlJE6t7xmISlOxh3DKRSb35qyhUiY+c=; b=FZc9fCwvoQ+PBrEOLAOZibgb8v42wg7rqNtZ89leZkTv6UmxMXkKslkGdZuMfFno3G HFFhloV+TfKyPU2jGcoU+5MqczwVtde+iHSrJCelyF1h1t+8M5Vf534oZq9eUNGZQrXv +A923RNWS7okluEgVEUexy00x1k4XCXHzWD6MdooVWIHMfvEy3rx1+av7vRmjE/AqOtT zVoo6NA8tI6pq7FKBxDmd8oPSt3PdO+CJLU2+REzrKsIS005qRvAcwmq8sr5YO2aftdC 8dq+gSr0++j7O8AEWDDyEBinY1whrM/iAlBLc4CfbNWac1OfFXOTOVwI29YXbX/fj5Aj 86jA== 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:mime-version:content-transfer-encoding; bh=J3BkEuXX33QUGlJE6t7xmISlOxh3DKRSb35qyhUiY+c=; b=TqfdnXgt0bUNcbZBiNRCylFvcXFbknGmArVZkBQ7qTFn5813H9l2Id5Puy4INfK6Eu i0Oe4eQwOetHBHisM/yI0H0jgIMae+LxXEFh29+Iqrlmy3esX3/YKSqljKWAOSE2ffJw n6QUeloDQM8rPHZv9yjA+B9RKZLyR8iFsZHiFz22Da+yjlqj4ZSRtQCpdxt1ZnFS8THL A3U7furxaCsfq2pykHVOzBNOL/Z/j5n7+JHZiqpybeTvt3ePDRUM6YU6b3W6pbNpeZl9 wUU01kmrsdqksaGYYv8d6rs+3uffSUeBV0Tr9I0ssS9eQ0JhRmtIqkJ/sRttNg5/s6Bj w9Rw== X-Gm-Message-State: AOAM530hBzAfUJQwx/b7nYlX+vDxLHnAKaIz1kLDKjhm8FnlyPdApdNd bqjHYuv35JX76VL6kUOzR+97a0uLd1frKZ/Y X-Google-Smtp-Source: ABdhPJxFON+b7ioF1wrN2qzOdkhnayuJ54IW4C/7q8wVV9ssfjxkkqoJySoXFvuRWSIEgRs8wtTAow== X-Received: by 2002:a1c:234b:: with SMTP id j72mr3693494wmj.153.1599560562533; Tue, 08 Sep 2020 03:22:42 -0700 (PDT) Received: from localhost.localdomain ([101.50.95.20]) by smtp.gmail.com with ESMTPSA id z15sm32797266wrv.94.2020.09.08.03.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 03:22:42 -0700 (PDT) From: Sarosh Arif To: l.wojciechow@partner.samsung.com, david.hunt@intel.com Cc: dev@dpdk.org, Sarosh Arif Date: Tue, 8 Sep 2020 15:22:04 +0500 Message-Id: <20200908102204.727240-1-sarosh.arif@emumba.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200415064238.24012-1-sarosh.arif@emumba.com> References: <20200415064238.24012-1-sarosh.arif@emumba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [v3 PATCH] test_distributor: 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" rte_mempool_get_bulk is used to get bufs/many_bufs from the pool, but at some locations when test fails the bufs/many_bufs are not returned back to the pool. Due to this, multiple executions of distributor_autotest gives the following error message: Error getting mbufs from pool. To resolve this issue rte_mempool_put_bulk is used whenever the test fails and returns. Signed-off-by: Sarosh Arif --- v2: remove double freeing of mbufs v3: resubmit to run the tests again --- app/test/test_distributor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index ba1f81cf8..1a893a7d9 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.25.1