From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 3080E2BE1 for ; Sun, 7 Jan 2018 15:25:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2018 06:25:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,325,1511856000"; d="scan'208";a="8518094" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 07 Jan 2018 06:25:27 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 7 Jan 2018 06:25:27 -0800 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; Sun, 7 Jan 2018 06:25:26 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Sun, 7 Jan 2018 22:25:25 +0800 From: "Wu, Jingjing" To: "Singh, Jasvinder" , "dev@dpdk.org" CC: "Dumitrescu, Cristian" , "Mcnamara, John" Thread-Topic: [PATCH 1/3] app/testpmd: metering and policing CLI clean up Thread-Index: AQHTYhxYyA61M0GDKEqKAVzzh7+5sKNovC7w Date: Sun, 7 Jan 2018 14:25:24 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810EF8B9E@SHSMSX103.ccr.corp.intel.com> References: <20171120163920.70660-1-jasvinder.singh@intel.com> In-Reply-To: <20171120163920.70660-1-jasvinder.singh@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: [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 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: Sun, 07 Jan 2018 14:25:29 -0000 > -----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 >=20 > 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 actio= ns > 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 >=20 > Signed-off-by: Jasvinder Singh Acked-by: Jingjing Wu 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? Thanks Jingjing