app/testpmd: stop forwarding when quitting
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Fri, 27 Feb 2015 11:18:39 +0000 (11:18 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 10 Mar 2015 15:22:44 +0000 (16:22 +0100)
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@intel.com>
app/test-pmd/testpmd.c

index e38c441..4828354 100644 (file)
@@ -1633,6 +1633,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);