Skip to contentSkip to conversation

app/proc-info: add rte_eal_cleanup() to avoid memory leak

PATCH In review Fidaullah Noonari 4 participants 5 messages Sep 4, 2022 – Nov 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 app/proc-info: add rte_eal_cleanup() to avoid memory leak

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

---
 app/proc-info/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
app/proc-info/main.c +2 -1
index 1bfba5f60d..9cfcce31ab 100644
@@ -1523,7 +1523,7 @@ main(int argc, char **argv)
 
 	if (mem_info) {
 		meminfo_display();
-		return 0;
+		goto cleanup;
 	}
 
 	nb_ports = rte_eth_dev_count_avail();
@@ -1593,6 +1593,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);
Signature · 1 line
2.25.1
Acked-by on v2 1/1
#1 lore raw
Quoted 5 lines · On Sun, 4 Sep 2022 17:28:45 +0500 Fidaullah Noonari…

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

The new eventdev stats could have the same problem.

#2 lore raw

PATCH v3 1/1 app/proc-info: add rte_eal_cleanup() to avoid memory leak

In reply to Fidaullah Noonari

From: Fidaullah Noonari <[email protected]>

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

---
v3 - handle eventdev_xstats as well

     rebase to 24.11
 app/proc-info/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
app/proc-info/main.c +3 -2
index b672aaefbe..4a558705cc 100644
@@ -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);
Signature · 1 line
2.45.2
Acked-by on v3 1/1
#3 lore raw
Quoted 12 lines · Stephen Hemminger

From: Fidaullah Noonari <[email protected]>

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

---
v3 - handle eventdev_xstats as well

     rebase to 24.11
#4 lore raw

09/10/2024 03:22, fengchengwen:

Quoted 7 lines · Stephen Hemminger
Quoted 6 lines

From: Fidaullah Noonari <[email protected]>

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.

Quoted 5 lines
Quoted 3 lines

Bugzilla id: 898

Applied, thanks.