From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 365965A76 for ; Fri, 6 Mar 2015 14:53:40 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 06 Mar 2015 05:53:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,352,1422950400"; d="scan'208";a="694905825" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga002.jf.intel.com with ESMTP; 06 Mar 2015 05:53:38 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.218]) by IRSMSX153.ger.corp.intel.com ([169.254.9.234]) with mapi id 14.03.0195.001; Fri, 6 Mar 2015 13:53:38 +0000 From: "De Lara Guarch, Pablo" To: "Qiu, Michael" , Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] testpmd: Fix port validation code of "port stop all" command Thread-Index: AQHQV0kDy3KhdnycH0OscnnQXEpxdp0PeoBw Date: Fri, 6 Mar 2015 13:53:37 +0000 Message-ID: References: <1425540606-12554-1-git-send-email-mukawa@igel.co.jp> <533710CFB86FA344BFBF2D6802E60286CEEEC5@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286CEEEC5@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] testpmd: Fix port validation code of "port stop all" command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 13:53:40 -0000 Hi Michael, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiu, Michael > Sent: Thursday, March 05, 2015 1:33 PM > To: Tetsuya Mukawa; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] testpmd: Fix port validation code of "por= t > stop all" command >=20 > Hi, Tetsuya and Pablo > This is not a full fix, I have generate the full fix patch two days ago, Sorry I did not see this earlier. Did you upstream this patch already? I acked Tetsuya's patch, as it was simple and works, but I cannot find this one. Thanks, Pablo > See below: >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index 49be819..ec53923 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -384,6 +384,9 @@ port_infos_display(portid_t port_id) > int > port_id_is_invalid(portid_t port_id, enum print_warning warning) > { > + if (port_id =3D=3D (portid_t)RTE_PORT_ALL) > + return 0; > + > if (ports[port_id].enabled) > return 0; >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index e556b4c..1c4c651 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -1326,6 +1326,9 @@ start_port(portid_t pid) > return -1; > } >=20 > + if (port_id_is_invalid(pid, ENABLED_WARN)) > + return 0; > + > if (init_fwd_streams() < 0) { > printf("Fail from init_fwd_streams()\n"); > return -1; > @@ -1482,10 +1485,14 @@ stop_port(portid_t pid) > dcb_test =3D 0; > dcb_config =3D 0; > } > + > + if (port_id_is_invalid(pid, ENABLED_WARN)) > + return; > + > printf("Stopping ports...\n"); >=20 > FOREACH_PORT(pi, ports) { > - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid !=3D p= i) > + if (pid !=3D pi && pid !=3D (portid_t)RTE_PORT_ALL) > continue; >=20 > port =3D &ports[pi]; > @@ -1517,10 +1524,13 @@ close_port(portid_t pid) > return; > } >=20 > + if (port_id_is_invalid(pid, ENABLED_WARN)) > + return; > + > printf("Closing ports...\n"); >=20 > FOREACH_PORT(pi, ports) { > - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid !=3D p= i) > + if (pid !=3D pi && pid !=3D (portid_t)RTE_PORT_ALL) > continue; >=20 > port =3D &ports[pi]; > -- > 1.9.3 >=20 > Thanks, > Michael >=20 > On 3/5/2015 3:31 PM, Tetsuya Mukawa wrote: > > When "port stop all" is executed, the command doesn't work as it should > > because of wrong port validation. The patch fixes this issue. > > > > Reported-by: Pablo de Lara > > Signed-off-by: Tetsuya Mukawa > > --- > > app/test-pmd/testpmd.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > > index 61291be..bb65342 100644 > > --- a/app/test-pmd/testpmd.c > > +++ b/app/test-pmd/testpmd.c > > @@ -1484,7 +1484,7 @@ stop_port(portid_t pid) > > printf("Stopping ports...\n"); > > > > FOREACH_PORT(pi, ports) { > > - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid !=3D pi) > > + if (pid !=3D pi && pid !=3D (portid_t)RTE_PORT_ALL) > > continue; > > > > port =3D &ports[pi];