DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Fidaullah Noonari <fidaullah.noonari@emumba.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v3] app/proc-info: add rte_eal_cleanup() to avoid memory leak
Date: Thu,  3 Oct 2024 19:48:29 -0700	[thread overview]
Message-ID: <20241004024903.209976-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20220904122845.141893-1-fidaullah.noonari@emumba.com>

From: Fidaullah Noonari <fidaullah.noonari@emumba.com>

when app is launched with -m proc-info exit without
rte_eal_cleanup() causing memory leakage. This commit resolves the
memory leakage issue and closes app properly.

Bugzilla id: 898
Signed-off-by: Fidaullah Noonari <fidaullah.noonari@emumba.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
v3 - handle eventdev_xstats as well
     rebase to 24.11

 app/proc-info/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index b672aaefbe..4a558705cc 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -2166,11 +2166,11 @@ main(int argc, char **argv)
 
 	if (mem_info) {
 		meminfo_display();
-		return 0;
+		goto cleanup;
 	}
 
 	if (eventdev_xstats() > 0)
-		return 0;
+		goto cleanup;
 
 	nb_ports = rte_eth_dev_count_avail();
 	if (nb_ports == 0)
@@ -2251,6 +2251,7 @@ main(int argc, char **argv)
 	RTE_ETH_FOREACH_DEV(i)
 		rte_eth_dev_close(i);
 
+cleanup:
 	ret = rte_eal_cleanup();
 	if (ret)
 		printf("Error from rte_eal_cleanup(), %d\n", ret);
-- 
2.45.2


  parent reply	other threads:[~2024-10-04  2:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04 12:28 [PATCH v2] " Fidaullah Noonari
2023-07-16 17:46 ` Stephen Hemminger
2024-10-04  2:48 ` Stephen Hemminger [this message]
2024-10-09  1:22   ` [PATCH v3] " fengchengwen
2024-11-19 20:51     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241004024903.209976-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=fidaullah.noonari@emumba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).