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 69BA8A0553; Thu, 26 May 2022 14:34:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DB9540151; Thu, 26 May 2022 14:34:01 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2042.outbound.protection.outlook.com [40.107.236.42]) by mails.dpdk.org (Postfix) with ESMTP id 3CCF240150 for ; Thu, 26 May 2022 14:34:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LuraQjURygKZZ2Rjs4sAO7QQ2u5Mqx47OnRgJE5ITmDGCwkOb1lpun4fPxZDLW99FWs6oA0dLlPI+Pa9gpMFNGKMT5FQxiKOolv7LSKS3/ugGlciYCMlBEYi2QAY/BED6+B/zlKbzNsy0UKUhA18tl4Ijs5qA+HWyS0BSlWb7mZEC8cAr10uYTg2oR70i9VD3Iur73NnFpa0pO8sfsnzOOJE32ZQr2iKwRPYg4ePPit2vIvOAAKK4NqDmGXOBdrsuruiNliumq9c62XGZdHCKhLEtV/bVqgPQFlWrparyYMPed+z2Xk5pJTmAsw6jLPxCrkIN3Hvwre/mS9QUWCNtA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JDMgYaU8xpHMzDOv8jv27kkM33eS0dAZ+28stEzCbRs=; b=VOL+lZJoX4SMFDFPTLAwicxPLTArSlMgWjX0gFXRTteCwSIhUtbbg43tIAhorQ5VD1PrL2Jke/pHRiNd0fsMdRXNXUMrBB/wxrZK7qMq/Syg5uY4BxahFupHDnSUgrK31K4iH50QRTWzmYvdM5hqUiTPWcMXmd/154GYn2tgWZmvQpCn4N/csw2PF4r3xkUgMhaG0u3uQy2HwXbgQBYQxmCS8XWb8Xp3r6wCIy+f+HilPVZWWzM6/SYJRzmYBcin9trNRhqnKHYQ4nOGed2+hMX998yOFhBYAjfVD5xnIqnC7k6cDh2T4Hs17M0SvYn4eNsR9L1N9KVmzt25snDb6g== 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=JDMgYaU8xpHMzDOv8jv27kkM33eS0dAZ+28stEzCbRs=; b=hinNb7oojBQzmiyVJwWojdu+6jWI1MoZhwgR5jNHVqDKyiT9aRDssl9JbJxnR85IfL8FdFcdfVs11Uw0DIZuWQz2+EneHtEObGDJsgBckJGe2Qt2YAA8E6i39Btg7gqgc94SHYeZzom5LvQB5k0OuS9Ej4B5zh3283SpswI/6TiLcbXEgqIXVfNQMnXY6LpvH08z2e0wtKSDRfJDDxI5y4c61Z6QaoRBGd6Ix586VKAYu/aLgd5LzLM7K9tsfGea4v/74Wkr+UxpjoZNOMvzxt9JVL8V4xXsZKCii0FK4fhKTU+MNV3GFMweiMfQHnXbXWaipxHq8QXu90F1l9Lo/A== Received: from MW2PR12MB4666.namprd12.prod.outlook.com (2603:10b6:302:13::22) by BN8PR12MB2865.namprd12.prod.outlook.com (2603:10b6:408:96::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 12:33:58 +0000 Received: from MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::edeb:4144:1ee4:83a1]) by MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::edeb:4144:1ee4:83a1%6]) with mapi id 15.20.5293.013; Thu, 26 May 2022 12:33:58 +0000 From: Ori Kam To: Alexander Kozyrev , "dev@dpdk.org" CC: "NBU-Contact-Thomas Monjalon (EXTERNAL)" , "ivan.malov@oktetlabs.ru" , "andrew.rybchenko@oktetlabs.ru" , "ferruh.yigit@intel.com" , "mohammad.abdul.awal@intel.com" , "qi.z.zhang@intel.com" , "jerinj@marvell.com" , "ajit.khaparde@broadcom.com" , "bruce.richardson@intel.com" Subject: RE: [PATCH v2 4/4] ethdev: add meter color mark flow action Thread-Topic: [PATCH v2 4/4] ethdev: add meter color mark flow action Thread-Index: AQHYbcnnVEOpQN9DG0OywRzkPAePgq0xHUpQ Date: Thu, 26 May 2022 12:33:58 +0000 Message-ID: References: <20220518043459.1281590-1-akozyrev@nvidia.com> <20220522105102.1692526-1-akozyrev@nvidia.com> <20220522105102.1692526-5-akozyrev@nvidia.com> In-Reply-To: <20220522105102.1692526-5-akozyrev@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4fb4cf93-756f-4586-974e-08da3f14017c x-ms-traffictypediagnostic: BN8PR12MB2865:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eaOOxQuD6rWoRWRMKatbz9lJnFaOFNr4EKekdbTdnrpyW2U9MTa+nlkkAYNTuKkA/JGyz6y+6RCJtj1pV356KYDFeNZol5fwJORxfdSP9NMJXq/4Fa0h1ChnteludOhihUkZO0f5zR35miEu02gNqX5kP1yxGKEkZkg+sIQFWwbrreedZJcLOTnwKFO8d+HhYJ/QoLGsGK76XAfRgBM/4dkVNIsxk25q1aB+QC4fqQKZVV4epVXeNhjiMUISQrq0j+BjcVA4LPnKHMra/UF9bcFk4pxVOjMn8B1A4MH3pI08dae3aNKECpkK9ixXk49/FjoyXbvit2pK/WAHiESjybj69kvRq10kk0KbpwtSbLw5Lij4ydZltM0nDFYby9tx7rZ7RgAakO7LQa5+BuHQcPFWLjovhHU0RldwmiMkHXYeQBg8jXaihXP9hBz3RqJphQNH7eD6hDD8YIzsAFCb+FYMJaAaNIrhuDRb5GXTngFxeoUXTAhvftxCvwnl2MqSUgBH4AcVtk3TZa70UpkPtrMgbI336QwqLLd0Q6FPWGiyD4cbI55D2fPs8oKf03LU8LkKVeEa8iKvzGL+5R9WN1s9zPWTaDZRi3CAttakjOtlh5cEZyvYyy8L8qyHt3WfMSob7duAbSnhXQkMZT6vPUm+8EqOC5NnK5oG/OngvRLB4jJH8LxHV6xWja7MVz61DBO2fHlc7MMNkHB7HukTcg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB4666.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(76116006)(8936002)(52536014)(508600001)(5660300002)(38070700005)(9686003)(66446008)(64756008)(66476007)(4326008)(71200400001)(8676002)(66556008)(33656002)(86362001)(53546011)(110136005)(54906003)(186003)(316002)(66946007)(7696005)(122000001)(6506007)(2906002)(38100700002)(26005)(7416002)(55016003)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lrIHUGZugCEvt1nO2ePSte/fe6T1SGlU3RzyCmnVlZyHS+CSDmgm6wOvIDDd?= =?us-ascii?Q?QOa5Sv5fNl66/IxS1Sp2qx9hX8SA1OGBufJJaAn0bMJagThfU9XBwOpAquW7?= =?us-ascii?Q?UnwHf9cucFTt/Wf+N88vs2ZQx+QK38IWOnIeqHDQB8Xzzo7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MeAU1tlQy3KK2uwyY+GpWKhps1pZXS/HOEZ?= =?us-ascii?Q?wIfxpcbFTVgjFRTknHP47p2JhP29Vq5MRf6Pz2OqJrfnnqhoVzuSvbo/FqwZ?= =?us-ascii?Q?Pi1x6UoIfbeIPBdMHva8a8GMyNl1nYxtLwjlzSpTy1/BhPmuOpgvZU0U4AGa?= =?us-ascii?Q?rkIS0ngnkYG7n5IXL+CTKTXs8Lxh39nd1TNrFzmUr5dgn/FK1YiiwQ3PJqIF?= =?us-ascii?Q?5WFm1YL6QiYKDO/fXGn+rvToh1kh7NuIJaCRzznHUXFVYKvUxa1Z7Hc7YSbs?= =?us-ascii?Q?ahoBbxvvEZ1XhqBkWtSPxI4Oz5on/RSSGbDp54LuL2hPrOOMedGB/+AP9u+F?= =?us-ascii?Q?wfGNiXY3Drh7lkc4xgw15G8G+YcTdFe8ULeYLCn+PZsyK4AixmipL18I+LyM?= =?us-ascii?Q?7SEgn/floI1S/QjmMNn4fykwngdfNkrWMT51yNZbirJ5R8EvVVKheCl2Tg9L?= =?us-ascii?Q?Y1pn7SXBM0giMdVgm0acXQEankzy+oBqb/YSnOhXlQikWFLkW5d76H/kqlQe?= =?us-ascii?Q?MaEv2z01qaeCkRxV5Ei48YfdokxZr0Yvat2oN2fsZzCP3E39+LQZk8WLhOfj?= =?us-ascii?Q?YUrzkLs1/Mr139l009rCXNRRSpoyZCObl5LofWhwNY5b3cWyFppEq3NVJrvm?= =?us-ascii?Q?EKEaLGuJJ1MJFC1A+TYj7gusz7tQz+AjjEGlMPF/Tsvr5kHr9Gh7FyiOKZWu?= =?us-ascii?Q?q/kbBZ5QTw=3D=3D?= 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: MW2PR12MB4666.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fb4cf93-756f-4586-974e-08da3f14017c X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2022 12:33:58.2872 (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: +CNMQFxcsfaDNwCBpPJBQEZxXQMO41FwW69NTC9aBXeH3nrDJ8xfDXPVbDsovR46OGNqOcH2bPHTUB+F+QWA2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2865 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 Hi Alexander, > -----Original Message----- > From: Alexander Kozyrev > Sent: Sunday, May 22, 2022 1:51 PM > Subject: [PATCH v2 4/4] ethdev: add meter color mark flow action >=20 > Create a new Flow API action: METER_MARK. > It Meters an IP packet stream and marks its packets with colors. > Unlike the METER action, it performs no policing at all. > A user has the flexibility to create any policies with the help of > the METER_COLOR item later, only meter profile is required here. I think required should be mandatory. >=20 > Signed-off-by: Alexander Kozyrev > --- > doc/guides/prog_guide/rte_flow.rst | 25 +++++++++++++++++++++++ > doc/guides/rel_notes/release_22_07.rst | 1 + > lib/ethdev/rte_flow.h | 28 ++++++++++++++++++++++++++ > 3 files changed, 54 insertions(+) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_flow.rst > index 018def1033..90f0ebc9bc 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -3411,6 +3411,31 @@ This action is meant to use the same structure as = `Action: > PORT_REPRESENTOR`_. >=20 > See also `Item: REPRESENTED_PORT`_. >=20 > +Action: ``METER_MARK`` > +^^^^^^^^^^^^^^^^^^^^^^ > + > +Meters an IP packet stream and marks its packets with colors. > + > +Unlike the ``METER`` action, policing is optional and may be > +performed later with the help of the ``METER_COLOR`` item. > +The profile and/or policy objects have to be created > +using the rte_mtr_profile_add()/rte_mtr_policy_add() API. > +Pointers to these objects are used as action parameters > +and need to be retrieved using the rte_mtr_profile_get() API > +and rte_mtr_policy_get() API respectively. > + > +.. _table_rte_flow_action_meter_mark: > + > +.. table:: METER_MARK > + > + +------------------+----------------------+ > + | Field | Value | > + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > + | ``profile`` | Meter profile object | > + +------------------+----------------------+ > + | ``policy`` | Meter policy object | > + +------------------+----------------------+ > + > Negative types > ~~~~~~~~~~~~~~ >=20 > diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_note= s/release_22_07.rst > index 6d030bead5..fca7d07e4b 100644 > --- a/doc/guides/rel_notes/release_22_07.rst > +++ b/doc/guides/rel_notes/release_22_07.rst > @@ -74,6 +74,7 @@ New Features > * Added METER_COLOR item to match Color Marker set by a Meter. > * Added ability to set Color Marker via modify_field Flow API. > * Added Meter API to get a pointer to profile/policy by their ID. > + * Added METER_MARK action for Metering with lockless profile/policy ac= cess. >=20 > * **Updated Intel iavf driver.** >=20 > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index 9754f6630a..bb16108f16 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -2906,6 +2906,15 @@ enum rte_flow_action_type { > * @see struct rte_flow_action_ethdev > */ > RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, > + > + /** > + * Traffic metering and marking (MTR). > + * the entity represented by the given ethdev. > + * > + * @see struct rte_flow_action_meter_mark > + * See file rte_mtr.h for MTR profile object configuration. > + */ > + RTE_FLOW_ACTION_TYPE_METER_MARK, > }; >=20 > /** > @@ -3775,6 +3784,25 @@ struct rte_flow_action_modify_field { > uint32_t width; /**< Number of bits to use from a source field. */ > }; >=20 > +/** > + * RTE_FLOW_ACTION_TYPE_METER_MARK > + * > + * Traffic metering and marking (MTR). > + * > + * Meters an IP packet stream and marks its packets either > + * green, yellow, or red according to the specified profile. > + * The policy is optional and may be specified for defining > + * subsequent actions based on a color asigned by MTR. > + * Alternatively, the METER_COLOR item may be used for this. > + */ > +struct rte_flow_action_meter_mark { > + > + /**< Profile config retrieved with rte_mtr_profile_get(). */ > + struct rte_flow_meter_profile *profile; > + /**< Profile config retrieved with rte_mtr_policy_get(). */ I think you mean Profile --> policy. > + struct rte_flow_meter_policy *policy; > +}; > + > /* Mbuf dynamic field offset for metadata. */ > extern int32_t rte_flow_dynf_metadata_offs; >=20 > -- > 2.18.2 Best, Ori