DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wang ShougangX <shougangx.wang@intel.com>
To: dev@dpdk.org
Cc: wenzhuo.lu@intel.com, qiming.yang@intel.com,
	ferruh.yigit@intel.com, Wang ShougangX <shougangx.wang@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix Segment fault when start fwd
Date: Fri, 20 Sep 2019 03:13:33 +0000	[thread overview]
Message-ID: <20190920031333.16859-1-shougangx.wang@intel.com> (raw)
In-Reply-To: <20190906012838.64088-1-shougangx.wang@intel.com>

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 <shougangx.wang@intel.com>
---
 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


  parent reply	other threads:[~2019-09-20  3:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  1:28 [dpdk-dev] [PATCH] " Wang ShougangX
2019-09-12 13:26 ` Iremonger, Bernard
2019-09-13 17:34 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-09-16  6:37   ` Wang, ShougangX
2019-09-16 15:27     ` Ferruh Yigit
2019-09-17  9:22       ` Wang, ShougangX
2019-09-23 11:04         ` Ferruh Yigit
2019-09-23 14:18           ` Iremonger, Bernard
2019-09-24  2:31             ` Wang, ShougangX
2019-09-20  3:13 ` Wang ShougangX [this message]
2019-09-23 10:19   ` [dpdk-dev] [PATCH v2] " Iremonger, Bernard
2019-09-24  1:43     ` Wang, ShougangX
2019-09-24  4:49   ` [dpdk-dev] [PATCH v3] " Wang ShougangX
2019-09-24  9:09     ` Iremonger, Bernard
2019-09-25 17:37       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190920031333.16859-1-shougangx.wang@intel.com \
    --to=shougangx.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).