From patchwork Wed Sep 21 02:11:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116508 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 375C5A034C; Wed, 21 Sep 2022 04:12:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 140CF42670; Wed, 21 Sep 2022 04:12:21 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id AC5CF410EE for ; Wed, 21 Sep 2022 04:12:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MiKJeCOLU3xCovdMLckVkZcFQxfsog+JHRq8VoFUygauAdGClAGWvYqbnFUv2C/JhrUmpPhYuMq/u40FpaEvkUtAyuPVCCrbRAtVC+RiTBh8d97HHL72K3qsXfAR4cmXxiBEThmql5LW0RSPDdIHA892AkgBYJKTokJOjrqsvN0sz/wAeEDL/DV8FkTNnUjBVXUEJz4Ft229D9b/NQz6XrpJLVSUQWVafQ8RtqdtOLwsHWhkeZde3kaOHaVNTf0fcLw6zwnKdAGHnvbTJrNYjOlIpOl8X6HO0pOU6xrjdNdP7cwFJx9hy2E29J48HwNpcjHScMKl/Ix4MmHh16HHrg== 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=WJ9lsf8wuEGBLqPfAGVm2bmf8zEmK8HjPRmnBsJqUtY=; b=WnT5FulGgYEBK9fZUldyZoEZuJAN/99VUT0xsdjTC5B/xTDBSdlTDdkrUIV09MATVzJlYpeJIFz68msDQhSjtblQDlZjLjjIZ7WzLkH8rz7L0F55nV4nD/BbAnEMJnOEdvKB/Ge6LEZaQLSD9wlnGwWIrFLeCQWhbjvSfI/xKzlylvZvlE/Zaaz5nDWFqV0eK3MPlCAl7m3XUghbAvz2Yio/Ck/4FDxLq2BoD8hkMmTUt0einL855L2L3oCMSaJ5HWXS2QM92YjcFSm+ULZqApWtSsLHUSOlllS6KvJgjARvPr4h2Tg3tocFgNWMfpxs6JXl5D0JcJSCcVewPz/gug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=WJ9lsf8wuEGBLqPfAGVm2bmf8zEmK8HjPRmnBsJqUtY=; b=C3GtfmE+bFbKjdJruKbScK9i39CExauEnNNZ2qnm6c6vM/dZhe7H/1HD8YY5YP/c3XHE4Gp4z79UdwBn39inSiAU2iUwGvCN5aJIGnjRHJGzFCfgJhiQzRKF6mqpq03b8zXKCVJhel+YniF4mOfyxs/JNX7UU9J2csWe2BjZaohQI1VPLGnJmRy1LiiHUEJV9hPlAiSvwc4gh2qboBlv2xpZUwC7t5g3KUTHBriRKMz5hht7W8ZePuDmSXB+dsIUaw/fJdFEK/l760UnxSXllARc9NIM5CbSBIZv0DCOB9wh57nP3X0x5Z+/03jBRdLMOpJ4dF/BG8YQqiV0YUxjxQ== Received: from MWH0EPF00056D04.namprd21.prod.outlook.com (2603:10b6:30f:fff2:0:1:0:c) by DM4PR12MB5343.namprd12.prod.outlook.com (2603:10b6:5:389::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Wed, 21 Sep 2022 02:12:17 +0000 Received: from CO1NAM11FT089.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::205) by MWH0EPF00056D04.outlook.office365.com (2603:1036:d20::b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.4 via Frontend Transport; Wed, 21 Sep 2022 02:12:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT089.mail.protection.outlook.com (10.13.175.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:06 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:02 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 1/7] ethdev: add meter color flow matching item Date: Wed, 21 Sep 2022 05:11:27 +0300 Message-ID: <20220921021133.2982954-2-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT089:EE_|DM4PR12MB5343:EE_ X-MS-Office365-Filtering-Correlation-Id: b6c1fef9-511f-4c48-0005-08da9b76b507 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gkUpSF4b+Hn3gZWjNcwkMQ7/BOwslNFrbr3eyqbe0r1PI921KFREzZFNC//2N9Pr07PnZb1om7FGqduR08Ui8zDSTH/R30sVpx6Z5ToN5lJipuxu6xHw0JOwUKQyV7q7SXEJP69Dy90jrgog5JI4sGQR6kpPIq4gn/fVXBMOQExNY+Rl9nV8HjjgqCBoIZ/GvUkUQPTScqehjjqE+FXCsoLG6dTxGqHnBLj5tODeymzd/4UwdzRikq1Np5tE8wyg/+JberwJ/mmObUxlnWuos9XocNQ4kEoHfdZu2vQO3JX323dtgZlw9OO9OANlX5I0iCj07/gCRFecYpLV2xZD+hCj59kvbagw3QumFzBh3i+pOSuD/G0SdI1yHpMxZZrBUbPijMRUfflVK+rjNg5aENHpiyJ/1kzDhf1p/kNAQ9w26npADMRgKPBsPTrlaDFu51mxDz9zJwmbqpuwDXgzS+HDzC0pkRCsF2Vwm0/IZs1lyAy+8ai4R9ppt5FpGnxX7MlJ7tFT9Ehn1D12edYnMfqJPeDhh3cmonzrIoxAdqsFtiICNIQx1r7O68R2KrOWpRR7IDCkrCKb+kWBkevoRr6PvEtTj88Perq02OP/UGPuE5SfIiAa9Ycjk3/Dw/wmZC6CNv5osneONVF/Za+rwaLLwWKgRAy7fFviVKVoRdLxf2dQZ1UwZyfVVl1EFhBhUuE5AzMRTdacAxBu1jdHGFhsXakglqyj65c2fCer0IjWJWQu/qcAGllGG/ddd7jbDiafFJdaD22licxDCyLpCA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199015)(46966006)(36840700001)(40470700004)(8676002)(7416002)(40460700003)(82310400005)(47076005)(82740400003)(4326008)(70586007)(5660300002)(8936002)(70206006)(7636003)(356005)(2906002)(86362001)(6916009)(54906003)(426003)(336012)(36860700001)(6666004)(41300700001)(16526019)(40480700001)(2616005)(186003)(1076003)(316002)(26005)(36756003)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:17.0365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6c1fef9-511f-4c48-0005-08da9b76b507 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT089.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5343 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 Provide an ability to use a Color Marker set by a Meter as a matching item in Flow API. The Color Marker reflects the metering result by setting the metadata for a packet to a particular codepoint: green, yellow or red. Signed-off-by: Alexander Kozyrev --- doc/guides/prog_guide/rte_flow.rst | 7 +++++++ doc/guides/rel_notes/release_22_11.rst | 3 +++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 24 ++++++++++++++++++++++++ 4 files changed, 35 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 588914b231..018def1033 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1651,6 +1651,13 @@ Matches a PPP header. - ``proto_id``: PPP protocol identifier. - Default ``mask`` matches addr, ctrl, proto_id. +Item: ``METER_COLOR`` +^^^^^^^^^^^^^^^^^^^^^ + +Matches Color Marker set by a Meter. + +- ``color``: Metering color marker. + Actions ~~~~~~~ diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 8c021cf050..f6c02bb5e7 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Extended Metering and Marking support in the Flow API.** + + * Added METER_COLOR item to match Color Marker set by a Meter. Removed Items ------------- diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 501be9d602..99247b599d 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -159,6 +159,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { rte_flow_item_flex_conv), MK_FLOW_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)), MK_FLOW_ITEM(PPP, sizeof(struct rte_flow_item_ppp)), + MK_FLOW_ITEM(METER_COLOR, sizeof(struct rte_flow_item_meter_color)), }; /** Generate flow_action[] entry. */ diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index a79f1e7ef0..d49f5fd1b7 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -668,6 +668,14 @@ enum rte_flow_item_type { * See struct rte_flow_item_gre_opt. */ RTE_FLOW_ITEM_TYPE_GRE_OPTION, + + /** + * Matches Meter Color Marker. + * + * See struct rte_flow_item_meter_color. + */ + + RTE_FLOW_ITEM_TYPE_METER_COLOR, }; /** @@ -2198,6 +2206,22 @@ struct rte_flow_item_flex_conf { uint32_t nb_outputs; }; +/** + * RTE_FLOW_ITEM_TYPE_METER_COLOR. + * + * Matches Color Marker set by a Meter. + */ +struct rte_flow_item_meter_color { + enum rte_color color; /**< Meter color marker. */ +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_METER_COLOR. */ +#ifndef __cplusplus +static const struct rte_flow_item_meter_color rte_flow_item_meter_color_mask = { + .color = RTE_COLORS, +}; +#endif + /** * Action types. * From patchwork Wed Sep 21 02:11:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116509 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E187BA034C; Wed, 21 Sep 2022 04:12:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3750342825; Wed, 21 Sep 2022 04:12:26 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2053.outbound.protection.outlook.com [40.107.93.53]) by mails.dpdk.org (Postfix) with ESMTP id 9890D40697 for ; Wed, 21 Sep 2022 04:12:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RbgB09CXmuDqQSGobhw18YBFaOX3dZtIKGikC3q6yiCsGRbxENZcYDb2MeXwGnVm9K7BXOcnBUnxMNUMON96x2Abx0zIOVB8GBvIsg2oyLDLwcMNmcTw73eUpWzHcahFeCa8uO4t1MRh1OzVB8nmb9wCBta6Yd5+4io/xril6ZqcwhzjlJC1OjnNRJ5PtUpSRcjRegrigkNJzPsmXFTPkjO8RDwSn9qdnjGEdCSzqi+RhTLdc0V5AXsqQnWQAHkO1ZPq/SEyEc5zUas3InOkop5zZjsBsJtvm4rbYTRESC0/juQwEKff4l6WUjySbIo8RjhJqOGmmbCg601eBNdzHg== 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=1rRfB+5TI4xZCsmO0S3kIkih62jghnv33WWqQWx1XPw=; b=GwmYTPjQvpum/k7VjRPTftTe7B3txwlfQuFo16r+QXlQ1EzTGZdn7UzfefM1RVNDQEQXxcAwukrTOdFJfWitfxWvTaYChV2EEIm/1fLbCwNsVnTBl98mDJKTLn2t3qIHqDQbdkfR827mOUztZ4ubkVmYrfBLaQAS+gBnAnodaBuyEz67y8lRmGkbno1nlaYs81wVu3puLmVMCnvBAtXw7hZdJHbshXRLK418vurBUW4jLcVEo5iJV0MN0fK1c1VeUthbdsbKJNFeSvYQlOEpYXw3viRQ8FoO4pXRbx2hI/wZ6CY1fMXv9+s635fMURDodZC3rFn522dR3Bx3xhgxAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=1rRfB+5TI4xZCsmO0S3kIkih62jghnv33WWqQWx1XPw=; b=bmy7zeGJ7eNNZYj7bSAG9hicgRsCDT3OkOeLPSYkfhUl/2aaokKpT+o1rzoD48X03GuYTBh2eVBSCQWfworAynIywGfh9SitPYiAOuzHeywRlIRc/k7xrsf30KdPSWr1LVyyC1UQf+iqeU/vsYVHmljEOLliOosliNBamlB8jY2Ecrz15i1YCop4o0sqUgMDM3CF28PsDC9dxPmVrXlIWV3fsbTGOZ5nvDS5sgEODkr54mpNcWURpY5pf3ESOv4SexZfkszI+N8D4TXFn/oX2MGenitoltczVpmojPwbf1jl8sRe7a3RgE1UbBHQ8aG0452e24zUUZt0QZURmunRqA== Received: from MW4PR04CA0205.namprd04.prod.outlook.com (2603:10b6:303:86::30) by MN0PR12MB6344.namprd12.prod.outlook.com (2603:10b6:208:3d3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.15; Wed, 21 Sep 2022 02:12:23 +0000 Received: from CO1NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::a2) by MW4PR04CA0205.outlook.office365.com (2603:10b6:303:86::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Wed, 21 Sep 2022 02:12:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT005.mail.protection.outlook.com (10.13.174.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Wed, 21 Sep 2022 02:12:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:10 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:06 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 2/7] ethdev: allow meter color marker modification Date: Wed, 21 Sep 2022 05:11:28 +0300 Message-ID: <20220921021133.2982954-3-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT005:EE_|MN0PR12MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c6917ea-3840-42b1-8bc3-08da9b76b8d4 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FartgyWaJMTfOhWk56crxBdWODTWxNMKgV1xY2/hhrdIih8vmGGjgpty2jAAYDFvrQliH8noUBwLzrhzatfHxM03/TIY52NtuUxkYkdz7P8Ch89wYZk8ac6j0UBlYDCuL4O5XUbifL0GyhPSaoAfjhC95c8NPtDYSXdNNJgl76wz7lzXex4MYiWxO41nJj9yPZMJAOSCqgaHS5z/QwVqXnZ03Vl+ynuId4tZoSqcWvd/pFppqtJqoqVD8cA0S0RDxxV8eWRxGX/PYJcCjxzd06gjX8VweXrKeiLsxjc0baHp8IZV1uInjM2x0ecP88MCuBLdR3YEGysWnh8vSN1mFFn2Tib8SGxx2yaFjtae2e+vyJdJYF5onz1ent2kcXqlOllzrZarSVRHKwegSz2hTwB+6FUkjiuM0iOgkzjBk3aEIgjvT90WPPzFwcUkZgQCzvhVseJLu79BGGArlVDV2AUiaNPK8PHyNyA+0aB2NJA01kwZ5moYv/v/wJTMtbAkPbP4LXyOOAeoEydeomGRic8h7fS8PT0Fm0PM2nKwYpOqeKrjjA9hLW8kDqBAXSdSo3MZ7t9ZbM/SVoLRqIjl3M6rCieYnoT/MqbsUKpSVajY35jC/82zkr8wObD+VFtIFpnny0MC9kVb+1akvVTLM1UqY49dIE/ukLkNFtlrrHSVlK5v/ZXf9kgFzXi9Iq8HwgEzjPco+kjorqLGgA4E243yQyG2VNwqWqnYQFqLD5AeuhH8rIKDt/XJcf60e3deVIX9EiN+gICuuf1U0zL7DA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199015)(40470700004)(36840700001)(46966006)(54906003)(8676002)(26005)(8936002)(6666004)(316002)(6916009)(478600001)(4326008)(70206006)(70586007)(5660300002)(7416002)(2906002)(41300700001)(40460700003)(40480700001)(426003)(82310400005)(36756003)(356005)(2616005)(82740400003)(86362001)(7636003)(36860700001)(47076005)(16526019)(186003)(1076003)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:23.4011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c6917ea-3840-42b1-8bc3-08da9b76b8d4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6344 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 Extend modify_field Flow API with support of Meter Color Marker modifications. It allows setting the packet's metadata to any color marker: green, yellow or red. A user is able to specify an initial packet color for Meter API or create simple Metering and Marking flow rules based on his own coloring algorithm. Signed-off-by: Alexander Kozyrev --- doc/guides/rel_notes/release_22_11.rst | 1 + lib/ethdev/rte_flow.h | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index f6c02bb5e7..a7651f69ba 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -58,6 +58,7 @@ New Features * **Extended Metering and Marking support in the Flow API.** * Added METER_COLOR item to match Color Marker set by a Meter. + * Added ability to set Color Marker via modify_field Flow API. Removed Items ------------- diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index d49f5fd1b7..fddd47e7b5 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3713,6 +3713,7 @@ enum rte_flow_field_id { RTE_FLOW_FIELD_VALUE, /**< Immediate value. */ RTE_FLOW_FIELD_IPV4_ECN, /**< IPv4 ECN. */ RTE_FLOW_FIELD_IPV6_ECN, /**< IPv6 ECN. */ + RTE_FLOW_FIELD_METER_COLOR, /**< Meter color marker. */ }; /** From patchwork Wed Sep 21 02:11:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116510 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1212A034C; Wed, 21 Sep 2022 04:12:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 286CE42B6D; Wed, 21 Sep 2022 04:12:32 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2087.outbound.protection.outlook.com [40.107.220.87]) by mails.dpdk.org (Postfix) with ESMTP id 3E0F84282B for ; Wed, 21 Sep 2022 04:12:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=moT3OePHKdHh80sGdjQlJ4wXS6AE6IaZCXdihmICJQKvb6iXkXPmDR77uT8ZJIz+ML3dFlNqwUTDDElFTGQpXHLlqzIb7oPrsWwvq8dWEE6T16TKrMEEyrOf11af5uoUF688qRqiBKLgUY7Kj2aZj54f+EZ0J7zb4jAS11JtD2RqHF1+//9hytcTnfAqcZJfJ0okPsmWGcJeLvmoF1dsGQVxun4FZdIi8jhJb+rGgB8KIBMNEuHA5qhVwyOJ816eEicsDGJHC1sNLOrQHYA0fJoPEw2+nHBywEQ+WdL468waIFoBDjWu9W11ejjhEpIntd4h+0Nk9g8jhVAZRJPssQ== 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=J+ZiXps35pH8hMqsd/vk7UgYFCbd6Pc6MV3EV+uolnI=; b=eJGsSedLJ4w769Ibfetgnu08aIcmzH1GEcsK1yWSU3+tyysyyg0aTQKQdZswN2kz2LsCRNtS0/O8sK7SG+uk4SwBvwOZAHsX1P4NHnjlmW3u5fkdNQbxXG0UXDqyxwL5REZ5LEco2QqIrlB353CNgQNEwT49J+xAjMLwbpUDJGtTbvTextePiea+Lkhf3TEJ0bY4kWa7KfE3L8liG9QuOHBPo+VS/VRKSWZuMjsefoQwypMVpNEK/LLkwHvpEMPTSneaK+FAXhb8tVe9F4SB/VGXxIOQJu1nW+3FyHwZ49znIYGFnb0VTz/zhxeuhRFQv+hK3sa+aZPuM+K1MarHOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=J+ZiXps35pH8hMqsd/vk7UgYFCbd6Pc6MV3EV+uolnI=; b=IcydCViHn6oWtYoaFJfKnf/G+mm0sFMwSPll+09Vz2R8KpMF4NMS6pDxXnt6zyuru19Q4AZKfVwzyH91xSMvB3lJxDQYTPNMSug3KtIbqn5NVHJvNB3+slfUJlI/BJ8rgI2H7ixsOBtsX0IqkyQXzdTCzYTgPWSEfZzop4bvtQqOwNKoTkapyUeC5M7rTZqp+G4d7bylj+pp0l/ZmiDRkxwb7dxRDa6gFjCE9cdn1HveNja3B+9ZbMC4uy54WioMVTODLLUnreaLC3SZsTDeZw1HDeBfOtjKk1fw0bvkCgNfVPMO7wGPKphHKN4iGBRc4BLnvZkpRnpvrv/G3dT52w== Received: from MW2PR16CA0063.namprd16.prod.outlook.com (2603:10b6:907:1::40) by LV2PR12MB5775.namprd12.prod.outlook.com (2603:10b6:408:179::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.18; Wed, 21 Sep 2022 02:12:27 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1:cafe::ec) by MW2PR16CA0063.outlook.office365.com (2603:10b6:907:1::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16 via Frontend Transport; Wed, 21 Sep 2022 02:12:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:26 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:13 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:10 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 3/7] ethdev: get meter profile/policy objects Date: Wed, 21 Sep 2022 05:11:29 +0300 Message-ID: <20220921021133.2982954-4-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT042:EE_|LV2PR12MB5775:EE_ X-MS-Office365-Filtering-Correlation-Id: ff6e6eca-cd70-41a8-4b05-08da9b76badf X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HhyxR/dUYt7+zS2ZAVJ+mm8jWk71ImMj76HOuhIljLAgKKQVAOUhsqbBO/xRSQ+OaUImTZ9t+3qG3yQS+aipcBusE3+4bJiv2uHEQxhqYLc4+f74yhBQtcUCr8nWZb29cHk3YlfwOumEg/ZtWpqD10Gg557EYlEGqtvzpbbC963rZ/JWXo25AWYylffkcZqmsAdGn5gxTVOAiKY8zAmgmXKjUzgMnnM0iYfTXJAPY2BsDVo9GNndMWQ1nxFEZy5viUSdj+nFD/xQhDi3PNjVu4F/RnhedOUf6tdU9DxNWIAtDZJpFoeeU+AIwsv0h4gNAXy1htb9HKGVEa46MMNkTqWbn3pBy1M0UCttjau18RQ7X7qB5RpCNSmtewr+iEDRCr13LyBB45TNhTde00aQTKvGYM2dpQfrdAlejlownGzZCod+LOVKpj+xzWTrofRlhXeonm4KwD2aN0nHOxmYzM1BMU2ou90GG3/lohTDOpkXd1UMQxNhhnpPrfxrxt5OVUfHzno7s84+hMCM6KJEqSSuPKHtzA0TwbzP49u3oQLCgKY36/sDt1L8Y70ZToB92EjWpUELsLjrpXo5FfkOuggIVJxzNt9QKrpPPqlGraQ33GhJUrBpmZgMOMB7/X0jB1MLLyG3qfrc6ky3kUkB1UOqjvGpwiu1CQelNvaaVipKQeo7E1e9NUnraSKdB4/Mc7irO1/vWQ6B/M3TfiljFXIhmQIF5Px3sZSIw9tWoutwpMbRVtV7pSYOpFjS/fAm5ETZKnlQMeXITdcb+YNFP0wW53DEJigiwXPmTk6lQbA8Tu98HJfqIIkST/LqIXz7 X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(376002)(396003)(346002)(136003)(451199015)(40470700004)(36840700001)(46966006)(7636003)(40480700001)(86362001)(16526019)(26005)(478600001)(8936002)(2616005)(82740400003)(6666004)(40460700003)(186003)(41300700001)(1076003)(356005)(336012)(36756003)(83380400001)(36860700001)(47076005)(426003)(82310400005)(70206006)(2906002)(5660300002)(8676002)(316002)(70586007)(54906003)(6916009)(7416002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:26.8426 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff6e6eca-cd70-41a8-4b05-08da9b76badf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5775 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 Introduce a new Meter API to retrieve a Meter profile and policy objects using the profile/policy ID previously created with meter_profile_add() and meter_policy_create() functions. That allows to save the pointer and avoid any lookups in the corresponding lists for quick access during a flow rule creation. Also, it eliminates the need for CIR, CBS and EBS calculations and conversion to a PMD-specific format when the profile is used. Pointers are destroyed and cannot be used after the corresponding meter_profile_delete() or meter_policy_delete() are called. Signed-off-by: Alexander Kozyrev --- .../traffic_metering_and_policing.rst | 7 ++++ doc/guides/rel_notes/release_22_11.rst | 1 + lib/ethdev/rte_flow.h | 7 ++++ lib/ethdev/rte_mtr.c | 41 +++++++++++++++++++ lib/ethdev/rte_mtr.h | 40 ++++++++++++++++++ lib/ethdev/rte_mtr_driver.h | 19 +++++++++ lib/ethdev/version.map | 4 ++ 7 files changed, 119 insertions(+) diff --git a/doc/guides/prog_guide/traffic_metering_and_policing.rst b/doc/guides/prog_guide/traffic_metering_and_policing.rst index d1958a023d..2ce3236ad8 100644 --- a/doc/guides/prog_guide/traffic_metering_and_policing.rst +++ b/doc/guides/prog_guide/traffic_metering_and_policing.rst @@ -107,6 +107,13 @@ traffic meter and policing library. to the list of meter actions (``struct rte_mtr_meter_policy_params::actions``) specified per color as show in :numref:`figure_rte_mtr_chaining`. +#. The ``rte_mtr_meter_profile_get()`` and ``rte_mtr_meter_policy_get()`` + API functions are available for getting the object pointers directly. + These pointers allow quick access to profile/policy objects and are + required by the ``RTE_FLOW_ACTION_TYPE_METER_MARK`` action. + This action may omit the policy definition to providei flexibility + to match a color later with the ``RTE_FLOW_ITEM_TYPE_METER_COLOR`` item. + Protocol based input color selection ------------------------------------ diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index a7651f69ba..7969609788 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -59,6 +59,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. Removed Items ------------- diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index fddd47e7b5..edf69fc44f 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3826,6 +3826,13 @@ struct rte_flow_action { */ struct rte_flow; +/** + * Opaque type for Meter profile object returned by MTR API. + * + * This handle can be used to create Meter actions instead of profile ID. + */ +struct rte_flow_meter_profile; + /** * @warning * @b EXPERIMENTAL: this structure may change without prior notice diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index c460e4f4e0..9e79b744da 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -56,6 +56,25 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error) ops->func; \ }) +#define RTE_MTR_HNDL_FUNC(port_id, func) \ +({ \ + const struct rte_mtr_ops *ops = \ + rte_mtr_ops_get(port_id, error); \ + if (ops == NULL) \ + return NULL; \ + \ + if (ops->func == NULL) { \ + rte_mtr_error_set(error, \ + ENOSYS, \ + RTE_MTR_ERROR_TYPE_UNSPECIFIED, \ + NULL, \ + rte_strerror(ENOSYS)); \ + return NULL; \ + } \ + \ + ops->func; \ +}) + /* MTR capabilities get */ int rte_mtr_capabilities_get(uint16_t port_id, @@ -90,6 +109,17 @@ rte_mtr_meter_profile_delete(uint16_t port_id, meter_profile_id, error); } +/** MTR meter profile get */ +struct rte_flow_meter_profile * +rte_mtr_meter_profile_get(uint16_t port_id, + uint32_t meter_profile_id, + struct rte_mtr_error *error) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + return RTE_MTR_HNDL_FUNC(port_id, meter_profile_get)(dev, + meter_profile_id, error); +} + /* MTR meter policy validate */ int rte_mtr_meter_policy_validate(uint16_t port_id, @@ -124,6 +154,17 @@ rte_mtr_meter_policy_delete(uint16_t port_id, policy_id, error); } +/** MTR meter policy get */ +struct rte_flow_meter_policy * +rte_mtr_meter_policy_get(uint16_t port_id, + uint32_t policy_id, + struct rte_mtr_error *error) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + return RTE_MTR_HNDL_FUNC(port_id, meter_policy_get)(dev, + policy_id, error); +} + /** MTR object create */ int rte_mtr_create(uint16_t port_id, diff --git a/lib/ethdev/rte_mtr.h b/lib/ethdev/rte_mtr.h index 008bc84f0d..58f0d26215 100644 --- a/lib/ethdev/rte_mtr.h +++ b/lib/ethdev/rte_mtr.h @@ -623,6 +623,26 @@ rte_mtr_meter_profile_delete(uint16_t port_id, uint32_t meter_profile_id, struct rte_mtr_error *error); +/** + * Meter profile object get + * + * Get meter profile object for a given meter profile ID. + * + * @param[in] port_id + * The port identifier of the Ethernet device. + * @param[in] meter_profile_id + * Meter profile ID. Needs to be the valid. + * @param[out] error + * Error details. Filled in only on error, when not NULL. + * @return + * A valid handle in case of success, NULL otherwise. + */ +__rte_experimental +struct rte_flow_meter_profile * +rte_mtr_meter_profile_get(uint16_t port_id, + uint32_t meter_profile_id, + struct rte_mtr_error *error); + /** * Check whether a meter policy can be created on a given port. * @@ -679,6 +699,26 @@ rte_mtr_meter_policy_add(uint16_t port_id, struct rte_mtr_meter_policy_params *policy, struct rte_mtr_error *error); +/** + * Meter policy object get + * + * Get meter policy object for a given meter policy ID. + * + * @param[in] port_id + * The port identifier of the Ethernet device. + * @param[in] policy_id + * Meter policy ID. Needs to be the valid. + * @param[out] error + * Error details. Filled in only on error, when not NULL. + * @return + * A valid handle in case of success, NULL otherwise. + */ +__rte_experimental +struct rte_flow_meter_policy * +rte_mtr_meter_policy_get(uint16_t port_id, + uint32_t policy_id, + struct rte_mtr_error *error); + /** * Define meter policy action list: * GREEN - GREEN, YELLOW - YELLOW, RED - RED diff --git a/lib/ethdev/rte_mtr_driver.h b/lib/ethdev/rte_mtr_driver.h index f7dca9a54c..948a629b93 100644 --- a/lib/ethdev/rte_mtr_driver.h +++ b/lib/ethdev/rte_mtr_driver.h @@ -41,6 +41,12 @@ typedef int (*rte_mtr_meter_profile_delete_t)(struct rte_eth_dev *dev, uint32_t meter_profile_id, struct rte_mtr_error *error); +/** @internal MTR meter profile get. */ +typedef struct rte_flow_meter_profile * +(*rte_mtr_meter_profile_get_t)(struct rte_eth_dev *dev, + uint32_t meter_profile_id, + struct rte_mtr_error *error); + /** @internal MTR meter policy validate. */ typedef int (*rte_mtr_meter_policy_validate_t)(struct rte_eth_dev *dev, struct rte_mtr_meter_policy_params *policy, @@ -57,6 +63,13 @@ typedef int (*rte_mtr_meter_policy_delete_t)(struct rte_eth_dev *dev, uint32_t policy_id, struct rte_mtr_error *error); +/** @internal MTR meter policy get. */ +typedef struct rte_flow_meter_policy * +(*rte_mtr_meter_policy_get_t)(struct rte_eth_dev *dev, + uint32_t policy_id, + struct rte_mtr_error *error); + + /** @internal MTR object create. */ typedef int (*rte_mtr_create_t)(struct rte_eth_dev *dev, uint32_t mtr_id, @@ -194,6 +207,12 @@ struct rte_mtr_ops { /** MTR object meter policy update */ rte_mtr_meter_policy_update_t meter_policy_update; + + /** MTR meter profile get */ + rte_mtr_meter_profile_get_t meter_profile_get; + + /** MTR meter policy get */ + rte_mtr_meter_policy_get_t meter_policy_get; }; /** diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 03f52fee91..1fec250c85 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -285,6 +285,10 @@ EXPERIMENTAL { rte_mtr_color_in_protocol_priority_get; rte_mtr_color_in_protocol_set; rte_mtr_meter_vlan_table_update; + + # added in 22.11 + rte_mtr_meter_profile_get; + rte_mtr_meter_policy_get; }; INTERNAL { From patchwork Wed Sep 21 02:11:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116511 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35B8DA034C; Wed, 21 Sep 2022 04:12:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20D2D42B73; Wed, 21 Sep 2022 04:12:36 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2041.outbound.protection.outlook.com [40.107.244.41]) by mails.dpdk.org (Postfix) with ESMTP id B59F74282B for ; Wed, 21 Sep 2022 04:12:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EF9Qw3gXurS9O/hpqWTbhfaaKY2sEpacrOhyfig1/jt+SaHCnc9gFXI05Z1hpV5j5cu67hi18aINUAIt1wyBqB1KKsd/Hd9fdDxYmFLzHIPaeYT9+D4+hGxG9pM8Tgdok+Au95xM1vjSc0t+0O4U2LG/NmrgR6OCWrXyMj2VJxMto8lDepuEFaYKMTeaFyAUJWgtPURnZkBQX2Tc9tceMWo3w0AVVSmCNot0wDXD/EezPd4363Irk2HFg797X9vDgUmMS7u+73/0g1oPDz+uwn7F5KGlTBP/e3tJPxsZel/SFOHDHhCYOuARzKvHJERewInrDdMvikTqjnb+KDNEGg== 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=3CMiC0LqO6QiblJ7orKtG3xxOEJls2efsSpOcqFTauE=; b=CciOtcXZQ4otuD/o5iY+yRSgYYhSJexh53CgaKgyNL8ioA4ssW36YkVgXLLb6PpIumZs7ho8JFk0sf2YYUNKT4zw16NqK1yES0Wc6AflTl99+MoaPAzaWRvByXLCT6jR1DI7bJMlcxjQW6PHRp8Hcw96hhhqi5tXtcFgoecDU888WO26ZdYBFPIbd+pnK2Np6BHSBvbYbiX5rVio1nZafbtdu1mVF0EQu/+7FmixBjoV5MoboS+f8R+DCqbmgEV4Oough+2P1AUeXHFXkHNh7Iu8+qZFFgkbIV0JaQ7eYmhumk7SLEm7MhxV7Oa/KOMbJd1tf3HSAbDiIRkDd/ihUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=3CMiC0LqO6QiblJ7orKtG3xxOEJls2efsSpOcqFTauE=; b=bXFlPckwx1WL+XjoLN7GdwzrAKTbkE9GL57/RfnY87tEMUoiZbZygZQsj+vDz1TXyymhidXGe91LIOOyOQ6+EJvQOHwhiArGRLrbKrVPS8gq50afNd/wM3DaK3TIB2cxqw3I+Ae3ztWO9xqX+wgunQLSNdSXoz9ROneE/+fsDbM6MkZZkj52TUPlZu3WhoeQzpGcys+K3SObzDf21y2pkqy6xSauwL0sRsHfILnGC5ztO/ugg2CYtaVALCRhl7uNrqOGtsJY6RXpLDs9YG7cy13KjZf1TxUgDJ41o4HRB1tQ0lqyV6lh0N7+YUBv0SYk7cIWs5Gb3Xhhpy8+qYed6Q== Received: from MWH0EPF00056D0F.namprd21.prod.outlook.com (2603:10b6:30f:fff2:0:1:0:11) by PH7PR12MB6786.namprd12.prod.outlook.com (2603:10b6:510:1ac::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Wed, 21 Sep 2022 02:12:32 +0000 Received: from CO1NAM11FT105.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eab::209) by MWH0EPF00056D0F.outlook.office365.com (2603:1036:d20::b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.4 via Frontend Transport; Wed, 21 Sep 2022 02:12:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT105.mail.protection.outlook.com (10.13.175.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:17 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:13 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 4/7] ethdev: add meter color mark flow action Date: Wed, 21 Sep 2022 05:11:30 +0300 Message-ID: <20220921021133.2982954-5-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT105:EE_|PH7PR12MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: 76526430-b0bc-44ea-225b-08da9b76be38 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TSMcv+3Nttecq2FLl5WKDD1dVy/d2pHklDkVYBLVC7yyTKCrzuDpODX9bmraF3aO+uSEeGXa1lbmVzBHouAibRBktj3A1tKpKag4R/0SjxouJyUsdQDXIhKntOdaDn9RI6nE/f3mQlbqFcEDoTYEoNqUivj2lmsQoO50XmjkR8rM6MF9BOcDSppfgDCsAU1Uo8FWGgAEztFTYqIzNbam4q2DzYlRwfO33kcf60Tp/3KrcgarQ6F1sn3l1orYQ5Bp0C7wt+UzifbZCxoq5HLQuO9B8SZDcBVb+Mmz/OwmQUvUSkAska9Fysjxd1cskMVMHPYVPGnvCFSXR44pkSz4jnY9bnvUOhiHkdsUseBK3KcPjGL066mrtUIhIwWXlOO3sDW773BL049tFZKZ6qeh1NiEXBDttHbjYuxOqdW401sLCQxJRPZU1aQFrN/iTjN2lvWQWUyhyAZn1pcoW9xMfr4xwgTWmBHuvixA4A6fuCdtLbs0Wu20xXB9BcS7UnI6uFatkt0A+rFacH9b9JSAefZNm8wiXYKxEZ+Ml8HMUqsRg6GrVAn6SYtNtp7lzATNc4TzfqdYHaEtYd/URKNWNFAgzH9ruhtrd9b1ASCKUwtoaJ+fsGqKhi4ILu2DiO1wsEJ8YQex9mmgx/3y//b0D0FQZL/40HBTwh6FLNY3g4zjavRCm6bX/vEd/nOfKMIz+/9OHWLbeDcntLKPktEuxUnsfOKOPZvB9770s4Lyi1qRhFVCKApsL0wOmv07av+OxTBxVPASVDyFmlFBVVehjg== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(396003)(39860400002)(346002)(451199015)(40470700004)(36840700001)(46966006)(70586007)(70206006)(4326008)(40480700001)(8676002)(7636003)(356005)(6916009)(54906003)(7416002)(5660300002)(316002)(86362001)(8936002)(2906002)(186003)(83380400001)(36860700001)(1076003)(16526019)(426003)(36756003)(2616005)(26005)(336012)(47076005)(82740400003)(478600001)(40460700003)(82310400005)(41300700001)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:32.4423 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76526430-b0bc-44ea-225b-08da9b76be38 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT105.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6786 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 Create a new Flow API action: METER_MARK. It Meters a packet stream and marks its packets with colors. The marking is done on a metadata, not on a packet field. 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 mandatory here. Signed-off-by: Alexander Kozyrev --- doc/guides/prog_guide/rte_flow.rst | 25 +++++++++++++++++++++++ doc/guides/rel_notes/release_22_11.rst | 1 + lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 28 ++++++++++++++++++++++++++ 4 files changed, 55 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 018def1033..5b87d9f61e 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`_. See also `Item: REPRESENTED_PORT`_. +Action: ``METER_MARK`` +^^^^^^^^^^^^^^^^^^^^^^ + +Meters a 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 | + +==================+======================+ + | ``profile`` | Meter profile object | + +------------------+----------------------+ + | ``policy`` | Meter policy object | + +------------------+----------------------+ + Negative types ~~~~~~~~~~~~~~ diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 7969609788..401552ff84 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -60,6 +60,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 access. Removed Items ------------- diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 99247b599d..7ff024f33e 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -260,6 +260,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { MK_FLOW_ACTION(CONNTRACK, sizeof(struct rte_flow_action_conntrack)), MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct rte_flow_action_ethdev)), MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct rte_flow_action_ethdev)), + MK_FLOW_ACTION(METER_MARK, sizeof(struct rte_flow_action_meter_mark)), }; int diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index edf69fc44f..74e7ddf73a 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -2903,6 +2903,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, }; /** @@ -3774,6 +3783,25 @@ struct rte_flow_action_modify_field { uint32_t width; /**< Number of bits to use from a source field. */ }; +/** + * RTE_FLOW_ACTION_TYPE_METER_MARK + * + * Traffic metering and marking (MTR). + * + * Meters a 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 assigned 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; + /**< Policy config retrieved with rte_mtr_policy_get(). */ + struct rte_flow_meter_policy *policy; +}; + /* Mbuf dynamic field offset for metadata. */ extern int32_t rte_flow_dynf_metadata_offs; From patchwork Wed Sep 21 02:11:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116512 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85D60A034C; Wed, 21 Sep 2022 04:12:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CE3D42B72; Wed, 21 Sep 2022 04:12:39 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2046.outbound.protection.outlook.com [40.107.102.46]) by mails.dpdk.org (Postfix) with ESMTP id D5B2C42B7D for ; Wed, 21 Sep 2022 04:12:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kj29sRIlskYwsTpt6+4evd1zQEq7ggxabtvC+lXNiM2SZFciTxQU7tkE1XSZ5WGQ7qVmk5WK0Buesy2CPyEgwAU/WT6+kro0SrjTm1nXBbz4vvQ4CuXoYMV3fYHTy6XBa0zfD0FBOL4wR4Y47p5Y2W7OlkZQBLw0mnA3GjuR9ET3bjoYDokjAz85onmgMk+4Peey4nByL+UeSBAPgJMhfdgwxG49pmjAfwc8dExZjZWQmg4eweeEmb7ouNtSH5IfOW6uExGCZ5QtUJmhd7iohif0m5jbvxFd9e5JXPagV1lsmZxKwwt6UC9eKsRlk54cE0ruKGZYRBmQUkh5vBhYnw== 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=PyUtvVNznTwha86iOsUDuQMNl29XkTR9eU26vrBKerU=; b=NsZJPKEqY3yhcX6Z2QJAjcsOtAWCt1B1hc9nFD5LhdxN8naN9LW3woAUv0sh05HnN6W2/jp3zDAy4mT5rTxEIpwdbA1gsSBbnMQ0PPwH/7gfJfQsC416q15TjHhFtf0B5YCWUBhCwDKnnXcKXpmVgeXzk2ltXqz7v8DH7mi/0Uqp8iCWUflUmtammgytWzp+6Ey+FQ6eI2jLvWUAF/Cmplc/gP/MNBa966O9x29a7+upfjpMXU9QVkyGEFJK/SiCtxxFwikBFMc89aHkhdeQw5EDbynnN1cQ3c4MUt/sPjAIDcMSGv0oV0bDI9GIG59OjzyklPOGMoRtUNc8nCJ6NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=PyUtvVNznTwha86iOsUDuQMNl29XkTR9eU26vrBKerU=; b=MZXe5SNKEadC8Ywczu2fSIPRzuI/+9CHhX/rrS6bDaYaQKUnmI3nniKcjDI9pj1fWajv28mT4IvkS7E1ALG9oqp7pTpxxonxrC6jRMTn6pB8YqWaRLwiTtTKVN6sHA4LTBHsn5sakI/TIB+U1R5DaAquLNrvjX7NWyp6PBsByrI0YmlUtmDBk/hXYQkNJnY/5iIK6+Ck4KXwKv5xyLVUMs7i4lOuLNiN3Kh2v6FmpJgQPnuxmL3jr/BFcb/umOU8Rizv3LpZgC9eR7fwJhMQxpsJVVaGMJzk84DNxPaKJeEqEv9Q4gYO68QUNadto/eKU5ZyX1RCLICFxpYQVaBkeQ== Received: from BN9PR03CA0809.namprd03.prod.outlook.com (2603:10b6:408:13f::34) by BL0PR12MB4930.namprd12.prod.outlook.com (2603:10b6:208:1c8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Wed, 21 Sep 2022 02:12:35 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13f:cafe::ac) by BN9PR03CA0809.outlook.office365.com (2603:10b6:408:13f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16 via Frontend Transport; Wed, 21 Sep 2022 02:12:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:35 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:20 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:17 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 5/7] app/test-pmd: add meter color flow matching item Date: Wed, 21 Sep 2022 05:11:31 +0300 Message-ID: <20220921021133.2982954-6-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT031:EE_|BL0PR12MB4930:EE_ X-MS-Office365-Filtering-Correlation-Id: dc37ae97-2460-4ad2-2f4e-08da9b76c021 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1OHmJuyQA7ABGXqgtKySV2S66EoTlAYJLGCH88FGTcSe/5rOpfWqnBVtQHVZxeEenzaRCt4sWYGgamDhEjN5BBfr74rEv66BCZ6Cv8fSbADsGWBjoTrQ/22QbraD3YoN7r43gzYbagy1Olrq81oZfa8IQmpv21LYiHoAmVVzXE3d+cn9SndrULRu+Ta0/5BbApPW+wTcV6iPy1foyptPr2Az0DZr73M4kCxI4YofvRoShxWn8seENSpdH3wfOGBtYWI8igqcvHA+pNAD8HgbhGXouRQ4Z9D0DBYNlHSYrDoEygSKHgvN5hjP7Euwoe5WA0Vr38McukJ584GHgoiwnp1HIg/RFI/rATSRpe5kLVBujnFAYyM4AXsNnMDW+nJV5xrGktvolE2rc414HjaqvwyJ1746rEaGn/eaj9QHxo3Cyo2/pbEEdtsIgbYS8YsiVaxHygDKvG3d7ZA3UtbupMDbbskHFLt6W/xcDNBgmlnSamWUi0XObVvDA0YWY5gUx8XQBCc41OpAl4U0/yW6I+6ooNJAziTZcwe+WxyzNnW1QAhF5YmqZbC+HZS+pOsFhVyPd2r5C2wlTQ4ZPU7b0tQT57ILiC3MlUdlE+ZamXhNKlEWMKmSBJ5Rqok6GIotbmDmC19ECXpuuQYwMja91w1VVaZ8D+1q8BDI30U8Mow4OlxR+smwT+U2ubVPSCYaX68jYfktiaECqZxRclC4+h759IohAGPGhi0J7/O7U5+fNnMIppVltMQg3aVOUjXfkIUnm0jAV3V5z/ZCGoNnDg== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(396003)(346002)(136003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(36860700001)(7416002)(5660300002)(47076005)(82740400003)(83380400001)(6916009)(40480700001)(54906003)(478600001)(316002)(40460700003)(356005)(336012)(1076003)(70586007)(26005)(41300700001)(426003)(7636003)(2906002)(2616005)(16526019)(82310400005)(186003)(86362001)(8936002)(70206006)(36756003)(8676002)(6666004)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:35.6318 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc37ae97-2460-4ad2-2f4e-08da9b76c021 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4930 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 Add testpmd command line to match on a meter color: flow create 0 ingress group 0 pattern meter color is green / end Signed-off-by: Alexander Kozyrev --- app/test-pmd/cmdline_flow.c | 83 +++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 + 2 files changed, 87 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 7f50028eb7..b8c92efb1d 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -458,6 +458,9 @@ enum index { ITEM_PPP_ADDR, ITEM_PPP_CTRL, ITEM_PPP_PROTO_ID, + ITEM_METER, + ITEM_METER_COLOR, + ITEM_METER_COLOR_NAME, /* Validate/create actions. */ ACTIONS, @@ -799,6 +802,10 @@ static const char *const modify_field_ids[] = { "ipv4_ecn", "ipv6_ecn", NULL }; +static const char *const meter_colors[] = { + "green", "yellow", "red", "all", NULL +}; + /** Maximum number of subsequent tokens and arguments on the stack. */ #define CTX_STACK_SIZE 16 @@ -1332,6 +1339,7 @@ static const enum index next_item[] = { ITEM_FLEX, ITEM_L2TPV2, ITEM_PPP, + ITEM_METER, END_SET, ZERO, }; @@ -1804,6 +1812,12 @@ static const enum index item_ppp[] = { ZERO, }; +static const enum index item_meter[] = { + ITEM_METER_COLOR, + ITEM_NEXT, + ZERO, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -2372,6 +2386,9 @@ static int parse_ia_id2ptr(struct context *ctx, const struct token *token, static int parse_mp(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); +static int parse_meter_color(struct context *ctx, const struct token *token, + const char *str, unsigned int len, void *buf, + unsigned int size); static int comp_none(struct context *, const struct token *, unsigned int, char *, unsigned int); static int comp_boolean(struct context *, const struct token *, @@ -2402,6 +2419,8 @@ static int comp_table_id(struct context *, const struct token *, unsigned int, char *, unsigned int); static int comp_queue_id(struct context *, const struct token *, unsigned int, char *, unsigned int); +static int comp_meter_color(struct context *, const struct token *, + unsigned int, char *, unsigned int); /** Token definitions. */ static const struct token token_list[] = { @@ -5064,6 +5083,29 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct rte_flow_item_ppp, hdr.proto_id)), }, + [ITEM_METER] = { + .name = "meter", + .help = "match meter color", + .priv = PRIV_ITEM(METER_COLOR, + sizeof(struct rte_flow_item_meter_color)), + .next = NEXT(item_meter), + .call = parse_vc, + }, + [ITEM_METER_COLOR] = { + .name = "color", + .help = "meter color", + .next = NEXT(item_meter, + NEXT_ENTRY(ITEM_METER_COLOR_NAME), + item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_meter_color, + color)), + }, + [ITEM_METER_COLOR_NAME] = { + .name = "color_name", + .help = "meter color name", + .call = parse_meter_color, + .comp = comp_meter_color, + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", @@ -9867,6 +9909,30 @@ parse_flex_handle(struct context *ctx, const struct token *token, return ret; } +/** Parse Meter color name */ +static int +parse_meter_color(struct context *ctx, const struct token *token, + const char *str, unsigned int len, void *buf, + unsigned int size) +{ + struct rte_flow_item_meter_color *meter_color; + unsigned int i; + + (void)token; + (void)buf; + (void)size; + for (i = 0; meter_colors[i]; ++i) + if (!strcmp_partial(meter_colors[i], str, len)) + break; + if (!meter_colors[i]) + return -1; + if (!ctx->object) + return len; + meter_color = ctx->object; + meter_color->color = (enum rte_color)i; + return len; +} + /** No completion. */ static int comp_none(struct context *ctx, const struct token *token, @@ -10158,6 +10224,20 @@ comp_queue_id(struct context *ctx, const struct token *token, return i; } +/** Complete available Meter colors. */ +static int +comp_meter_color(struct context *ctx, const struct token *token, + unsigned int ent, char *buf, unsigned int size) +{ + RTE_SET_USED(ctx); + RTE_SET_USED(token); + if (!buf) + return RTE_DIM(meter_colors); + if (ent < RTE_DIM(meter_colors) - 1) + return strlcpy(buf, meter_colors[ent], size); + return -1; +} + /** Internal context. */ static struct context cmd_flow_context; @@ -10773,6 +10853,9 @@ flow_item_default_mask(const struct rte_flow_item *item) case RTE_FLOW_ITEM_TYPE_PPP: mask = &rte_flow_item_ppp_mask; break; + case RTE_FLOW_ITEM_TYPE_METER_COLOR: + mask = &rte_flow_item_meter_color_mask; + break; default: break; } diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 330e34427d..150cfc0664 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3904,6 +3904,10 @@ This section lists supported pattern items and their attributes, if any. - ``ctrl {unsigned}``: PPP control. - ``proto_id {unsigned}``: PPP protocol identifier. +- ``meter``: match Meter color. + + - ``color {value}``: Meter color value(green/yellow/red). + Actions list ^^^^^^^^^^^^ From patchwork Wed Sep 21 02:11:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116513 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7035AA034C; Wed, 21 Sep 2022 04:12:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CE5B42B7B; Wed, 21 Sep 2022 04:12:41 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2075.outbound.protection.outlook.com [40.107.96.75]) by mails.dpdk.org (Postfix) with ESMTP id D256642B78 for ; Wed, 21 Sep 2022 04:12:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KJvWyHTxy2HjgEz/pXoV7UiedxZw+sMDoB8/wxFLHiew7IjSDJ0Xs1oWqnmDBAYs9rTrbNwOaNNolaXkSu4IQZiFVwmcC7VVhAMtQL/494fz29CtnhR1Slhxp5kGDyd0Td69BC97Glow5mQDJH2UULZFR18QgyCbE8rOdkfYgZ2AOrx3MkLT6ayi+YTKp2vNblrRt8ZfYG0mbt3RNg+asGTibKlObgKuQyMsgQCSvVjJYx5ff5/ZdgI23EhfaB4a6hP15+j5yCf/6gL4IZSP2aQU8+rUOPbvI9B9D5rBN7mwi9PCDzWWqQCZSp2MYitvXrOXtZsRYUtAKKA8z/+bSg== 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=ndfp2lgpQtET5KcHIGF9VTYSm73YWBrIwGop3aHsTVY=; b=XHkmEhLmrq34k1tqJ/25bHumuan+YAv/jPn7YV8/OQj1MwKaLUfq1FB320skTMvRCpiW/qg4WQqlX4YXUrqpv39N5fdef5XctsNBYjEE17Y4Rj5PeoANCV5NspUrW4GsOkjyzq1uemQoWEunD/OnYgu6abx6HyhBtF8WSrMHU95CLe2jQFOtcZ4zxgApZIsnLXDQyv53h0VDV1HRHud2Nlsv1AJebuP1QY9bDcet0dQ4FUnt/DOlibaUh7XgUd9eodukxSCiXvCbY7JoU4iFS/u4Az3WVwpuCdNDUOFXnr87py5NZ/wD5m3zcJtxjT5ofpBLtbYkz7hZMmlG2K5jlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=ndfp2lgpQtET5KcHIGF9VTYSm73YWBrIwGop3aHsTVY=; b=ufA3ideIfgPmwFTrzJiVO8rq54lOSmoJZs1HCEiOwPKjMOlrHyYnS/fG3/XOcaG45wsdTp8xEamzxprIu8cjWrFRa14iMzuQ/rSsnXLMjajfqvr2yUbrBJ20zd/SVZyoOgb2l33oDzn0mQeVLH236VtZuY6DufVim31jUILKCPqe60tUa4ye6JawQq6kNgRk+Eba5AX4Wcwmd+kt0SlldQca94nQ0wHTCRLgM8Ug9it4bObtAc+w8jdF7vmHMO0PciobBfFbke7WRj4ZPNR1NJ3iuSkz5IVruug6K+xHT1IhwIHGVjzZSnvxChXwGq5f0Gvc2m9pxW7PCumetQIKww== Received: from MW4PR04CA0248.namprd04.prod.outlook.com (2603:10b6:303:88::13) by BY5PR12MB4067.namprd12.prod.outlook.com (2603:10b6:a03:212::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Wed, 21 Sep 2022 02:12:37 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::22) by MW4PR04CA0248.outlook.office365.com (2603:10b6:303:88::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:24 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:21 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 6/7] app/test-pmd: allow meter color marker modification Date: Wed, 21 Sep 2022 05:11:32 +0300 Message-ID: <20220921021133.2982954-7-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT053:EE_|BY5PR12MB4067:EE_ X-MS-Office365-Filtering-Correlation-Id: ac3e8ef5-ab87-43d2-1908-08da9b76c145 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j3EiPtga1cqgQTz71QgVx5e2NaQ158NWSRG6hXCNM6ps4hOMYuQLtuMueoljcqTDVGdNWXV5kPhUnbXgbRSDh7sdu/EXH1V3VIi7rfgkSON8LJQsSEdlED8HN4X1IEXlhghdtCnx8yPpMbRhxiNJdn+/edcdA0kPkwGiSV3B3u9AvuPR8cEoFYnLFqc9MKpfTQnzK9FsF+yUwEOEYSkMdiAnZHWkRUagrBfY+zp+kPXE8CN9wK9TLQldquA7caPGN6HxZ7bhoqGu58tcGs3TGAJnKpYKt1mQ3dysucDXBR3t5Xw9zwiGz21DOvjmRMgeM9mNesTJWfOrZOGhsiSseKN9kUmNDXM9TKC/df5oclJv6sHvWJMDqudsDYa8OVGzG9/ks077ZDKshhzf6khULg5lWMWOxc8YuEpcgQV9yNXVsV+IpcTzFBT1cCis0hpFadNpETXW7lkYFnGE727qYVOXb3vRriccn1NwTSzoxDVKBZYOyAkm4s3vju8faZ8NChCHpdrK4m2xfzFPZKo1bhQli0MnhltIg+I7Izkc+gBWfG3u0ZnCri0oS4wyWGSlYmW/YN/b5Mm3N8R6FTWdozebw33kQVuG2UvSGnT/twZKvo7f2bmqWdMghsAxdJhA7HZLsuEH1VPULkt+fO5JluA+svoZ3KbxHpirO6Je32/yvSW7cNWqLB7N99FW2IaEzimRoo2sms0rOtio1f7IA3H8jCvwSKBlH2JlVsmSbh9LLmTxHhGmxXdhlWbNM8EvSI2QeHoTqxNvJlh45/BmPA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199015)(40470700004)(36840700001)(46966006)(54906003)(6916009)(316002)(36756003)(86362001)(7636003)(356005)(36860700001)(2616005)(1076003)(4744005)(82740400003)(83380400001)(186003)(47076005)(336012)(16526019)(426003)(40460700003)(478600001)(8676002)(70586007)(70206006)(4326008)(26005)(6666004)(41300700001)(8936002)(7416002)(5660300002)(2906002)(40480700001)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:37.5605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac3e8ef5-ab87-43d2-1908-08da9b76c145 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4067 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 Extend the list of available modify_field IDs to include recently added meter color marker item in testpmd CLI. Signed-off-by: Alexander Kozyrev --- app/test-pmd/cmdline_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index b8c92efb1d..e6f4bdf3b2 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -799,7 +799,7 @@ static const char *const modify_field_ids[] = { "udp_port_src", "udp_port_dst", "vxlan_vni", "geneve_vni", "gtp_teid", "tag", "mark", "meta", "pointer", "value", - "ipv4_ecn", "ipv6_ecn", NULL + "ipv4_ecn", "ipv6_ecn", "meter_color", NULL }; static const char *const meter_colors[] = { From patchwork Wed Sep 21 02:11:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 116514 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1906DA034C; Wed, 21 Sep 2022 04:13:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2630E42B81; Wed, 21 Sep 2022 04:12:45 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2083.outbound.protection.outlook.com [40.107.223.83]) by mails.dpdk.org (Postfix) with ESMTP id EBCA241181 for ; Wed, 21 Sep 2022 04:12:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mq+htiIGUl2pNjnSlzBfczlJyaTomsVrnB0Fvzvn8YQmKy8TPmFza0fufQoEPM8qCvWIN0lpm/lH4wJyQekSm9dQk9iYzyuEAPwD8CdCZLxT2zDUfXARvmV6ZiijQo/QYKqWxce29Hyp+mocjnJ3tTlmUm+44AVoRfvnxTXsFh+Ma0RSm+2enKsyo0+IlGRSvMxmFQVXlslE0tcJcVfb1ulbugxaIdYxv7xczE6xCWkqCk+IyM98xiE7WMpdvQ7WO8ii/L4hwqk35JiaD28AVUGliKCnQuYKM3nKuxozQnGm7e2WZ+vUoS0T6VkKxwbxxW3NVGB8S9ecQvD8r3n9eA== 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=Tlbwzg4b+mXnItlNGKHtW791O/l/0E+tzomDI+4xGdI=; b=FiFFMar6SC5GeH60tRzYuz++StUhwcBE/HIEf4bhCEs1xYIaj2VHnIJ32SYw3ODq4e4q6p4Btao4gPLqhSn95HwZp/nL2g8smIZFh6LdcFN6YLuW/B4b41v7ubYyIBXO8yh/fB/lzJUYimxh8ue8nWJ5Etqrhd2mHmdrlvi0QYOuO0Lyzdl3RwGhj7y8dq8SQZ1UdoXiaak0sS7LJpJyn6m+y+b4twIcpLKhXnJ4nyMvFo12ognEVpPkdVMqAiFYyP51Yui+zvdi59DH/qBK/NoXVqEF3OkAUBXSiiRVEHsD1xm4sj5CzAQI2Snj/SMIkjnuTZIwHieyFKDgpMpDaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=Tlbwzg4b+mXnItlNGKHtW791O/l/0E+tzomDI+4xGdI=; b=CRRDHeXgaNQRJzev0TsqM24DCscuyYgtRkJJ7gBZeG+4/aTt0gmsTgwG1jAKrlLD7+DApVS+2NXD0+qbrDE7DB/XHYyBobmiUGoz2AnHmhzHp8u7rmt+K7Cqe7FaDKFxx99HcZV3OgoOCu7xP1cbvj7KYEIg2+M2KHqZ7I+VIVF/p+BHAv8VVv8ywFzmnYvbvC6KfPq1f0LO9i8wCbc+Ay6zGlkVVnJPVaWXXAaIvMA1Nxd1PvdhpSa1Lau/pS/QQvh/B4cUjL7j6otPlsGAY5GEJ2ANi2NQZVlX4aIXXRtunt+lBe2l4OAejK2aq/qOdou3ta9YEuShZXTPwgSA7Q== Received: from MW2PR16CA0004.namprd16.prod.outlook.com (2603:10b6:907::17) by SA1PR12MB6917.namprd12.prod.outlook.com (2603:10b6:806:24c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Wed, 21 Sep 2022 02:12:41 +0000 Received: from CO1NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::e8) by MW2PR16CA0004.outlook.office365.com (2603:10b6:907::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16 via Frontend Transport; Wed, 21 Sep 2022 02:12:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT024.mail.protection.outlook.com (10.13.174.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Wed, 21 Sep 2022 02:12:40 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 20 Sep 2022 19:12:28 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 20 Sep 2022 19:12:24 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH v4 7/7] app/testpmd: add meter color mark flow action Date: Wed, 21 Sep 2022 05:11:33 +0300 Message-ID: <20220921021133.2982954-8-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220921021133.2982954-1-akozyrev@nvidia.com> References: <20220601034408.2579943-1-akozyrev@nvidia.com> <20220921021133.2982954-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT024:EE_|SA1PR12MB6917:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ff06b97-1585-43a5-389e-08da9b76c331 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nkdj41+Adt4tBZTIo8Btu/sDsHS/LAntV1NDH0aFjSNN4FnXgELtwvMixEB/J16BXEDsZvC/RIjRlfJdQJOv5a9s8A248qM+Bx2cdlz+XSm5b0emKYVd1ltSufVpWtBK2Xv39XPfybMWkadINTZ0MntPid2ai1muWNqgsLwQnXJRrk0drg5pReXvaLWrQ0d/fQbxsnQl9N8jxbf0GfSAf83cfBbCshAcZfUQJbkPlEHeibX1lJnhS5lU+zF3ekizlVpT9w+2FWOzjb/PniFN+qPMEdhAXpgQgT4AaRWhFAMOau5KnaXGAU1QIJ68DkYsMDaCC2i7lxZ5bG8bn+ryZYjc9p8L5besCOC/4zRzgbz9tccJcdwBfODS6i4R7SMHDkEHN9dxTXiZGxge5BbaRdMn5qPJwKnIPPMjEOGBkHjyrDKHZHZiTYdMVF2DevxNVJSIWuitFp6kWJ+Ra8xeXmcHAmDF05uHSAmi9LQalzo/Hq6le8pzSRaxGddJYBZTtrj39TAtWVC/Pw4bjtPyBVpCW5MT5o45IH7OBAA1H5vj1XsF3Ae+O6r4HLt6qn92acjgO2ILqWZUpRhz52Uwrv8gTM+eSqZd/LD2s5dUiS11tlIV4VZ9ev0JsxrGI6hp6tiWgARxUYLJxxrMP2ag10pt5oCTq9/bJ8EzQM4zqSjXYkM4BieHCyV5UFjOoCLPO7eCHWepFwVMlaUyMx6SRVXQt241CyvSIGZriecEneLVQWByPU+zSVih6/rY64IcCkgjr17vjPT/wA+azJ/MfQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(39860400002)(346002)(396003)(451199015)(36840700001)(46966006)(40470700004)(186003)(1076003)(47076005)(426003)(336012)(16526019)(2616005)(83380400001)(82310400005)(26005)(36860700001)(7416002)(6666004)(86362001)(4326008)(8676002)(40460700003)(70206006)(54906003)(6916009)(316002)(82740400003)(2906002)(5660300002)(478600001)(8936002)(70586007)(40480700001)(356005)(7636003)(36756003)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 02:12:40.8013 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ff06b97-1585-43a5-389e-08da9b76c331 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6917 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 Add testpmd command line to match for METER_MARK action: flow create ... actions meter_mark mtr_profile 20 / end Signed-off-by: Alexander Kozyrev --- app/test-pmd/cmdline_flow.c | 127 ++++++++++++++++++++ app/test-pmd/config.c | 26 ++++ app/test-pmd/testpmd.h | 4 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 + 4 files changed, 162 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index e6f4bdf3b2..dd837e27f7 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -53,6 +53,7 @@ enum index { COMMON_GROUP_ID, COMMON_PRIORITY_LEVEL, COMMON_INDIRECT_ACTION_ID, + COMMON_PROFILE_ID, COMMON_POLICY_ID, COMMON_FLEX_HANDLE, COMMON_FLEX_TOKEN, @@ -508,6 +509,11 @@ enum index { ACTION_METER_COLOR_YELLOW, ACTION_METER_COLOR_RED, ACTION_METER_ID, + ACTION_METER_MARK, + ACTION_METER_PROFILE, + ACTION_METER_PROFILE_ID2PTR, + ACTION_METER_POLICY, + ACTION_METER_POLICY_ID2PTR, ACTION_OF_SET_MPLS_TTL, ACTION_OF_SET_MPLS_TTL_MPLS_TTL, ACTION_OF_DEC_MPLS_TTL, @@ -1835,6 +1841,7 @@ static const enum index next_action[] = { ACTION_PORT_ID, ACTION_METER, ACTION_METER_COLOR, + ACTION_METER_MARK, ACTION_OF_SET_MPLS_TTL, ACTION_OF_DEC_MPLS_TTL, ACTION_OF_SET_NW_TTL, @@ -1951,6 +1958,13 @@ static const enum index action_meter_color[] = { ZERO, }; +static const enum index action_meter_mark[] = { + ACTION_METER_PROFILE, + ACTION_METER_POLICY, + ACTION_NEXT, + ZERO, +}; + static const enum index action_of_set_mpls_ttl[] = { ACTION_OF_SET_MPLS_TTL_MPLS_TTL, ACTION_NEXT, @@ -2389,6 +2403,14 @@ static int parse_mp(struct context *, const struct token *, static int parse_meter_color(struct context *ctx, const struct token *token, const char *str, unsigned int len, void *buf, unsigned int size); +static int parse_meter_profile_id2ptr(struct context *ctx, + const struct token *token, + const char *str, unsigned int len, + void *buf, unsigned int size); +static int parse_meter_policy_id2ptr(struct context *ctx, + const struct token *token, + const char *str, unsigned int len, + void *buf, unsigned int size); static int comp_none(struct context *, const struct token *, unsigned int, char *, unsigned int); static int comp_boolean(struct context *, const struct token *, @@ -2550,6 +2572,13 @@ static const struct token token_list[] = { .call = parse_int, .comp = comp_none, }, + [COMMON_PROFILE_ID] = { + .name = "{profile_id}", + .type = "PROFILE_ID", + .help = "profile id", + .call = parse_int, + .comp = comp_none, + }, [COMMON_POLICY_ID] = { .name = "{policy_id}", .type = "POLICY_ID", @@ -5428,6 +5457,42 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct rte_flow_action_meter, mtr_id)), .call = parse_vc_conf, }, + [ACTION_METER_MARK] = { + .name = "meter_mark", + .help = "meter the directed packets using profile and policy", + .priv = PRIV_ACTION(METER_MARK, + sizeof(struct rte_flow_action_meter_mark)), + .next = NEXT(action_meter_mark), + .call = parse_vc, + }, + [ACTION_METER_PROFILE] = { + .name = "mtr_profile", + .help = "meter profile id to use", + .next = NEXT(NEXT_ENTRY(ACTION_METER_PROFILE_ID2PTR)), + .args = ARGS(ARGS_ENTRY_ARB(0, sizeof(uint32_t))), + }, + [ACTION_METER_PROFILE_ID2PTR] = { + .name = "{mtr_profile_id}", + .type = "PROFILE_ID", + .help = "meter profile id", + .next = NEXT(action_meter_mark), + .call = parse_meter_profile_id2ptr, + .comp = comp_none, + }, + [ACTION_METER_POLICY] = { + .name = "mtr_policy", + .help = "meter policy id to use", + .next = NEXT(NEXT_ENTRY(ACTION_METER_POLICY_ID2PTR)), + ARGS(ARGS_ENTRY_ARB(0, sizeof(uint32_t))), + }, + [ACTION_METER_POLICY_ID2PTR] = { + .name = "{mtr_policy_id}", + .type = "POLICY_ID", + .help = "meter policy id", + .next = NEXT(action_meter_mark), + .call = parse_meter_policy_id2ptr, + .comp = comp_none, + }, [ACTION_OF_SET_MPLS_TTL] = { .name = "of_set_mpls_ttl", .help = "OpenFlow's OFPAT_SET_MPLS_TTL", @@ -9747,6 +9812,68 @@ parse_ia_id2ptr(struct context *ctx, const struct token *token, return ret; } +static int +parse_meter_profile_id2ptr(struct context *ctx, const struct token *token, + const char *str, unsigned int len, + void *buf, unsigned int size) +{ + struct rte_flow_action *action = ctx->object; + struct rte_flow_action_meter_mark *meter; + struct rte_flow_meter_profile *profile = NULL; + uint32_t id; + int ret; + + (void)buf; + (void)size; + ctx->objdata = 0; + ctx->object = &id; + ctx->objmask = NULL; + ret = parse_int(ctx, token, str, len, ctx->object, sizeof(id)); + ctx->object = action; + if (ret != (int)len) + return ret; + /* set meter profile */ + if (action) { + meter = (struct rte_flow_action_meter_mark *) + (uintptr_t)(action->conf); + profile = port_meter_profile_get_by_id(ctx->port, id); + meter->profile = profile; + ret = (profile) ? ret : -1; + } + return ret; +} + +static int +parse_meter_policy_id2ptr(struct context *ctx, const struct token *token, + const char *str, unsigned int len, + void *buf, unsigned int size) +{ + struct rte_flow_action *action = ctx->object; + struct rte_flow_action_meter_mark *meter; + struct rte_flow_meter_policy *policy = NULL; + uint32_t id; + int ret; + + (void)buf; + (void)size; + ctx->objdata = 0; + ctx->object = &id; + ctx->objmask = NULL; + ret = parse_int(ctx, token, str, len, ctx->object, sizeof(id)); + ctx->object = action; + if (ret != (int)len) + return ret; + /* set meter policy */ + if (action) { + meter = (struct rte_flow_action_meter_mark *) + (uintptr_t)(action->conf); + policy = port_meter_policy_get_by_id(ctx->port, id); + meter->policy = policy; + ret = (policy) ? ret : -1; + } + return ret; +} + /** Parse set command, initialize output buffer for subsequent tokens. */ static int parse_set_raw_encap_decap(struct context *ctx, const struct token *token, diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index a2939867c4..6f82bd783c 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2316,6 +2316,32 @@ port_meter_policy_add(portid_t port_id, uint32_t policy_id, return ret; } +/** Get port meter profile */ +struct rte_flow_meter_profile * +port_meter_profile_get_by_id(portid_t port_id, uint32_t id) +{ + struct rte_mtr_error error; + struct rte_flow_meter_profile *profile; + + profile = rte_mtr_meter_profile_get(port_id, id, &error); + if (!profile) + print_mtr_err_msg(&error); + return profile; +} + +/** Get port meter policy */ +struct rte_flow_meter_policy * +port_meter_policy_get_by_id(portid_t port_id, uint32_t id) +{ + struct rte_mtr_error error; + struct rte_flow_meter_policy *policy; + + policy = rte_mtr_meter_policy_get(port_id, id, &error); + if (!policy) + print_mtr_err_msg(&error); + return policy; +} + /** Validate flow rule. */ int port_flow_validate(portid_t port_id, diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index fb2f5195d3..ac1e1b7d22 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -1013,6 +1013,10 @@ void port_flow_tunnel_create(portid_t port_id, const struct tunnel_ops *ops); int port_flow_isolate(portid_t port_id, int set); int port_meter_policy_add(portid_t port_id, uint32_t policy_id, const struct rte_flow_action *actions); +struct rte_flow_meter_profile *port_meter_profile_get_by_id(portid_t port_id, + uint32_t id); +struct rte_flow_meter_policy *port_meter_policy_get_by_id(portid_t port_id, + uint32_t id); void rx_ring_desc_display(portid_t port_id, queueid_t rxq_id, uint16_t rxd_id); void tx_ring_desc_display(portid_t port_id, queueid_t txq_id, uint16_t txd_id); diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 150cfc0664..cf09dc5aef 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -4193,6 +4193,11 @@ This section lists supported actions and their attributes, if any. - ``ethdev_port_id {unsigned}``: ethdev port ID +- ``meter_mark``: meter the directed packets using profile and policy + + - ``mtr_profile {unsigned}``: meter profile id to use + - ``mtr_policy {unsigned}``: meter policy id to use + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~