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 ED489A04B5 for ; Tue, 3 Dec 2019 19:27:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5C0B8F96; Tue, 3 Dec 2019 19:27:42 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id D6EE31F5 for ; Tue, 3 Dec 2019 19:27:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PSdQkMxm9eRdl4XNkP5ToqxBAkGuL4J3ZKqt3ob/xvk=; b=TfBO9e67aOc0zCyz3mzRL4NLUfwIcakH/CVEobT+5asELOSul5IyhM5Dcppv+dSwSIvlBD ViXHea0KqxSUfQAPK+bJgQ1SUxq3Yyk3TvdgSBIbZnD6/l7dOjI/iMz6yVSegJn0aH55Fb HNAy8VYR66vznxfPE7S+s2svLryXGcU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-kQTKNzSCMIyOVv8Ipw2TLA-1; Tue, 03 Dec 2019 13:27:38 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0577DB60; Tue, 3 Dec 2019 18:27:36 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id C490F5C240; Tue, 3 Dec 2019 18:27:35 +0000 (UTC) From: Kevin Traynor To: Shougang Wang Cc: Bernard Iremonger , dpdk stable Date: Tue, 3 Dec 2019 18:26:14 +0000 Message-Id: <20191203182714.17297-5-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: kQTKNzSCMIyOVv8Ipw2TLA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'app/testpmd: fix crash on port reset' has been queued to LTS release 18.11.6 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" 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 rebasi= ng (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/e128cc23aa7348b4ab= 03a7a449259703f91d2130 Thanks. Kevin. --- >From e128cc23aa7348b4ab03a7a449259703f91d2130 Mon Sep 17 00:00:00 2001 From: Shougang Wang 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 Acked-by: Bernard Iremonger --- 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, =09=09=09" Close all ports or port_id.\n\n" =20 +=09=09=09"port reset (port_id|all)\n" +=09=09=09" Reset all ports or port_id.\n\n" + =09=09=09"port attach (ident)\n" =09=09=09" Attach physical or virtual dev by pci address or virtual dev= ice 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) =09=09return; =20 +=09if ((pid =3D=3D (portid_t)RTE_PORT_ALL && !all_ports_stopped()) || +=09=09(pid !=3D (portid_t)RTE_PORT_ALL && !port_is_stopped(pid))) { +=09=09printf("Can not reset port(s), please stop port(s) first.\n"); +=09=09return; +=09} + =09printf("Resetting ports...\n"); =20 diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testp= md_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) =20 +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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:52.093565250 +0000 +++ 0005-app-testpmd-fix-crash-on-port-reset.patch=092019-12-03 17:29:51.69= 8751036 +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@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::