From: Yajun Wu <yaj...@nvidia.com> Move rte_eal_cleanup to function vdpa_sample_quit which handling all example app quit. Otherwise rte_eal_cleanup won't be called on receiving signal like SIGINT(control + c).
Fixes: 10aa3757 ("examples: add eal cleanup to examples") Cc: sta...@dpdk.org Signed-off-by: Yajun Wu <yaj...@nvidia.com> --- examples/vdpa/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c index 7e11ef4e26..62e32b633d 100644 --- a/examples/vdpa/main.c +++ b/examples/vdpa/main.c @@ -286,6 +286,8 @@ vdpa_sample_quit(void) if (vports[i].ifname[0] != '\0') close_vdpa(&vports[i]); } + /* clean up the EAL */ + rte_eal_cleanup(); } static void @@ -632,8 +634,5 @@ main(int argc, char *argv[]) vdpa_sample_quit(); } - /* clean up the EAL */ - rte_eal_cleanup(); - return 0; } -- 2.31.1