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 44BA8A2EFC for ; Fri, 20 Sep 2019 05:58:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 281A61F239; Fri, 20 Sep 2019 05:58:48 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 73FE91F1E6; Fri, 20 Sep 2019 05:58:44 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 20:58:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,527,1559545200"; d="scan'208";a="217528296" Received: from intel.sh.intel.com ([10.239.255.149]) by fmsmga002.fm.intel.com with ESMTP; 19 Sep 2019 20:58:40 -0700 From: Wang ShougangX To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, qiming.yang@intel.com, ferruh.yigit@intel.com, Wang ShougangX , stable@dpdk.org Date: Fri, 20 Sep 2019 03:13:33 +0000 Message-Id: <20190920031333.16859-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190906012838.64088-1-shougangx.wang@intel.com> References: <20190906012838.64088-1-shougangx.wang@intel.com> Subject: [dpdk-stable] [PATCH v2] app/testpmd: fix Segment fault when start fwd X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" This patch fixed the reset function to avoid crash when user don't call port stop, port reset 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 | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e8e2a39b6..9224aa1f7 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2344,6 +2344,8 @@ reset_port(portid_t pid) if (port_id_is_invalid(pid, ENABLED_WARN)) return; + stop_port(pid); + printf("Resetting ports...\n"); RTE_ETH_FOREACH_DEV(pi) { diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 313e0707e..2c459810c 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2041,6 +2041,15 @@ Close all ports or a specific port:: testpmd> port close (port_id|all) +port reset +~~~~~~~~~~ + +Reset all ports or a specific port:: + + testpmd> port reset (port_id|all) + +User should (re-)start the port after reset. + port config - queue ring size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.17.1