From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 715AE1B01E for ; Mon, 8 Jan 2018 11:25:26 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 02:25:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,330,1511856000"; d="scan'208";a="22273511" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by orsmga001.jf.intel.com with ESMTP; 08 Jan 2018 02:25:24 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.138]) by IRSMSX109.ger.corp.intel.com ([169.254.13.28]) with mapi id 14.03.0319.002; Mon, 8 Jan 2018 10:25:22 +0000 From: "Singh, Jasvinder" To: "Wu, Jingjing" , "dev@dpdk.org" CC: "Dumitrescu, Cristian" , "Mcnamara, John" Thread-Topic: [PATCH 1/3] app/testpmd: metering and policing CLI clean up Thread-Index: AQHTh8NebHGED40/oUGsczKMSy1SNKNpwA5w Date: Mon, 8 Jan 2018 10:25:21 +0000 Message-ID: <54CBAA185211B4429112C315DA58FF6D332C01CE@IRSMSX103.ger.corp.intel.com> References: <20171120163920.70660-1-jasvinder.singh@intel.com> <9BB6961774997848B5B42BEC655768F810EF8B9E@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810EF8B9E@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTJhODNkOTgtOGNlMC00ZTU1LWJjOTUtZDRhOWIyZGEzZGJlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InpHWkcxbGpXK2FValRQajY5S2VmMHFtZGg4TWpxMEo1Q2haU01HQnBLcFE9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/3] app/testpmd: metering and policing CLI clean up 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, 08 Jan 2018 10:25:27 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Sunday, January 7, 2018 2:25 PM > To: Singh, Jasvinder ; dev@dpdk.org > Cc: Dumitrescu, Cristian ; Mcnamara, John > > Subject: RE: [PATCH 1/3] app/testpmd: metering and policing CLI clean up >=20 >=20 >=20 > > -----Original Message----- > > From: Singh, Jasvinder > > Sent: Tuesday, November 21, 2017 12:39 AM > > To: dev@dpdk.org > > Cc: Dumitrescu, Cristian ; Wu, Jingjing > > ; Mcnamara, John > > Subject: [PATCH 1/3] app/testpmd: metering and policing CLI clean up > > > > This patch updates the metering and policing CLIs as follows: > > - change name of set port meter CLI to create port meter and add meter > > enable option, dscp table entries arguments, action mask, policer act= ions > > and previous meter color option as an input color > > - set the right metering algorithm in add meter profile CLIs related to > > srtcm(rfc2697) and trtcm(rfc2698,rfc4115) > > - change clear flag type from uint32_t to string in show meter stats > > CLI > > > > Signed-off-by: Jasvinder Singh > Acked-by: Jingjing Wu >=20 > With minor comment: >=20 > > +static int > > +parse_dscp_table_entries(char *str, enum rte_mtr_color *dscp_table) { > > + char *token; > > + int i =3D 0; > > + > > + token =3D strtok_r(str, PARSE_DELIMITER, &str); > > + if (token =3D=3D NULL) > > + return 0; > > + > > + /* Allocate memory for dscp table */ > > + dscp_table =3D (enum rte_mtr_color > *)malloc(MAX_DSCP_TABLE_ENTRIES * > > + sizeof(enum rte_mtr_color)); > > + > > + while (1) { > > + if (strcmp(token, "G") =3D=3D 0 || > > + strcmp(token, "g") =3D=3D 0) > > + dscp_table[i++] =3D RTE_MTR_GREEN; > > + else if (strcmp(token, "Y") =3D=3D 0 || > > + strcmp(token, "y") =3D=3D 0) > > + dscp_table[i++] =3D RTE_MTR_YELLOW; > > + else if (strcmp(token, "R") =3D=3D 0 || > > + strcmp(token, "r") =3D=3D 0) > > + dscp_table[i++] =3D RTE_MTR_RED; > > + else { > > + free(dscp_table); > > + return -1; > > + } > > + if (i =3D=3D MAX_DSCP_TABLE_ENTRIES) > > + break; > Is that meaning the size dscp table must be 64, can it be less than 64? The DSCP field is represented by 6 bits in the byte long TOS field of the I= P header. Therefore, DSCP table should be have 64 entries for the packets c= lassification. > Thanks > Jingjing