From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1B37A2EDB for ; Fri, 6 Sep 2019 04:15:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4E7211F0B1; Fri, 6 Sep 2019 04:15:44 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id BECCF1EF3B; Fri, 6 Sep 2019 04:15:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 19:15:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,472,1559545200"; d="scan'208";a="195293154" Received: from intel.sh.intel.com ([10.239.255.149]) by orsmga002.jf.intel.com with ESMTP; 05 Sep 2019 19:15:39 -0700 From: Wang ShougangX To: dev@dpdk.org Cc: Wenzhuo Lu , Yang Qiming , Wang ShougangX , stable@dpdk.org Date: Fri, 6 Sep 2019 01:28:38 +0000 Message-Id: <20190906012838.64088-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] app/testpmd: fix Segment fault when start fwd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixed the reset function to avoid crash when user don't call port reset , port stop and port start functions as sequence. Fixes: 97f1e19679 ("app/testpmd: add port reset command") Cc: stable@dpdk.org Signed-off-by: Wang ShougangX --- app/test-pmd/testpmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e8e2a39b6..273a7aa02 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2344,6 +2344,9 @@ reset_port(portid_t pid) if (port_id_is_invalid(pid, ENABLED_WARN)) return; + printf("Stopping ports...\n"); + stop_port(pid); + printf("Resetting ports...\n"); RTE_ETH_FOREACH_DEV(pi) { @@ -2372,6 +2375,9 @@ reset_port(portid_t pid) } } + printf("Starting ports...\n"); + start_port(pid); + printf("Done\n"); } -- 2.17.1