[dpdk-dev,v3,3/4] app/pdump: call eal cleanup before exit

Message ID 1517227695-146913-3-git-send-email-harry.van.haaren@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Van Haaren, Harry Jan. 29, 2018, 12:08 p.m. UTC
  This patch adds a call to the newly introduced cleanup()
function just before quitting the pdump app.

Adding this function call before quitting from a secondary processes
is important, as otherwise it will leak hugepage memory. For a secondary
process that is run multiple times, this could cause hugepage memory
to become depleted and stop a secondary process from starting.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

---

v3:
- Rework to new cleanup() function name (Thomas)

Cc: thomas@monjalon.net
Cc: vipin.varghese@intel.com
---
 app/pdump/main.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Varghese, Vipin Jan. 29, 2018, 3:09 p.m. UTC | #1
> -----Original Message-----
> From: Van Haaren, Harry
> Sent: Monday, January 29, 2018 5:38 PM
> To: dev@dpdk.org
> Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; thomas@monjalon.net;
> Varghese, Vipin <vipin.varghese@intel.com>
> Subject: [PATCH v3 3/4] app/pdump: call eal cleanup before exit
> 
> This patch adds a call to the newly introduced cleanup() function just before
> quitting the pdump app.
> 
> Adding this function call before quitting from a secondary processes is
> important, as otherwise it will leak hugepage memory. For a secondary process
> that is run multiple times, this could cause hugepage memory to become
> depleted and stop a secondary process from starting.
> 
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> ---
> 
> v3:
> - Rework to new cleanup() function name (Thomas)
> 
> Cc: thomas@monjalon.net
> Cc: vipin.varghese@intel.com
> ---
>  app/pdump/main.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/app/pdump/main.c b/app/pdump/main.c index 0f70c75..50772cb
> 100644
> --- a/app/pdump/main.c
> +++ b/app/pdump/main.c
> @@ -882,5 +882,10 @@ main(int argc, char **argv)
>  	/* dump debug stats */
>  	print_pdump_stats();
> 
> +	ret = rte_eal_cleanup();
> +	if (ret)
> +		printf("Error from rte_eal_cleanup(), %d\n", ret);
> +
> +
>  	return 0;
>  }
> --
> 2.7.4

Tested with static and dynamic library on Linux

Acked-by: Vipin Varghese <vipin.varghese@intel.com>
  

Patch

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 0f70c75..50772cb 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -882,5 +882,10 @@  main(int argc, char **argv)
 	/* dump debug stats */
 	print_pdump_stats();
 
+	ret = rte_eal_cleanup();
+	if (ret)
+		printf("Error from rte_eal_cleanup(), %d\n", ret);
+
+
 	return 0;
 }