dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] testpmd: stop pkt forwarding when quitting testpmd
@ 2015-02-27 11:18 Pablo de Lara
       [not found] ` <1425035919-21060-1-git-send-email-pablo.de.lara.guarch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo de Lara @ 2015-02-27 11:18 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

When user quits testpmd, and there is traffic being forwarded,
that may produce a segmentation fault, due to ports being closed,
while they are still transmitting packets.

This patch prevents the issue from happening,
by stopping packet forwarding before closing the ports.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 app/test-pmd/testpmd.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 61291be..7be96ad 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1623,6 +1623,9 @@ pmd_test_exit(void)
 {
 	portid_t pt_id;
 
+	if (test_done == 0)
+		stop_packet_forwarding();
+
 	FOREACH_PORT(pt_id, ports) {
 		printf("Stopping port %d...", pt_id);
 		fflush(stdout);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] testpmd: stop pkt forwarding when quitting testpmd
       [not found] ` <1425035919-21060-1-git-send-email-pablo.de.lara.guarch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2015-03-10 15:23   ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-03-10 15:23 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev-VfR2kkLFssw

> When user quits testpmd, and there is traffic being forwarded,
> that may produce a segmentation fault, due to ports being closed,
> while they are still transmitting packets.
> 
> This patch prevents the issue from happening,
> by stopping packet forwarding before closing the ports.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-10 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-27 11:18 [PATCH] testpmd: stop pkt forwarding when quitting testpmd Pablo de Lara
     [not found] ` <1425035919-21060-1-git-send-email-pablo.de.lara.guarch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-10 15:23   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).