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 947EEA034C; Sun, 22 May 2022 04:49:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3606640156; Sun, 22 May 2022 04:49:26 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2076.outbound.protection.outlook.com [40.107.93.76]) by mails.dpdk.org (Postfix) with ESMTP id C617E40040 for ; Sun, 22 May 2022 04:49:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GeHWYBRq57bqUTGbRSflq2u3/Q2liuhL/ZT48UTb7QRzMbTQUk5SJvsQ1D6gM0pNenKKekS1pR+PbUzRiG5qtwyjXj2dRX5AZjQ//zmE/N/7FIT36XUDv+aslb1LXJZzt+Bxhj6Q5iczGIuXnoWEkxh7bpqtkZhVIdDuM70S8hnO0f/5Mv9CL3KTPD6QXW7I3MGX/FeGcfnbl5KXYYuh407tvurQ+48+mOcdQ5+ruqx04J0BqV4jLICxiUEGnRgLm+mwb1GTiFT4rThmywtCBPfZGodvzDWtlPM8CDQC55SrQnoiK8Rj9C7HRsUu2gbNY0S+ChsBbPy+E06O+1GkEw== 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=KGJUs2dtPjow4zt3Gt+Onz6Smk0GzO9zC9s73Q31gSg=; b=OVMZoSEQm9QmNLxKF75X+Zn4A7hy78HVxVMU6HdKnOUttTOIAnrMLhXiCadL5nyRb+PzBfNm7wfTET0RBbZs5ZnXT78CLKkTvUp/74m2rE4yYAt76WGGTRBFCaUv8ZqHvdGqgenSDwru1qxx5eovxaOPZQ3CrfiU00fsFwdVs90zvMsQoYC8cceRUMeU7KdzCISRNFzEXpAQ5iyLp2wJp+KCTxyxhHlXEa6PD/4LzFjs2LsWoSXen/61ZzoqMBc1/W/jfl0+o7RtePVx0xn9SWCvG9ujjiovwwTNF9N1X/JN7XAisZPtXAsipV2y01CTAdULxzlaLDbxn4nOWcEQ6w== 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=KGJUs2dtPjow4zt3Gt+Onz6Smk0GzO9zC9s73Q31gSg=; b=IfOSj1azZrG6xA1hbEshLAbtULM/vVQYwJYtPj5zJEIxQZAcCHxGH19BZ8e2m7QC6B+SPWWQ02H8p8tGAcuGR3TviUj6xFtSpHyEHSS3YiPXBvra94P/6CS2sg9viBnNVGhpjN1lWA7dWSd6oBT6t6KQKbExRdn6sTGVURQdLv5yIz765wvVrZ6aRPg7XyLWjtwn3ID8QX5UPv2V1QVKOQpeb61re+InNq7GEt/+Xls24xHKohDhR0LYvckvD5tRpjHt+F8/Nzy7Kf0MoyKtUMaeYQBQ0jkhLhbmZ2zpzhwQ7qAXeRTI1CqI+F8CmiiQQLqjQwp9G9i2OouwNr2TVQ== Received: from DM5PR12MB2405.namprd12.prod.outlook.com (2603:10b6:4:b2::20) by SJ0PR12MB5469.namprd12.prod.outlook.com (2603:10b6:a03:37f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Sun, 22 May 2022 02:49:17 +0000 Received: from DM5PR12MB2405.namprd12.prod.outlook.com ([fe80::65cb:941f:347f:cc4f]) by DM5PR12MB2405.namprd12.prod.outlook.com ([fe80::65cb:941f:347f:cc4f%5]) with mapi id 15.20.5273.019; Sun, 22 May 2022 02:49:17 +0000 From: Alexander Kozyrev To: "Dumitrescu, Cristian" , Ori Kam , Jerin Jacob , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Andrew Rybchenko , "Vipin.Varghese@amd.com" , Ajit Khaparde , Ferruh Yigit CC: Ray Kinsella , Sunil Kumar Kori , Ivan Malov , "Awal, Mohammad Abdul" , "Zhang, Qi Z" , "Richardson, Bruce" , Konstantin Ananyev , "Singh, Jasvinder" , "dev@dpdk.org" Subject: RE: [RFC] ethdev: datapath-focused meter actions, continue Thread-Topic: [RFC] ethdev: datapath-focused meter actions, continue Thread-Index: AQHYaVDsRZG6pHheSAGvOP6NbrvKkQAADvXArSZwc/CAABOS8A== Date: Sun, 22 May 2022 02:49:16 +0000 Message-ID: References: In-Reply-To: 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: 9d7b0239-5096-43c3-7833-08da3b9da9b6 x-ms-traffictypediagnostic: SJ0PR12MB5469: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: kd3y2HJrp9pwAXHh0tyS2f3PtY7EqalwA9Gmj1xvLnBdX18hmz8rCG6bj22ZJMLkysqPwcjoMxhxGJciDgBe5NlZXEdulvJBkPw3aZ54nUmnZ203ER5KLBdOHbAypKlwLtZ3kFju/eFDzKTJwFUIQAbDWEbRGuvoo7KQ/fz8n19IfkI6iarZMyaAihlb90nlIm/LWA02uI9LWpfPNI9mC8pxJoNliycReX07WwWmo0uhwo4Q1lv0P3gD0qLayKbKLSqDBn7J5ruEDJOrsWMcnnXwr+ZbRwjdOos9VH4YO70ozdm6kHOyuuQ2ZzOkOnU7pwl9yAtJLF3Ar4TCHptdUoT+oKCOt4TzQFEyGUovyM/linFmiilxPfVwR6whlZF8qJF9eTXvLcV/x8yzf169hMUPPm4dfO1p9r3qOgu4qVsLSLBuBjvKCjgk47YPco4JAZUwAG0Tz85Ai48O2M3rvBE2TLSP7+XMEc4h1gXsdeBRTZ1WSXy/5TO8+g9rQOuXxUVMr6xFTkk867rS76KpwXBryCFMejQfmgnNyRI0jc4R3MkNUF5Hb3AdTDAWutR//UYJlesBZlztwIU0i9PcxIikSCP2rbuPa0ls40kJBacR8L4fmimkvQbsZFo0JxFciU7p5CYZtAbVob6Ag/sckNykHUpx9DZrnz8PprEs8lv6p+tCnIH2C6yOLnpM6dlJuqNqjTlfG7puoTj3T8gQZw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR12MB2405.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(64756008)(66476007)(66556008)(66446008)(66946007)(8676002)(83380400001)(76116006)(8936002)(186003)(4326008)(2906002)(33656002)(5660300002)(7416002)(52536014)(122000001)(71200400001)(9686003)(7696005)(54906003)(38070700005)(38100700002)(316002)(6506007)(110136005)(55016003)(508600001)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 2 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+HtW8XPzd0uo0rGEI4zh83m53Xyl+DQNJ6uHmApSpSBsqv57s+gtjC3O8w1F?= =?us-ascii?Q?DiJ9hlNbIsB+2puijm5OqhuId+0FRl7OKRE/a710Vz46a/+0SkneQsENFbX/?= =?us-ascii?Q?cO9CI+44SdLDPjdZErZyFLSzBo/sB/XHzdKxsMgIsHsJiQFd7rWcAnMZ3/T7?= =?us-ascii?Q?Ly1Vl47U6aBbEU6kvmyMd5UJWP2gA47m66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ascii?Q?rKNillOVIxFzFkKr8ktqKXEhUoJhnySNOZvzLMWUjJXdSmHhg1RK+LvRHrXL?= =?us-ascii?Q?mY6fJ6HpW/tgVqyopT1PZcBVnNorFmN7kU1GZJSGV1gtUe/DDFFrfdFCqTVO?= =?us-ascii?Q?YhtV+Ie2zA8wKYcr/SJAhMB/3WeBw41tWhMdBrZXRe0q8GUZKv+S5rSN4cRa?= =?us-ascii?Q?8YDVN/FzdbGckIAmtHO3LOmroZ6sB1fzGalzxwh0KjdeSDJNDly4wk+qYmzp?= =?us-ascii?Q?8VjeIVMn3WVhKqvxyAjQCjXNFU3bmFJFaVAgbTkGRaPLraLI+9/kBmjGswvx?= =?us-ascii?Q?VpifjW6J4NRSipNHID7qw3cDJ0uALn6/R8Kv/R1MSMKX1n+9bqWeXpY72LEP?= =?us-ascii?Q?OEMezoPIviL4FXKRmbJBzfsHh1sB13jMiMWHpHo+g8UOg5THgqNpEPPvGTSV?= =?us-ascii?Q?IGLEWbw6T9zhcHwPLLlQJcyRVRShDrfMffY1v8d6KCxeIqXG3zbIeFjZKFVY?= =?us-ascii?Q?wISAlG0i+TkQJ4hhiO7MSAaLvNXLvL6YkK2GKJIlWzjxgZm9M2/YL1CAXCkN?= =?us-ascii?Q?YAfJyXTSpyENALeXPTHb1pD2xUJpEaM19jITf5FPQ4SIL3rj78tgLSsma7JM?= =?us-ascii?Q?U3YD/fTiqTNx6R/BVjV3Oz1n+HSdYDqWiSFWQ1lg7xzuy8ln5L1AOu/T1cFV?= =?us-ascii?Q?ANvlxWse2aG6a8H22Md9uOzuaK5Z2ouhtKVxDGdlgQchzDdI2b0cea+JaV3W?= x-ms-exchange-antispam-messagedata-1: zl65WB841/H0kw== 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: DM5PR12MB2405.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d7b0239-5096-43c3-7833-08da3b9da9b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2022 02:49:16.9089 (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: v0DXDyc4ok7TIgQht94+Wlg6ylT20LythNrOfh2QrSBEHFd8G5EUec6vrVTezqnQG1ksNDet9VWfSYAm0mQkAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5469 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 On Thursday, May 19, 2022 13:35 Dumitrescu, Cristian : > Here are a few takeaways of mine, with a few actions for Alex and Ori: Thank you, Cristian, for compiling these takeaways. Great summary of the di= scussion. =20 > 6. Alexander Kozyrev to provide pseudo-code for the meter operation with > the new proposal: > (1) meter creation; > (2) meter sharing; > (3) meter reconfiguration: do we need to remove the flow/flows > using the meter and re-add them with a new meter object that has updated > configuration, or can we update the meter object itself (what API?); > (4) meter free. Traditional Meter Usage: profile_id =3D rte_mtr_meter_profile_add(RFC_params); policy_id =3D rte_mtr_meter_policy_add(actions[RED/YELLOW/GREEN]); meter_id =3D rte_mtr_create(profile_id, policy_id); rte_flow_create(pattern=3D5-tuple,actions=3DMETER(meter_id)); The METER action effectively translates to the following: 1. Metering a packet stream. 2. Marking packets with an appropriate color. 3. Jump to a policy group. 4. Match on a color. 5. Execute assigned policy actions for the color. New Meter Usage Model: profile_id =3D rte_mtr_meter_profile_add(RFC_params); *profile_obj_ptr =3D rte_mtr_meter_profile_get(profile_id); rte_flow_create(pattern=3D5-tuple, actions=3DMETER_MARK(profile_obj_ptr),JUMP); rte_flow_create(pattern=3DCOLOR, actions=3D...); The METER_MARK action effectively translates to the following: 1. Metering a packet stream. 2. Marking packets with an appropriate color. A user is able to match the color later with the COLOR item. In order to do this we add the JUMP action after the METER action. 3. Jump to a policy group. 4. Match on a color. 5. Execute actions for the color. Here we decoupled the meter profile usage from the meter policy usage for greater flexibility and got rid of any locks related to meter_id lookup= . Another example of the meter creation to mimic the old model entirely: profile_id =3D rte_mtr_meter_profile_add(RFC_params); *profile_obj_ptr =3D rte_mtr_meter_profile_get(profile_id); policy_id =3D rte_mtr_meter_policy_add(actions[RED/YELLOW/GREEN]); *policy_obj_ptr =3D rte_mtr_meter_policy_get(policy_id); rte_flow_create(pattern=3D5-tuple, actions=3D METER_MARK(profile_obj_ptr, policy_obj_ptr)); In this case, we define the policy actions right away. The main advantage is not having to lookup for profile_id/policy_id. To free the meter obects we need to do the following: rte_flow_destroy(flow_handle); rte_mtr_meter_policy_delete(policy_id); rte_mtr_meter_profile_delete(profile_id);. profile_obj_ptr and policy_obj_ptr are no longer valid after that. The meter profile configuration cannot be updated dynamically with the current set of patches, but can be supported later on. Now you have to destroy flows and profiles and recreate them. But rte_mtr_meter_profile_update()/rte_mtr_meter_policy_update() can have the corresponding siblings without mtr_id parameters. In this case, we can update the config and all the flows using them. The meter sharing is done via the indirect action Flow API: profile_id =3D rte_mtr_meter_profile_add(RFC_params); *profile_obj_ptr =3D rte_mtr_meter_profile_get(profile_id); handle =3D rte_flow_action_handle_create(action=3D METER_MARK(profile_obj_p= tr, NULL)); flow1 =3D rte_flow_create(pattern=3D5-tuple-1, actions=3DINDIRECT(handle)); flow2 =3D rte_flow_create(pattern=3D5-tuple-2, actions=3DINDIRECT(handle)); Once we are done with the flow rules we can free everything. rte_flow_destroy(flow1); rte_flow_destroy(flow2); rte_flow_action_handle_destroy(handle); rte_mtr_meter_profile_delete(profile_id);