[dpdk-stable] patch 'app/testpmd: fix crash on port reset' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 3 19:26:14 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/10/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/e128cc23aa7348b4ab03a7a449259703f91d2130

Thanks.

Kevin.

---
>From e128cc23aa7348b4ab03a7a449259703f91d2130 Mon Sep 17 00:00:00 2001
From: Shougang Wang <shougangx.wang at intel.com>
Date: Tue, 24 Sep 2019 04:49:03 +0000
Subject: [PATCH] app/testpmd: fix crash on port reset

[ upstream commit 1cde1b9a9b4dbf31cb5e5ccdfc5da3cb079f43a2 ]

port reset cause crash when ports are not stopped. Fixed by refusing the
reset when port is not stopped.

Fixes: 97f1e196799f ("app/testpmd: add port reset command")

Signed-off-by: Shougang Wang <shougangx.wang at intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>
---
 app/test-pmd/cmdline.c                      | 3 +++
 app/test-pmd/testpmd.c                      | 6 ++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 9 +++++++++
 3 files changed, 18 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f7f590b92..7f13309ad 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -777,4 +777,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"    Close all ports or port_id.\n\n"
 
+			"port reset (port_id|all)\n"
+			"    Reset all ports or port_id.\n\n"
+
 			"port attach (ident)\n"
 			"    Attach physical or virtual dev by pci address or virtual device name\n\n"
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 83b5e42a3..81f6d4f96 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2247,4 +2247,10 @@ reset_port(portid_t pid)
 		return;
 
+	if ((pid == (portid_t)RTE_PORT_ALL && !all_ports_stopped()) ||
+		(pid != (portid_t)RTE_PORT_ALL && !port_is_stopped(pid))) {
+		printf("Can not reset port(s), please stop port(s) first.\n");
+		return;
+	}
+
 	printf("Resetting ports...\n");
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 787355bae..3db8c4882 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1952,4 +1952,13 @@ 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 stop port(s) before resetting and (re-)start after reset.
+
 port config - queue ring size
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-03 17:29:52.093565250 +0000
+++ 0005-app-testpmd-fix-crash-on-port-reset.patch	2019-12-03 17:29:51.698751036 +0000
@@ -1 +1 @@
-From 1cde1b9a9b4dbf31cb5e5ccdfc5da3cb079f43a2 Mon Sep 17 00:00:00 2001
+From e128cc23aa7348b4ab03a7a449259703f91d2130 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1cde1b9a9b4dbf31cb5e5ccdfc5da3cb079f43a2 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index dd4e6e602..def471d97 100644
+index f7f590b92..7f13309ad 100644
@@ -24 +25 @@
-@@ -759,4 +759,7 @@ static void cmd_help_long_parsed(void *parsed_result,
+@@ -777,4 +777,7 @@ static void cmd_help_long_parsed(void *parsed_result,
@@ -33 +34 @@
-index 1e3dc44a1..5701f3141 100644
+index 83b5e42a3..81f6d4f96 100644
@@ -36 +37 @@
-@@ -2362,4 +2362,10 @@ reset_port(portid_t pid)
+@@ -2247,4 +2247,10 @@ reset_port(portid_t pid)
@@ -48 +49 @@
-index 67f4339ca..cba5ba1b8 100644
+index 787355bae..3db8c4882 100644
@@ -51 +52 @@
-@@ -2042,4 +2042,13 @@ Close all ports or a specific port::
+@@ -1952,4 +1952,13 @@ Close all ports or a specific port::



More information about the stable mailing list