[dpdk-dev,v2] app/testpmd: fix exit without freeing resources

Message ID 1493343170-110462-1-git-send-email-jiayu.hu@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Hu, Jiayu April 28, 2017, 1:32 a.m. UTC
  When testpmd exists, it frees the acquired resources (e.g. stop ports).
However, when we terminate it by Ctrl-d, testpmd exists directly without
releasing the resources. In this patch, we fix this exit issue.

Fixes:af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
---
changes in v2:
- Change title and add the bug release

 app/test-pmd/testpmd.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jianfeng Tan April 28, 2017, 2:02 a.m. UTC | #1
> -----Original Message-----
> From: Hu, Jiayu
> Sent: Friday, April 28, 2017 9:33 AM
> To: dev@dpdk.org
> Cc: Wu, Jingjing; stable@dpdk.org; Tan, Jianfeng; Hu, Jiayu
> Subject: [PATCH v2] app/testpmd: fix exit without freeing resources
> 
> When testpmd exists, it frees the acquired resources (e.g. stop ports).
> However, when we terminate it by Ctrl-d, testpmd exists directly without
> releasing the resources. In this patch, we fix this exit issue.
> 
> Fixes:af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>

Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>

Thanks,
Jianfeng
  
Thomas Monjalon May 1, 2017, 1:41 p.m. UTC | #2
28/04/2017 04:02, Tan, Jianfeng:
> From: Hu, Jiayu
> > 
> > When testpmd exists, it frees the acquired resources (e.g. stop ports).
> > However, when we terminate it by Ctrl-d, testpmd exists directly without
> > releasing the resources. In this patch, we fix this exit issue.
> > 
> > Fixes:af75078fece3 ("first public release")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> 
> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3a57348..94cefc0 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2289,6 +2289,7 @@  main(int argc, char** argv)
 			start_packet_forwarding(0);
 		}
 		prompt();
+		pmd_test_exit();
 	} else
 #endif
 	{