From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 0E4093770 for ; Mon, 4 Sep 2017 16:12:01 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 04 Sep 2017 07:12:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,474,1498546800"; d="scan'208";a="307776557" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga004.fm.intel.com with ESMTP; 04 Sep 2017 07:11:59 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 4 Sep 2017 15:11:58 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by irsmsx112.ger.corp.intel.com ([169.254.1.110]) with mapi id 14.03.0319.002; Mon, 4 Sep 2017 15:11:58 +0100 From: "Rybalchenko, Kirill" To: Li Han , "Wu, Jingjing" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd:fix invalid port id parameters Thread-Index: AQHTGwRBmFNuW64610+Sv8+rsm5rwaKk2IjQ Date: Mon, 4 Sep 2017 14:11:57 +0000 Message-ID: <696B43C21188DF4F9C9091AAE4789B824E295BC4@IRSMSX108.ger.corp.intel.com> References: <1503378222-23306-1-git-send-email-han.li1@zte.com.cn> In-Reply-To: <1503378222-23306-1-git-send-email-han.li1@zte.com.cn> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWM0MGY5NTItZWJjNC00YTBhLTk5MjctZmZmNDA1NTU2MWU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ind2M09UYXo0anlGbzV1MVF5dThoVXFRNmI2NDQxOTB5U1c0bFc1MDZtMlE9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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] app/testpmd:fix invalid port id parameters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 14:12:02 -0000 Hi Han, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Li Han > Sent: Tuesday 22 August 2017 06:04 > To: Wu, Jingjing > Cc: dev@dpdk.org; Li Han > Subject: [dpdk-dev] [PATCH] app/testpmd:fix invalid port id parameters >=20 > in parse_ringnuma_config/parse_portnuma_config functions,port_id should > less than RTE_MAX_ETHPORTS,but port_id_is_invalid check assumes that > port_id may be 255. >=20 > Signed-off-by: Li Han > --- > app/test-pmd/parameters.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index > 2f7f70f..0c97ba4 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -424,7 +424,8 @@ > return -1; > } > port_id =3D (uint8_t)int_fld[FLD_PORT]; > - if (port_id_is_invalid(port_id, ENABLED_WARN)) { > + if (port_id_is_invalid(port_id, ENABLED_WARN) || > + port_id =3D=3D (portid_t)RTE_PORT_ALL) { In this case the message "printf("Invalid port %d\n", port_id)" will be omi= tted and there will be no way=20 To figure out which port id caused the problem > printf("Valid port range is [0"); > RTE_ETH_FOREACH_DEV(pid) > printf(", %d", pid); > @@ -483,7 +484,8 @@ > return -1; > } > port_id =3D (uint8_t)int_fld[FLD_PORT]; > - if (port_id_is_invalid(port_id, ENABLED_WARN)) { > + if (port_id_is_invalid(port_id, ENABLED_WARN) || > + port_id =3D=3D (portid_t)RTE_PORT_ALL) { The same here > printf("Valid port range is [0"); > RTE_ETH_FOREACH_DEV(pid) > printf(", %d", pid); > -- > 1.8.3.1 >=20 Thanks, Kirill