From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F0E59A0547; Sun, 26 Sep 2021 11:45:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 740A44003D; Sun, 26 Sep 2021 11:45:09 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2047.outbound.protection.outlook.com [40.107.237.47]) by mails.dpdk.org (Postfix) with ESMTP id 22D214003C for ; Sun, 26 Sep 2021 11:45:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NPQFYJjnzKmLieVjbYKSzPk2xgiOu3kWOydEojvlsWrcmlglsnuPtfXNESV6PLsT6ix5nTaGSATltzWOHlIFvxrzB2Zdwo+gK6L2R+YfgLa4E9OARB/zJpXYLakRRGuh/I3trMbfBk/WkcbXmsDC8OTWIr2C7eCeN3U7KTQEm/a0cS6g0SE7trtyvKKJ0swjK5rSV0P556herHyiLOKxNuQbWsQPCdncQzBk2AcEQzI1ctAVw+Htqs2WtVjhYI7Ozh+Dxi9TOjWlyv0FWksTyh3f8LJ1o65zL7WJrTMEA1gURFZ5ie+r4sxVdkJpv6aDNFe2Wr1poZqe17I6fw6wMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5hKPTajIqPPh9QkbGqEkrmRRLF92PV883HfmmQWQR4o=; b=nJQNH2ExvdnkGseBj9JWn9FzV3zMFr8RKbSQOekQhN1Lj4DbpbvxxxmFgYtW7JFsaN4OcFtKVhAjmzJESV56qQgDs6bwg0FZYvw16UjjOIhcdyHykv6oPaYa7+SIe93pxkVrW+BPbvZ2VFsiIJgTB8jtBQlzrudp/JEBSObpnk9dgk/eoTn5AtT8Z+mY6tQpidON35H0/tBVN9mmUsQpU0nq70tBhd0/ELLcKnKC/lXv+Os8RqIxTZ9xjlmb1LRP92K5ipoPFzjGD1O7EhMItKHpHLuaBOZKbLa0buVW0DDbepApAj/kSRAcTl86afPiBebJfsgQ0LtMnlyiEADfgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5hKPTajIqPPh9QkbGqEkrmRRLF92PV883HfmmQWQR4o=; b=kIqBoTjKkyqxKxN7trEWIuufO9Fu+otpO9gi60zDBPfHKChXeLlObVyZqjWzjFrmz5LbsN1pAj3iZtKvJI7Q1bBxJ6EH7WmrhjcfALCVEmlj7Mvw6+XsWvh0DHdEmz+ha5Ki55FTDJzOzzhXRQdK64yJVnz3bU23ErPdxJe+Ofiq7jbOS08QzHRlptZaUSMjdS89G9UzTbpywnSx5iJBljCLQT7DX3U2aNzeEIEkmuxtlPicrh8XYF3sCoiyv+BBgoHo+iRFnePMWsEjYz0VN6CpqbuNLIsY+sz8pOBDGAprElqJaRyFiNVMA9Js6e8D8PT+wlnH4Dm1n22ln5wq8w== Received: from DM4PR12MB5039.namprd12.prod.outlook.com (2603:10b6:5:38a::18) by DM4PR12MB5216.namprd12.prod.outlook.com (2603:10b6:5:398::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Sun, 26 Sep 2021 09:45:06 +0000 Received: from DM4PR12MB5039.namprd12.prod.outlook.com ([fe80::3096:12ef:d306:d065]) by DM4PR12MB5039.namprd12.prod.outlook.com ([fe80::3096:12ef:d306:d065%7]) with mapi id 15.20.4544.021; Sun, 26 Sep 2021 09:45:06 +0000 From: Wisam Monther To: Rongwei Liu , Matan Azrad , Slava Ovsiienko , Ori Kam , NBU-Contact-Thomas Monjalon CC: "dev@dpdk.org" , Raslan Darawsheh , Haifei Luo , "Jiawei(Jonny) Wang" Thread-Topic: [PATCH v2 1/3] app/flow-perf: support meter policy API Thread-Index: AQHXff7gIBVl18Z2Xk2c9I3TDZTQCKu2eY0A Date: Sun, 26 Sep 2021 09:45:06 +0000 Message-ID: References: <1617691848-94564-1-git-send-email-haifeil@nvidia.com> <20210721070542.1153843-1-rongweil@nvidia.com> <20210721070542.1153843-2-rongweil@nvidia.com> In-Reply-To: <20210721070542.1153843-2-rongweil@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 74cd56f4-5513-4ca9-c0c5-08d980d25292 x-ms-traffictypediagnostic: DM4PR12MB5216: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gA4QzU/Z29B5x4sb8+v+E9Eb39ag+Q/poY/p2wh9Eb78knjEtjcFonegbybSNdgVxQTr8mtbjNU3L4bwwx7Scm/nRhUT+Kr3KUbS4k2+dwtr9NXXoD7b9dHnAWup9PjDdEVv0Bp9hp1jkTQ6oSbFdsXPpS79CajoxDm0TbfhUu4mR32eTDpwti/rGH798mFeH4W56ktXiMegUmol3TlGjiyCXPNB7RxwKXamb2/mgAaKcWeYtu5KL2LjuumWlscdnZT/EGqAA6NshdgEWdZk3/vHijRmr/tLgelF6CpoxuYNRHp3i9hAiZ8vYkGY8shr0sLuFX8DjheexLWP8iHjOJQF8lUgWRjbz8UwgWuBSzpph/cVebOm7wD8nCKHMe6ke6pP/c6edN2HtbWm8rkAyadY4oLPaYPSopa0wvfBid9i5u599X4PHVMGIrOAzLZKonVHjkRYf3Laofb8ZPFA3LrcTPBPRLZ6ttF5xQhUegP6avdDtdqthk7IjVxO8AqwlojPnaWBUQAVojWkUGlpzpzR6D+4eXXKIElqGpQb9JSEdCPiddr3WQP5IcG++PVZ94qmAth1MT72Uu8/1Zm1n16052Rs94if6IzUZWInRd2NkN/I2aXR785Frctdrq0nYeMqCtDP5pm8wQsa92LwaoxNYhs5MVpi83QOs0jB647m7aWHltrWMCae0Rn0g6j79mFpyd6HSpfJsLpvmUlY1Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5039.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(54906003)(26005)(53546011)(4326008)(76116006)(508600001)(9686003)(2906002)(71200400001)(7696005)(66556008)(64756008)(86362001)(66446008)(66946007)(66476007)(52536014)(33656002)(83380400001)(122000001)(5660300002)(55016002)(38070700005)(8676002)(38100700002)(6506007)(110136005)(316002)(186003)(8936002)(107886003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rJUOdiNgacc4NrH8lTGa6J7Lxgy7y1IsYwR5t2ImsDZOYZUuIMvvdZZQpb3s?= =?us-ascii?Q?0v2+YnfiMpXUDVPNMIq98cqkFoqaoX+nrPTAGIcmZ5vFZkCCq9tHeQCIaDb7?= =?us-ascii?Q?7rM/GU2l9ttNejIyTF6fDD1uuutsLmwsYGhaocm5ILb7XH0/C7qhPC3f3qYg?= =?us-ascii?Q?Yjrue5bazvAW/x6cdxYAukTNGw9KG0B46YXdjeYh30ergvZLs3CT+cnd6NjW?= =?us-ascii?Q?TVwNiNG2IFIrrlb179FOKF+e+dF70vzFP3Q4yok8U7QOaU3nscI4wsz4dpPo?= =?us-ascii?Q?/MRkDA5eDebiBjEuSGNGAWdxudhzpXWvR68qrS5G4abeQKGfeO6cIVvY8GJz?= =?us-ascii?Q?Dj5gNJftv0gntsJNyAhUZk3teWuwiYzoGU1yIoiBOmhA0RLfBbHXik5Fp7NO?= =?us-ascii?Q?FqkeOY3JZgBwDYv2EzT27EKZhntgz/aVT6CVNN7XwW5LrdSoV/nCjhP8ve5v?= =?us-ascii?Q?Uvehr9rMe0FMVZYrthx6NSkP8yIH0iikziGfe5yfEQdSefQCtgtT1LBlBiPe?= =?us-ascii?Q?Hb/n2m7gBjL4Vpx/li4WaUnkS+3zMLxpXP98uHPn+8qmMu8ywWpod/ltYZqL?= =?us-ascii?Q?vp3iTPIBq8WXEmN1WWPnygmXBrAp9EzjTMK+alyO3VpxVjsrFaJlJ0sq7xFr?= =?us-ascii?Q?qGcaJrBo2FEzoGqhl7XNT8SO87BqqKLJD3eEF6MxEKUYQ/fvFNbpvxRJZ8uN?= =?us-ascii?Q?KdEg2fHFPcuRZy8s/wc6c2VsIZPIsuNTXkaL68Ha1X26DHPCmQaGxFnwnSsF?= =?us-ascii?Q?jkVoHqxNEjuvLohZSrAKJVLFja+Py/QkxTZO7HpONE+NwLDPsHMnVqUZBUT8?= =?us-ascii?Q?OkpIeaw4HgWnGAa9Ai0huP0FZ9ainm2cz0RUubjCp8byhy3E1rod3m9KjY9z?= =?us-ascii?Q?WoulY8PGv4oLcJRGYVo1LjNsrm3rljEFkPJ9+4l8oqL84jCeEcity6UT6vOR?= =?us-ascii?Q?iZbuYbvI88bPMW152U04KVe89pQ4T9PXEC9R2fKnpveo8owm9XHX1OyILs3q?= =?us-ascii?Q?RWuYmXSWBHoyZAHt1fsdIP2BUen7vAbLKcO9LEZ4CE5wL9NLRSEl0b6V9Eec?= =?us-ascii?Q?Mz9Pf8Wo37RboaS/wkzI93COrHWKCoJhPqMFrdtBwBVGmEUOT1FNyPV7Z08y?= =?us-ascii?Q?pcv5JQnAqtW/peQmRL53kBe6njG3Ez6zqSaT8R8aej2RMfqEjuSQrrNnmP08?= =?us-ascii?Q?tncGlZd6IYD62woN5LnkFnPhbIMjcc33JcBJVsRzGTyHcLkQLmPEehyLX7EC?= =?us-ascii?Q?IsbFHZSlqA9KVqCgsBSOLEwAbmajG6H69B+zhpCrbwhCkniQOAAaygIZ9HlS?= =?us-ascii?Q?b4Bya6Mcqw1zzK2tFxhRu1qV?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5039.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74cd56f4-5513-4ca9-c0c5-08d980d25292 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Sep 2021 09:45:06.4809 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: y/59btDFq/FJ4tTBUqgH5pqQKg3JZiH/GuYzEsN2PIN+MFO1sRHauEIBtaRF0d7lfupEoBl9Xs4ix7ooUpQEVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5216 Subject: Re: [dpdk-dev] [PATCH v2 1/3] app/flow-perf: support meter policy API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, > -----Original Message----- > From: Rongwei Liu > Sent: Wednesday, July 21, 2021 10:06 AM > To: Matan Azrad ; Slava Ovsiienko > ; Ori Kam ; NBU-Contact- > Thomas Monjalon ; Wisam Monther > > Cc: dev@dpdk.org; Raslan Darawsheh ; Haifei Luo > ; Jiawei(Jonny) Wang > Subject: [PATCH v2 1/3] app/flow-perf: support meter policy API >=20 > Add option "policy-mtr" to indicate if meter creation will include policy= or not. > Meter creation will keep same without it. >=20 > With "policy-mtr", policy is introduced. API create_meter_policy is to cr= eate a > policy. API create_meter_rule will use it to create meter. >=20 > Add option "policy-g_actions" to specify meter policy green color actions= . > W/o this, policy creation will fail since there is no default one. >=20 > Signed-off-by: Haifei Luo > Signed-off-by: Jiawei Wang > Signed-off-by: Rongwei Liu > --- > app/test-flow-perf/main.c | 121 ++++++++++++++++++++++++++++++-- > - > doc/guides/tools/flow-perf.rst | 6 ++ > 2 files changed, 119 insertions(+), 8 deletions(-) >=20 > diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index > 9be8edc31d..e0d94f943a 100644 > --- a/app/test-flow-perf/main.c > +++ b/app/test-flow-perf/main.c > @@ -37,6 +37,7 @@ > #include >=20 > #include "config.h" > +#include "actions_gen.h" > #include "flow_gen.h" >=20 > #define MAX_BATCHES_COUNT 100 > @@ -49,10 +50,12 @@ static uint8_t flow_group; >=20 > static uint64_t encap_data; > static uint64_t decap_data; > +static uint64_t g_actions; >=20 > static uint64_t flow_items[MAX_ITEMS_NUM]; static uint64_t > flow_actions[MAX_ACTIONS_NUM]; static uint64_t > flow_attrs[MAX_ATTRS_NUM]; > +static uint32_t g_policy_id[MAX_PORTS]; > static uint8_t items_idx, actions_idx, attrs_idx; >=20 > static uint64_t ports_mask; > @@ -62,6 +65,7 @@ static bool delete_flag; static bool > dump_socket_mem_flag; static bool enable_fwd; static bool unique_data; > +static bool policy_mtr; >=20 > static struct rte_mempool *mbuf_mp; > static uint32_t nb_lcores; > @@ -69,6 +73,7 @@ static uint32_t rules_count; static uint32_t rules_bat= ch; > static uint32_t hairpin_queues_num; /* total hairpin q number - default: = 0 */ > static uint32_t nb_lcores; > +static uint64_t meter_cir; i see it's defined but not really used, i think all the meter_cir should be= squashed w/ next commit >=20 > #define MAX_PKT_BURST 32 > #define LCORE_MODE_PKT 1 > @@ -134,6 +139,8 @@ usage(char *progname) > printf(" --portmask=3DN: hexadecimal bitmask of ports used\n"); > printf(" --unique-data: flag to set using unique data for all" > " actions that support data, such as header modify and encap > actions\n"); > + printf(" --policy-mtr: To create meter with policy\n"); > + printf(" --policy-g_actions: To set meter policy green color > +actions\n"); >=20 > printf("To set flow attributes:\n"); > printf(" --ingress: set ingress attribute in flows\n"); @@ -573,6 > +580,9 @@ args_parse(int argc, char **argv) > { "unique-data", 0, 0, 0 }, > { "portmask", 1, 0, 0 }, > { "cores", 1, 0, 0 }, > + { "policy-mtr", 0, 0, 0 }, > + { "policy-g_actions", 1, 0, 0 }, i prefer to have those in the end with the actions > + { "meter-profile-alg", 1, 0, 0 }, i don't see any use or parse for meter-profile-alg > /* Attributes */ > { "ingress", 0, 0, 0 }, > { "egress", 0, 0, 0 }, > @@ -802,6 +812,32 @@ args_parse(int argc, char **argv) > RTE_MAX_LCORE); > } > } > + if (strcmp(lgopts[opt_idx].name, "policy-mtr") =3D=3D 0) do we really need this parameter, for std meter user can use --meter for the new one, something like: --policy-meter=3D[G_ACTIONS] I'm trying to reduce the dependencies for any new parameters > + policy_mtr =3D true; > + if (strcmp(lgopts[opt_idx].name, > + "policy-g_actions") =3D=3D 0) { > + token =3D strtok(optarg, ","); > + while (token !=3D NULL) { > + for (i =3D 0; > + i < RTE_DIM(flow_options); i++) { > + if (strcmp(optarg, > + flow_options[i].str) =3D=3D 0) { > + g_actions |=3D > + flow_options[i].mask; > + break; > + } > + } > + /* Reached last item with no match > */ > + if (i =3D=3D (RTE_DIM(flow_options) - 1)) { > + fprintf(stderr, > + "Invalid g_actions " > + "item: %s\n", token); > + usage(argv[0]); > + rte_exit(EXIT_SUCCESS, > "Invalid g_actions item\n"); > + } > + token =3D strtok(NULL, ","); > + } > + } > break; > default: > usage(argv[0]); > @@ -912,6 +948,62 @@ has_meter(void) > return 0; > } >=20 > +static void > +create_meter_policy(void) > +{ > + struct rte_mtr_error error; > + uint32_t policy_id; > + int ret, i, port_id; > + struct rte_mtr_meter_policy_params policy; > + struct rte_flow_action r_actions[2]; > + uint16_t nr_ports; > + struct rte_flow_action actions[MAX_ACTIONS_NUM]; > + uint64_t flow_actions[MAX_ACTIONS_NUM]; > + int lcore_counter =3D 0; > + int lcore_id =3D rte_lcore_id(); not sure that you are using the correct mapping of multiple cores. In short the user can pass: cores=3D90,91,92,93,94,95 The app usually map all cores to new internal ids from 0 - N. While this solution will break the user freedom of choosing any core > + > + memset(actions, 0, sizeof(actions)); struct rte_flow_action actions[MAX_ACTIONS_NUM] =3D {0, 0}; > + memset(flow_actions, 0, sizeof(flow_actions)); uint64_t flow_actions[MAX_ACTIONS_NUM] =3D { 0 }; > + memset(&policy, 0, sizeof(policy)); in rte_mtr_meter_policy_params it have const struct rte_flow_action, and since it's const i really don't like the idea of setting it to 0 by mem= set. it's one time init and that's it > + RTE_LCORE_FOREACH(i) { > + /* If core not needed return. */ > + if (lcore_id =3D=3D i) { > + if (lcore_counter >=3D (int) mc_pool.cores_count) > + return; > + break; > + } > + lcore_counter++; > + } > + lcore_id =3D lcore_counter; > + > + if (lcore_id >=3D (int) mc_pool.cores_count) > + return; no need for such logic, just take the core id as parameter, all this logic = already done > + > + flow_actions[0] =3D g_actions; > + fill_actions(actions, flow_actions, 0, 0, 0, > + 0, 0, lcore_id, unique_data); Will this create one meter for all flows or you are doing new meter for eac= h flow? can you please elaborate? What is the exact goal here? > + > + r_actions[0].type =3D RTE_FLOW_ACTION_TYPE_DROP; > + r_actions[0].conf =3D NULL; > + r_actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; > + r_actions[1].conf =3D NULL; > + > + policy.actions[RTE_COLOR_GREEN] =3D &actions[0]; > + policy.actions[RTE_COLOR_YELLOW] =3D NULL; > + policy.actions[RTE_COLOR_RED] =3D &r_actions[0]; > + > + nr_ports =3D rte_eth_dev_count_avail(); > + for (port_id =3D 0; port_id < nr_ports; port_id++) { > + policy_id =3D port_id + 10; > + ret =3D rte_mtr_meter_policy_add(port_id, policy_id, > + &policy, &error); > + if (ret) > + printf("meter policy add failed " > + "port_id %d\n", port_id); > + g_policy_id[port_id] =3D policy_id; > + } > +} > + > static void > create_meter_rule(int port_id, uint32_t counter) { @@ -928,7 +1020,14 @= @ > create_meter_rule(int port_id, uint32_t counter) >=20 > /*create meter*/ > params.meter_profile_id =3D default_prof_id; > - ret =3D rte_mtr_create(port_id, counter, ¶ms, 1, &error); > + > + if (!policy_mtr) { > + ret =3D rte_mtr_create(port_id, counter, ¶ms, 1, &error); > + } else { > + params.meter_policy_id =3D g_policy_id[port_id]; > + ret =3D rte_mtr_create(port_id, counter, ¶ms, 0, &error); > + } > + > if (ret !=3D 0) { > printf("Port %u create meter idx(%d) error(%d) message: > %s\n", > port_id, counter, error.type, > @@ -942,11 +1041,16 @@ destroy_meter_rule(int port_id, uint32_t counter) > { > struct rte_mtr_error error; >=20 > - if (rte_mtr_destroy(port_id, counter, &error)) { > - printf("Port %u destroy meter(%d) error(%d) message: > %s\n", > + if (policy_mtr) { > + if (rte_mtr_meter_policy_delete(port_id, counter+1, > &error)) > + printf("error delete policy %d\n", counter+1); > + } else { > + if (rte_mtr_destroy(port_id, counter, &error)) { > + printf("Port %u destroy meter(%d) error(%d) > message: %s\n", > port_id, counter, error.type, > error.message ? error.message : "(no stated > reason)"); > - rte_exit(EXIT_FAILURE, "Error in deleting meter rule\n"); > + rte_exit(EXIT_FAILURE, "Error in deleting meter > rule"); > + } > } > } >=20 > @@ -1051,12 +1155,10 @@ create_meter_profile(void) > /* If port outside portmask */ > if (!((ports_mask >> port_id) & 0x1)) > continue; > - > mp.alg =3D RTE_MTR_SRTCM_RFC2697; > - mp.srtcm_rfc2697.cir =3D METER_CIR; > - mp.srtcm_rfc2697.cbs =3D METER_CIR / 8; > + mp.srtcm_rfc2697.cir =3D meter_cir; > + mp.srtcm_rfc2697.cbs =3D meter_cir / 8; > mp.srtcm_rfc2697.ebs =3D 0; > - > ret =3D rte_mtr_meter_profile_add > (port_id, DEFAULT_METER_PROF_ID, &mp, &error); > if (ret !=3D 0) { > @@ -1875,6 +1977,7 @@ main(int argc, char **argv) > dump_socket_mem_flag =3D false; > flow_group =3D DEFAULT_GROUP; > unique_data =3D false; > + meter_cir =3D METER_CIR; >=20 > signal(SIGINT, signal_handler); > signal(SIGTERM, signal_handler); > @@ -1894,6 +1997,8 @@ main(int argc, char **argv) >=20 > if (has_meter()) > create_meter_profile(); > + if (policy_mtr) > + create_meter_policy(); > rte_eal_mp_remote_launch(run_rte_flow_handler_cores, NULL, > CALL_MAIN); >=20 > if (enable_fwd) { > diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.= rst > index 280bf7e0e0..90b6934537 100644 > --- a/doc/guides/tools/flow-perf.rst > +++ b/doc/guides/tools/flow-perf.rst > @@ -354,3 +354,9 @@ Actions: > * ``--meter`` > Add meter action to all flows actions. > Currently, 1 meter profile -> N meter rules -> N rte flows. > + > +* ``--policy-mtr`` > + Add policy-mtr to create meter with policy. > + > +* ``--policy-g_actions`` > + Add policy-g_actions to specify policy green color actions. > -- > 2.27.0