testpmd: call cleanup on exit

Message ID 20200107174056.9397-1-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Headers
Series testpmd: call cleanup on exit |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK

Commit Message

Stephen Hemminger Jan. 7, 2020, 5:40 p.m. UTC
  The rte_eal_cleanup code is not exercised by testpmd which
is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can
be checked with tools like valgrind.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/testpmd.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jerin Jacob Jan. 7, 2020, 5:58 p.m. UTC | #1
On Tue, Jan 7, 2020 at 11:11 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The rte_eal_cleanup code is not exercised by testpmd which
> is the most used DPDK test tool. Add a call at end of program.
>
> This helps exercise free and close paths which can
> be checked with tools like valgrind.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  app/test-pmd/testpmd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index b3746822366f..a94ad19c8f5a 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -3570,5 +3570,6 @@ main(int argc, char** argv)
>                         return 1;
>         }
>
> +       rte_eal_cleanup();
>         return 0;

# How about changing to "return rte_eal_cleanup()" to provide OS the
correct stats?
# IMO, we need the same in other applications main() and signal handler too.




>  }
> --
> 2.20.1
>
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index b3746822366f..a94ad19c8f5a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3570,5 +3570,6 @@  main(int argc, char** argv)
 			return 1;
 	}
 
+	rte_eal_cleanup();
 	return 0;
 }