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 CDDCCA0562; Wed, 14 Apr 2021 18:21:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD714161BBF; Wed, 14 Apr 2021 18:21:09 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2058.outbound.protection.outlook.com [40.107.243.58]) by mails.dpdk.org (Postfix) with ESMTP id 9EBAB4013F for ; Wed, 14 Apr 2021 18:21:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3pz7iW4wLhj1PgF6vEjoEduMSCRISzv/+lc/ANJrNCUDk1Ag60y9DC/XevKa3RpZZW9zkJ6Lp/kWH1iz/556sPOecrELdo+nP7lQCcEGcP6zUWzrZJms70+h0nsqbuj6MxN1Fugn/a5BfWbs+p8vKXPDhwbtylYn7w7NIyvB0lhOt2QaVUAYLhpl/ehjTyUrTQ+HujJQ3Cg8xcMzigMQqsE6j6wDOtB/iXGFVFyrTFBhMBAfyNdz+8KkeCkbam3gG7zvlatGPjCtyJ2w2OnZSum3vinpa9S1g+ihGJXq31DsVkklvkbtzUOeQSJlVyABMn4xu9vZfstsrosHTeBtw== 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=1V7cZSmZR78mvXTlIaqCUiiT+Mv73uadZa+3dY/7InM=; b=QBj5nAICWvJDKIuMdVaUbCd2ZloaHq583NNRJ1inlyLCXMx/ZuBWB2omU6VyXvblUJ1qvbANsoGz44LysK2XhbD+C25srvwVpanZjorgxkg7cBB1b1HDEUBbGXAB8/6NBcPnn93XIVJ1yBHfbxdXHx7U6wYxJiIWPmmLrff6p6PH8b4U6cJdiahcWLJ7yR3bnM8uYW708vOkFGFRlI2GMcYRj8ydKY4jrVAYyHNf+oAGER6ICUbB73/FNJ42LvizCUkeR+i2O4sfiZrtfMZb9ihd5GW2ziaq5jIiqvooQqucuFcVDxravrIVvaqcmi8PXZUj8jseXW9yUVFRwlES+g== 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=1V7cZSmZR78mvXTlIaqCUiiT+Mv73uadZa+3dY/7InM=; b=cN5wNaQGxI51Lq2sMf1gGd+rTUvjA+mjB99pj7zbUx3ww/TbHqR5DnDSwwW1KbCWm4oA5KzKPJzm6WKMrwNalVAqB+CfM3nI6WKkX0hYKn1FLnrwVp8NB+DnX7mgfmDm0105yL0fTnx5UvYxyhFl1yk+1TexsjRmUiEFsFXSxJOf4M10Pxetj0BYeHibPh100mEyLXSUZLtzgpwgZwhnWRhfsqhlNaMVaQUnMafvIR/0QfCY3scBVumw8K5L57mp2N9CeKzXlxXZYgJcssHWhhK//6Ch7D/XjBU7OUsdGMWjCwmyZesrA/YQfl7EmsiuxDmfxEx0y4FPlNxcNl7FGA== Received: from DM6PR12MB4090.namprd12.prod.outlook.com (2603:10b6:5:217::11) by DM6PR12MB4044.namprd12.prod.outlook.com (2603:10b6:5:21d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16; Wed, 14 Apr 2021 16:21:07 +0000 Received: from DM6PR12MB4090.namprd12.prod.outlook.com ([fe80::fd19:da7e:347b:87da]) by DM6PR12MB4090.namprd12.prod.outlook.com ([fe80::fd19:da7e:347b:87da%4]) with mapi id 15.20.4020.023; Wed, 14 Apr 2021 16:21:07 +0000 From: Li Zhang To: "Dumitrescu, Cristian" , Asaf Penso , NBU-Contact-Thomas Monjalon CC: Ori Kam , Slava Ovsiienko , Matan Azrad , "lironh@marvell.com" , Wisam Monther , "Li, Xiaoyun" , "Singh, Jasvinder" , "Yigit, Ferruh" , Andrew Rybchenko , Ray Kinsella , Jerin Jacob , Hemant Agrawal , "dev@dpdk.org" , Raslan Darawsheh , Roni Bar Yanai , Haifei Luo , "Jiawei(Jonny) Wang" Thread-Topic: [dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined meter policy API Thread-Index: AQHXMHW5yIwGcMe8JEqKD9UyeVyGTKqzW1+QgABMqYCAAAyXAIAAV5kAgAAPXAA= Date: Wed, 14 Apr 2021 16:21:07 +0000 Message-ID: References: <20210318085815.804896-1-lizh@nvidia.com> <24522212.gn4sJpSb88@thomas> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [139.227.253.12] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: eb0fd8ea-fbde-43f9-b192-08d8ff614ed6 x-ms-traffictypediagnostic: DM6PR12MB4044: 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:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mmEDcaRfweKc/tXVbu2vAxU3uaBTFSubcdg7+0r6WIZTRkyjf8ckAZj889BQLd3TKofrppLh7QKvjCKa5jXE1JRk5iwKwhKJjPmbdPmJXYn937CPzszx30J1vsakAdflmKRFfuebYmInRTTq/bKTzh9Kvyv8Oa6ubTuwOSuVsmVpbxDsVm8WOcCLzuWpTf/xIwyX71mlQG5oWtOHVoGQux8dcGbq91rbipk6Gbd4bxJkRWuVy4S0+Lo8mOIqjHw0nyPzM3faDW2+qEcaE2JBxpoKnWUdXX8rLykKRvNlQ1FNnY6R5L5IzgXF1RGE7AkJ31MgAXmgzyYzTP44r+VsOukbI6RIRJJ6qRwotkb3dLE1FMws4JOVxIUqFXxCR5q0kUrxlKreZuUo8PeKb6M1Py+q043F7ZV94+9/Hf6/jkkXOZ2bFwoWy+wo2M0IlXMzoKfq8KQToQsDaRF/hRPg9B75KJwzb9VDkfsxINH/9JtATJqhRiwptQcZKmAYlqZxKLAlfe73ILBDUXXmrrRHz1MToFWOakClOf3PkO9DKl4YhXhiZlxzMjiMirdluEvRcYIGaAQ27WdjSkSF1Jv9zFJkDBlXPJiKFe/9OEjr5wY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4090.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(136003)(39860400002)(346002)(366004)(5660300002)(107886003)(55016002)(186003)(9686003)(71200400001)(478600001)(83380400001)(52536014)(53546011)(6506007)(26005)(4326008)(33656002)(76116006)(7416002)(7696005)(54906003)(86362001)(8936002)(8676002)(110136005)(38100700002)(122000001)(2906002)(66476007)(64756008)(66556008)(66946007)(66446008)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?kYefSDKn1OhI9hvAe9YpRW+7h6waY7gYSIaRvtNUbv959LjqLT1PUKT5Z8cw?= =?us-ascii?Q?KBXz01/V/Rmd0gNdl5cGOh+VF75Jz2zUnUY76L+c9NSAXS8+MfZIEx3a8tTo?= =?us-ascii?Q?ZUpn1i3rssjcVJMcOLDcB0/IuuwrHBdWQLbJNJidn0LbXu+s3qHeD1UsOiyY?= =?us-ascii?Q?ElUqFDrDmqAPv+Sm4MI5tio/u3+1bb7uXQUFz0xRvQVxKzifcirqcDu9qrjc?= =?us-ascii?Q?48tWU2UohetKp2z3WgYeL5Q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BbXg0YK4mg7msW/CuiT2jWgOo8t+ZQirFKoxZAtHRRz5QifNZQsz?= =?us-ascii?Q?8wVtHNon6jYJr91TpgrZ+0+dsyAvzOYOtshqQ5MUHuB6shIo0I3S/H+8t3xY?= =?us-ascii?Q?hUOh0X+jcRyZdtDgbcvWalhhGtfXEsSb5MjMAlYHAhiwvdSGq0IR4+/ISMox?= =?us-ascii?Q?RKBB1F+aI5COaVY3aRu/xV6K?= 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: DM6PR12MB4090.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb0fd8ea-fbde-43f9-b192-08d8ff614ed6 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2021 16:21:07.0806 (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: 5w4E6VUiTsG409yiaSp0h3dGksX0JilGtdwW+WrRab1nhUClc9rpbdwdPyHE+id5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4044 Subject: Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined 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 Cristian, Thank you for giving suggestion. Will add in V7 patch. Regards, Li Zhang > -----Original Message----- > From: Dumitrescu, Cristian > Sent: Wednesday, April 14, 2021 10:01 PM > To: Asaf Penso ; NBU-Contact-Thomas Monjalon > ; Li Zhang > Cc: Ori Kam ; Slava Ovsiienko > ; Matan Azrad ; > lironh@marvell.com; Wisam Monther ; Li, Xiaoyun > ; Singh, Jasvinder ; Yig= it, > Ferruh ; Andrew Rybchenko > ; Ray Kinsella ; Jerin > Jacob ; Hemant Agrawal > ; dev@dpdk.org; Raslan Darawsheh > ; Roni Bar Yanai ; Haifei Luo > ; Jiawei(Jonny) Wang > Subject: RE: [dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined meter poli= cy > API >=20 > External email: Use caution opening links or attachments >=20 >=20 > > >14/04/2021 06:55, Li Zhang: > > >> > > + * Example #2: GREEN - Do nothing, YELLOW - Do nothing, RED - > > DROP > > >> > > + * struct rte_mtr_meter_policy_params policy_1 =3D > > >> > > + * (struct > > >> > > rte_mtr_meter_policy_params) { > > >> > > + * .actions[RTE_COLOR_GREEN] =3D NULL, > > >> > > + * .actions[RTE_COLOR_YELLOW] =3D NULL, > > >> > > + * .actions[RTE_COLOR_RED] =3D (struct rte_flow_actio= n[]) { > > >> > > + * { > > >> > > + * .type =3D RTE_FLOW_ACTION_TYPE_DRO= P, > > >> > > + * }, > > >> > > + * { > > >> > > + * .type =3D RTE_FLOW_ACTION_TYPE_END= , > > >> > > + * }, > > >> > > + * }, > > >> > > + * }; > > >> > > + * > > >> > > > >> > These two example policies should be available to be used > > >> > straight away, please make them real data structures, not comments= . > > > > > >Wait, you are giving code examples as part of doxygen? > > >It's really too long, we don't do that. > > > > > >> > I suggest their names as: pass_color_policy_params and > > >> > drop_red_policy_params. > > >> > > > >> Thanks. Will change the names. But it can not be real data > > >> structures, > > since it > > >just one example define and no use code. > > >> It will bring build as below: > > >> error: 'drop_red_policy_params' defined but not used. > > >> User can copy these example to his .c file when it using > > >rte_mtr_meter_policy_add(). > > > >=20 > Although these could be looked at as examples, they are really more than > examples: they are expected to be frequent policies that users would requ= ire, > so it would be good to have them with the API itself. >=20 > Li, I agree we cannot instantiate structs in the header file, how about w= e > place them as macros in the header file: >=20 > #define rte_mtr_policy_pass_color struct { \ ... >=20 > #define rte_mtr_policy_drop_red struct { \ ... >=20 > Regards, > Cristian