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 53335374E for ; Thu, 7 Sep 2017 10:44:41 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 01:44:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="308974566" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 07 Sep 2017 01:44:41 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Sep 2017 01:44:40 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Sep 2017 01:44:40 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.219]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0319.002; Thu, 7 Sep 2017 16:44:38 +0800 From: "Wu, Jingjing" To: "Rybalchenko, Kirill" , Li Han CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd:fix invalid port id parameters Thread-Index: AQHTGwQ8UD+XEMbwekCidCP8b9kJg6KkU2SAgAThLmA= Date: Thu, 7 Sep 2017 08:44:38 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810E42674@SHSMSX103.ccr.corp.intel.com> References: <1503378222-23306-1-git-send-email-han.li1@zte.com.cn> <696B43C21188DF4F9C9091AAE4789B824E295BC4@IRSMSX108.ger.corp.intel.com> In-Reply-To: <696B43C21188DF4F9C9091AAE4789B824E295BC4@IRSMSX108.ger.corp.intel.com> Accept-Language: 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: [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] 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: Thu, 07 Sep 2017 08:44:42 -0000 > -----Original Message----- > From: Rybalchenko, Kirill > Sent: Monday, September 4, 2017 10:12 PM > To: Li Han ; Wu, Jingjing > Cc: dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] app/testpmd:fix invalid port id parameter= s >=20 > Hi Han, >=20 > > -----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 > > > > 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. > > > > Signed-off-by: Li Han > > --- > > app/test-pmd/parameters.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c inde= x > > 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 o= mitted and there > will be no way > To figure out which port id caused the problem Why? If the port_id is invalid and not RTE_PORT_ALL, the "printf("Invalid p= ort %d\n", port_id)" should be print.