From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 400505921 for ; Thu, 5 Mar 2015 14:38:49 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 05 Mar 2015 05:38:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,347,1422950400"; d="scan'208";a="536513469" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2015 05:38:36 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 5 Mar 2015 21:38:45 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by shsmsx102.ccr.corp.intel.com ([169.254.2.62]) with mapi id 14.03.0195.001; Thu, 5 Mar 2015 21:38:45 +0800 From: "Qiu, Michael" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] testpmd: Fix port validation code of "port stop all" command Thread-Index: AQHQVxZUkeUi1+JMQE6Z/J1a0wvVMQ== Date: Thu, 5 Mar 2015 13:38:44 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CEEEEC@SHSMSX101.ccr.corp.intel.com> References: <1425540606-12554-1-git-send-email-mukawa@igel.co.jp> <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: [10.239.127.40] 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: Thu, 05 Mar 2015 13:38:49 -0000 On 3/5/2015 9:33 PM, Qiu, Michael wrote:=0A= > Hi, Tetsuya and Pablo=0A= > This is not a full fix, I have generate the full fix patch two days ago,= =0A= > See below:=0A= >=0A= > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c=0A= > index 49be819..ec53923 100644=0A= > --- a/app/test-pmd/config.c=0A= > +++ b/app/test-pmd/config.c=0A= > @@ -384,6 +384,9 @@ port_infos_display(portid_t port_id)=0A= > int=0A= > port_id_is_invalid(portid_t port_id, enum print_warning warning)=0A= > {=0A= > + if (port_id =3D=3D (portid_t)RTE_PORT_ALL)=0A= > + return 0;=0A= > +=0A= > if (ports[port_id].enabled)=0A= > return 0;=0A= >=0A= > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c=0A= > index e556b4c..1c4c651 100644=0A= > --- a/app/test-pmd/testpmd.c=0A= > +++ b/app/test-pmd/testpmd.c=0A= > @@ -1326,6 +1326,9 @@ start_port(portid_t pid)=0A= > return -1;=0A= > }=0A= >=0A= > + if (port_id_is_invalid(pid, ENABLED_WARN))=0A= > + return 0;=0A= > +=0A= > if (init_fwd_streams() < 0) {=0A= > printf("Fail from init_fwd_streams()\n");=0A= > return -1;=0A= > @@ -1482,10 +1485,14 @@ stop_port(portid_t pid)=0A= > dcb_test =3D 0;=0A= > dcb_config =3D 0;=0A= > }=0A= > +=0A= > + if (port_id_is_invalid(pid, ENABLED_WARN))=0A= > + return;=0A= > +=0A= > printf("Stopping ports...\n");=0A= >=0A= > FOREACH_PORT(pi, ports) {=0A= > - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid !=3D p= i)=0A= > + if (pid !=3D pi && pid !=3D (portid_t)RTE_PORT_ALL)=0A= > continue;=0A= >=0A= > port =3D &ports[pi];=0A= > @@ -1517,10 +1524,13 @@ close_port(portid_t pid)=0A= > return;=0A= > }=0A= >=0A= > + if (port_id_is_invalid(pid, ENABLED_WARN))=0A= > + return;=0A= > +=0A= > printf("Closing ports...\n");=0A= >=0A= > FOREACH_PORT(pi, ports) {=0A= > - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid !=3D p= i)=0A= > + if (pid !=3D pi && pid !=3D (portid_t)RTE_PORT_ALL)=0A= > continue;=0A= >=0A= > port =3D &ports[pi];=0A= =0A= This diff is based on:=0A= =0A= [PATCH] app/test-pmd: Fix log issue without nic binded=0A= =0A= Thanks,=0A= Michael=0A=