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 99F41A0548; Sun, 9 May 2021 12:47:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D40E40140; Sun, 9 May 2021 12:47:43 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2080.outbound.protection.outlook.com [40.107.223.80]) by mails.dpdk.org (Postfix) with ESMTP id F11C54003E for ; Sun, 9 May 2021 12:47:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cxq78QNYRcxegHQAHDnqlDvpDwy17oBgUCaArPmr3VWYayRBodNkQnJYB3zqdGRmd4b8j1NNAmvA2ZxFnX4H7g36Z1/GpGjmRTaaK9eIgLAsNugVqxf7BfUm5b74ZqO47Whg/bHy6HoIFqIJlJnYuU3kVccUPi2tZbjSLsE1IYTqG6UbAtrnPPnT2X3OA+fhoeFB1O1hJJ8UYCxRR68+bfAHBUpjy6C5Tj2YmN64tzZw+M1xonu34Xhwh5y4ZjBYnYvajGpJC/kQzi/2+7a15PqAWK5CqSuC4sikNSEDDYRr9waQ6pdUpfK8j/FPo3T7bI/4ZQ6pJfSbGkP72oS2fw== 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:X-MS-Exchange-SenderADCheck; bh=iczBNOCXO4lvN0LJdMRkrY5Sdl/ohdgS4jNHTKnnefw=; b=GIbVjKNX9x4XQvR9NbHDS6cdb7L2v28fac1kdT0nKg6W28rZhFRq9PHnRh2yTs3S4gozwRSwhMeIDdq+P+BoefJMJ3S95Zzeo2TX9lHKDItzl3BhSvYNheUO9p44dwzcHazrK5WlpW3AeaEdK/7Bs89j9eIRyTxAgnGSQFRJV0P7bOxSJEqrlDT3036F/2Ygk7EdiaU/fG6gvClFvGOPCsyyeL67v1JS6/bOkH7Ski+uH7DqUdr2iaKA4dqKMrmngkE2fJUwImWyA79zk88l5RQX20/n5B6sx+NmXfDYnboJrmADr7PRMSXXKM+vTrzHu+zNbZ6OL3o9GrwBJpTvAA== 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=iczBNOCXO4lvN0LJdMRkrY5Sdl/ohdgS4jNHTKnnefw=; b=evYmOIn5b0HB/zWA31pEoJbaWMwRsR0Nrc86ExQ9NUaNf2yo7yCvf5Kh4s+4HYPz1r1RYJ8TMw18dlIuos3XFy+fNMb66e41mqJpvpsrFUGai5b5syqz2TltxFtejTOg0sBJHim5rj2VlV9pY3jMKPTwDf5AlG1Gmvq5KimnIOZd+C2QUvAp/mGglmXpSTyeTOsQt1tB1nJq1R6q98iHLoRYmXU9VQ9omtPaDdDK9i6whOatF1WFGx+Nz7AauP9BRefqwzTb4TkHZCKV/g4VhVZ++hPQtv1AXazjOHxCbLGppOtjgF09eJoMofHwoewr/CAJI5s5TFZsXSJsUFB4wQ== Received: from DM4PR12MB5039.namprd12.prod.outlook.com (2603:10b6:5:38a::18) by DM4PR12MB5390.namprd12.prod.outlook.com (2603:10b6:5:39a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.31; Sun, 9 May 2021 10:47:39 +0000 Received: from DM4PR12MB5039.namprd12.prod.outlook.com ([fe80::8d9c:a567:9dae:b33e]) by DM4PR12MB5039.namprd12.prod.outlook.com ([fe80::8d9c:a567:9dae:b33e%2]) with mapi id 15.20.4108.031; Sun, 9 May 2021 10:47:39 +0000 From: Wisam Monther To: Haifei Luo , "dekelp@nvidia.com" , Ori Kam , Slava Ovsiienko , Matan Azrad , Shahaf Shuler CC: "dev@dpdk.org" , NBU-Contact-Thomas Monjalon , Raslan Darawsheh , Roni Bar Yanai Thread-Topic: [PATCH] app/flow-perf: support meter policy API Thread-Index: AQHXKrEy31TgxiceZUecpa7HxB3HgKrbKhCA Date: Sun, 9 May 2021 10:47:39 +0000 Message-ID: References: <1617691848-94564-1-git-send-email-haifeil@nvidia.com> In-Reply-To: <1617691848-94564-1-git-send-email-haifeil@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-originating-ip: [37.142.173.100] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f4620783-eeac-4177-4aa7-08d912d7dda2 x-ms-traffictypediagnostic: DM4PR12MB5390: 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:64; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: G/SwL3G+g+bJYpmuyjPcokRcr2dm8Ss25qwo+wz59jJrcku5FLljpY6asuaorfARJE71zP2FooHLCUTtAnVTM9Xyx/cDyYrFHkuZ/WYOGVmrQOGdBMGHWpoX7+H7plP2G8iKPLAYp/sg4weuEWp5K6+r9QjPxE9mvPrhWMlIPToQXi+mcN1Irw6QwgrVonp0GNQ2lusQzmstdm1yXWPYL7YQuqyiVdPQxZ7XyBdJLqW79mabaSlTFxDhPDRJPaTBc3BVIS2z53C/ws8s+qL1QSNV87oMedbD2b/Iaj2jhkyop4bhzjCQW+fE91f+jX+3I8A0WFtqns9ym2kha5U+5CvAG00nPBXq5oYIwm3ZLbbJk0J4qfZy47r0qcgDl81C3dLtz5NOl9VNJHc4kYAG6MXFfQ+LkAD+8uGUenxSYzBEGveeu6DQrDgNDLV675GNouzd7k6age3x+rHUS65tIrEjfpm1eH064EQEVKB2UwWnyPzy5c+ivtsxdzSWdqs0Yfq05uPWwk+9+cC+micONaQxCyOui+wEUSLUZhM2c53qA2zcHZArGvvBnjCKZUCxz6IS3Im3vqLiGNWPYj1E+aZNxq0H/bBzxrAOiTbTZdja0oEx50/hHsJXUwR4FzimLIDN357okhbZaDkQmIrKk6sw6tpxG27PZ+/krxghHDHdYS4Yqhsd2EXnuhgnRN3K 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)(396003)(136003)(376002)(366004)(346002)(39860400002)(52536014)(9686003)(5660300002)(64756008)(71200400001)(55016002)(38100700002)(8936002)(478600001)(966005)(122000001)(4326008)(66556008)(107886003)(2906002)(86362001)(7696005)(6506007)(6636002)(53546011)(316002)(8676002)(186003)(33656002)(66476007)(26005)(66446008)(54906003)(66946007)(110136005)(83380400001)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?fPplJYsZQeO8r+QwBUKxEXA9eYZndtWMTQRS93U0trpl39iOJMp1/3Mr9OzV?= =?us-ascii?Q?WH4GYANcG8Gt8rXEbp8pJk24dHGkoH8eaOWsjZK2oCdmXvYrV3CFvKD1cZ34?= =?us-ascii?Q?c85Ypx6ZeiRx+v/CyKajBYn4a2f3pipLKvgPImeua3E/c8D3YjtJGWXEHGEZ?= =?us-ascii?Q?/Tja3U3uvKS6F9TPgrpUbcH47gSvSk1iBWghleW4tesSYkP0xNnPhwo1Pocc?= =?us-ascii?Q?c3AIX/dlq37Nj1xJd15S7Xv4XATA0wHcQg6ompHhpEHJtN+a2zRxRyiloeai?= =?us-ascii?Q?kxT0EYB+DDc35kj+cpx1sVnMK5qVOp30slaVWzYAEXCMZM619Az8nfEAWYks?= =?us-ascii?Q?LY2Iev44v0VHkqI5jj8mnR6IhXEZHhJD6QLRZChkHlSTVAwPNHcr+S2WaXQp?= =?us-ascii?Q?gXbBEc2tfvHInJUpTZqrBYF7RqBvSWg4sSX5Hd1+vWSmiX+t5VZpJ3dbsl/j?= =?us-ascii?Q?qSgE4OjEYDrgf5pv+RKJLU6xy/FbA1INmRI4WODFi9SJggWVHobVlBqh4qyZ?= =?us-ascii?Q?NZtb96S0UttwU9CClEd2brL4287Q2PZkC+klUgoHCPuw4wVRsYjxO26/vPZu?= =?us-ascii?Q?WZhNnWMIReQKuX6LnLqg7ejs9AEb5ah0k1EfxVdRRA3Zh/EuZeUFu+8ntMc5?= =?us-ascii?Q?0FcdCXnGs1G6eo9YJV93nLGiYmBpGZ1xJQEvTMGFBeueN2+2UUZHiuYAj5qE?= =?us-ascii?Q?k1mQf9pb9zayWTXfq9QMFpUxfNuN3GiO55o0w8ssjt6B3TclChtHkBvWgPvB?= =?us-ascii?Q?EoTiqebL4DMxdYgopdmWPSWn/ZXZepjuzr7I2BqsVsdKmFbZGz52HfBgQrAU?= =?us-ascii?Q?fO9ssRuGYD1hSDe5P62n8rSt4GzSzED/gdHOje1i9g93gWfGpV8x/9N67O7a?= =?us-ascii?Q?Ga1RIrfxTMe8kopVc94Ak48rQIaNeTnt7gD9Kr/w38BPdLCYLf/79y9DAo5M?= =?us-ascii?Q?+FmAKkOp2FglGXcNLuhO2o7MWZwoUplFYZDsWpy5GWXFCuCjz8PGwEHeWdLW?= =?us-ascii?Q?uIdVsFB6C3VqI/rl1I6VFHwivXB1nWO5uCwOstclj/6jrklutAHW459XnBo8?= =?us-ascii?Q?0bnDX7cVRWfOjQQC8VffGnmmGIsaF/mo8ZvUZP0YYZ2jM2LujMNvj3whXzxh?= =?us-ascii?Q?W5VXJ8SnTFvwtYJJVz4/kwXFebK4iKAMuIOSLE+0VYMIwG3OXlGV/gYQB4In?= =?us-ascii?Q?QitONTYKPy+AMR+C+GHRWL4ybLatjaoA5vFx/bxWfhTSFqArv93cn1eOo7x7?= =?us-ascii?Q?GFerq2XbXH6seHY9R7Fo55kelzVP1F8NuranjYJbo0FWCQCh8lypLiNGKvkR?= =?us-ascii?Q?QRunBTgKGEk2Qy/1S4mEdtog?= 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: f4620783-eeac-4177-4aa7-08d912d7dda2 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2021 10:47:39.3901 (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: 9+toQFLLd086yyGwAPl8P1GmQjnc20yotbzv1n9UcnWZsVGR8bThsbVcMOVNIp/8GXoJ2RB6geaKD2CMvgELWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5390 Subject: Re: [dpdk-dev] [PATCH] 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: Haifei Luo > Sent: Tuesday, April 6, 2021 9:51 AM > To: dekelp@nvidia.com; Ori Kam ; Slava Ovsiienko > ; Matan Azrad ; Shahaf > Shuler ; Wisam Monther > Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon > ; Raslan Darawsheh ; Roni > Bar Yanai > Subject: [PATCH] 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 > Depends-on: series=3D16037 ("Support meter policy API ") > https://patchwork.dpdk.org/project/dpdk/list/?series=3D16037 >=20 > Signed-off-by: Haifei Luo > --- > app/test-flow-perf/actions_gen.c | 6 ++- app/test-flow-perf/actions_ge= n.h > | 3 +- > app/test-flow-perf/config.h | 6 +-- > app/test-flow-perf/flow_gen.c | 2 +- > app/test-flow-perf/main.c | 93 > ++++++++++++++++++++++++++++++++++++++-- > doc/guides/tools/flow-perf.rst | 3 ++ > 6 files changed, 102 insertions(+), 11 deletions(-) >=20 > diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow- > perf/actions_gen.c > index 1f5c64f..248e19a 100644 > --- a/app/test-flow-perf/actions_gen.c > +++ b/app/test-flow-perf/actions_gen.c > @@ -19,7 +19,6 @@ > #include "flow_gen.h" > #include "config.h" >=20 > - > /* Storage for additional parameters for actions */ struct additional_p= ara { > uint16_t queue; > @@ -30,6 +29,7 @@ struct additional_para { > uint64_t encap_data; > uint64_t decap_data; > uint8_t core_idx; > + uint16_t port_id; > }; >=20 > /* Storage for struct rte_flow_action_raw_encap including external data.= */ > @@ -907,7 +907,8 @@ struct action_rss_data { void fill_actions(struct > rte_flow_action *actions, uint64_t *flow_actions, > uint32_t counter, uint16_t next_table, uint16_t hairpinq, > - uint64_t encap_data, uint64_t decap_data, uint8_t core_idx) > + uint64_t encap_data, uint64_t decap_data, uint8_t core_idx, > + uint16_t port_id) > { > struct additional_para additional_para_data; > uint8_t actions_counter =3D 0; > @@ -930,6 +931,7 @@ struct action_rss_data { > .encap_data =3D encap_data, > .decap_data =3D decap_data, > .core_idx =3D core_idx, > + .port_id =3D port_id, > }; >=20 > if (hairpinq !=3D 0) { > diff --git a/app/test-flow-perf/actions_gen.h b/app/test-flow- > perf/actions_gen.h > index 77353cf..f846734 100644 > --- a/app/test-flow-perf/actions_gen.h > +++ b/app/test-flow-perf/actions_gen.h > @@ -19,6 +19,7 @@ >=20 > void fill_actions(struct rte_flow_action *actions, uint64_t *flow_action= s, > uint32_t counter, uint16_t next_table, uint16_t hairpinq, > - uint64_t encap_data, uint64_t decap_data, uint8_t core_idx); > + uint64_t encap_data, uint64_t decap_data, uint8_t core_idx, > + uint16_t port_id); >=20 > #endif /* FLOW_PERF_ACTION_GEN */ > diff --git a/app/test-flow-perf/config.h b/app/test-flow-perf/config.h in= dex > 3d4696d..50dbf90 100644 > --- a/app/test-flow-perf/config.h > +++ b/app/test-flow-perf/config.h > @@ -8,15 +8,15 @@ > #define GET_RSS_HF() (ETH_RSS_IP | ETH_RSS_TCP) >=20 > /* Configuration */ > -#define RXQ_NUM 4 > -#define TXQ_NUM 4 > +#define RXQ_NUM 10 > +#define TXQ_NUM 10 This is irrelevant change > #define TOTAL_MBUF_NUM 32000 > #define MBUF_SIZE 2048 > #define MBUF_CACHE_SIZE 512 > #define NR_RXD 256 > #define NR_TXD 256 > #define MAX_PORTS 64 > -#define METER_CIR 1250000 > +#define METER_CIR 1250000000 Why to change the default? > #define DEFAULT_METER_PROF_ID 100 >=20 > /* This is used for encap/decap & header modify actions. > diff --git a/app/test-flow-perf/flow_gen.c b/app/test-flow-perf/flow_gen.= c > index df4af16..62e4cf5 100644 > --- a/app/test-flow-perf/flow_gen.c > +++ b/app/test-flow-perf/flow_gen.c > @@ -61,7 +61,7 @@ struct rte_flow * >=20 > fill_actions(actions, flow_actions, > outer_ip_src, next_table, hairpinq, > - encap_data, decap_data, core_idx); > + encap_data, decap_data, core_idx, port_id); >=20 > fill_items(items, flow_items, outer_ip_src, core_idx); >=20 > diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index > 66ec776..9a0d758 100644 > --- a/app/test-flow-perf/main.c > +++ b/app/test-flow-perf/main.c > @@ -53,6 +53,8 @@ > static uint64_t flow_items[MAX_ITEMS_NUM]; static uint64_t > flow_actions[MAX_ACTIONS_NUM]; static uint64_t > flow_attrs[MAX_ATTRS_NUM]; > +uint32_t g_policy_id[MAX_PORTS]; > + > static uint8_t items_idx, actions_idx, attrs_idx; >=20 > static uint64_t ports_mask; > @@ -61,6 +63,7 @@ > static bool delete_flag; > static bool dump_socket_mem_flag; > static bool enable_fwd; > +static bool policy_mtr; >=20 > static struct rte_mempool *mbuf_mp; > static uint32_t nb_lcores; > @@ -114,6 +117,13 @@ struct multi_cores_pool { > .cores_count =3D 1, > }; >=20 > +/* Storage for struct rte_flow_action_rss including external data. */ > +struct action_rss_data { > + struct rte_flow_action_rss conf; > + uint8_t key[40]; > + uint16_t queue[128]; > +}; > + Why you create this struct? > static void > usage(char *progname) > { > @@ -131,6 +141,7 @@ struct multi_cores_pool { > printf(" --enable-fwd: To enable packets forwarding" > " after insertion\n"); > printf(" --portmask=3DN: hexadecimal bitmask of ports used\n"); > + printf(" --policy-mtr: To create meter with policy\n"); It's worthy to mention the current supported policies here, and also what i= s the default. >=20 > printf("To set flow attributes:\n"); > printf(" --ingress: set ingress attribute in flows\n"); @@ -569,6 > +580,7 @@ struct multi_cores_pool { > { "enable-fwd", 0, 0, 0 }, > { "portmask", 1, 0, 0 }, > { "cores", 1, 0, 0 }, > + { "policy-mtr", 0, 0, 0 }, > /* Attributes */ > { "ingress", 0, 0, 0 }, > { "egress", 0, 0, 0 }, > @@ -798,6 +810,10 @@ struct multi_cores_pool { > rte_exit(EXIT_FAILURE, " "); > } > } > + if (strcmp(lgopts[opt_idx].name, > + "policy-mtr") =3D=3D 0) { > + policy_mtr =3D true; > + } > break; > default: > fprintf(stderr, "Invalid option: %s\n", argv[optind]); > @@ -909,6 +925,60 @@ struct multi_cores_pool { } >=20 > static void > +create_meter_policy(void) > +{ > + struct rte_mtr_error error; > + uint32_t policy_id; > + int ret, i, port_id; > + const struct rte_flow_action *acts[RTE_COLORS]; > + struct action_rss_data rss_data; > + struct rte_flow_action g_actions[2], r_actions[2]; > + uint16_t nr_ports; > + > + memset(&rss_data, 0, sizeof(rss_data)); > + rss_data.conf.func =3D RTE_ETH_HASH_FUNCTION_DEFAULT; > + rss_data.conf.level =3D 0; > + rss_data.conf.types =3D GET_RSS_HF(); > + rss_data.conf.key_len =3D 0; > + rss_data.conf.key =3D NULL; > + rss_data.conf.queue_num =3D RXQ_NUM; > + uint16_t q_data[RXQ_NUM]; > + rss_data.conf.queue =3D q_data; > + > + for (i =3D 0; i < RXQ_NUM; i++) > + q_data[i] =3D i; > + > + for (i =3D 0; i < RXQ_NUM; i++) > + rss_data.queue[i] =3D i; > + > + g_actions[0].type =3D RTE_FLOW_ACTION_TYPE_RSS; > + g_actions[0].conf =3D &(rss_data.conf); > + g_actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; > + g_actions[1].conf =3D NULL; > + This is some fixed behavior, it's not that right to use something like this= , Example of other solution to have option like: --meter-w-policy=3DG:, Y:, R: This way it will be easier to use, and more dynamic, it's never right to se= t fixed actions For such application. > + 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; > + > + acts[0] =3D &g_actions[0]; > + acts[1] =3D NULL; > + acts[2] =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_create(port_id, > + policy_id, > + acts, &error); > + if (ret) > + printf("meter 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) { > int ret; > @@ -924,7 +994,14 @@ struct multi_cores_pool { >=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, > @@ -938,11 +1015,16 @@ struct multi_cores_pool { { > 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("erro 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"); > + rte_exit(EXIT_FAILURE, "Error in deleting meter > rule"); > + } > } > } >=20 > @@ -1876,6 +1958,9 @@ struct multi_cores_pool { >=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 017e200..50fe683 100644 > --- a/doc/guides/tools/flow-perf.rst > +++ b/doc/guides/tools/flow-perf.rst > @@ -349,3 +349,6 @@ 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. > -- > 1.8.3.1