From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 44D3D3005 for ; Fri, 27 Feb 2015 12:18:42 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 27 Feb 2015 03:18:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,659,1418112000"; d="scan'208";a="684318363" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 27 Feb 2015 03:18:40 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t1RBIdOi022260 for ; Fri, 27 Feb 2015 11:18:39 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t1RBIdaG021096 for ; Fri, 27 Feb 2015 11:18:39 GMT Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t1RBId3B021092 for dev@dpdk.org; Fri, 27 Feb 2015 11:18:39 GMT From: Pablo de Lara To: dev@dpdk.org Date: Fri, 27 Feb 2015 11:18:39 +0000 Message-Id: <1425035919-21060-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] testpmd: stop pkt forwarding when quitting testpmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2015 11:18:42 -0000 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 --- 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