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 0F5E1A0503; Wed, 18 May 2022 06:35:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4585E42B7B; Wed, 18 May 2022 06:35:42 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2045.outbound.protection.outlook.com [40.107.92.45]) by mails.dpdk.org (Postfix) with ESMTP id 0F7DB4281D for ; Wed, 18 May 2022 06:35:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nge6TeP7DhZ3thnhudUoOn8rrLrtSVbpkezB8wqD9DhxeC60Cxy7Fa9j1z+w6xpdXDUU0Kj7d1mgGNKkMqldSmRRgl9yziyX8Y/M57/dPgJWyiLoXpRLG1Vsc7lMeScTx4lNeGazwx0Dj8/mSGYGrm713RU1D9S0c+Mcy3f5IwdzpYTRINrBTg5iLOuRZA/RlD4VQUn69GJYWkR6ztw6R0U5gDmuE5K3eCxPa4q7Wa2AgB7lCjetdVYYNmIBfOk8ynj1sxLCakW0U/wfGgAItZ5oGOdfavijLCLswVXd47BqR4unDHhTJUHviIgCi5MiQxAL0Ytht3G0abLx7i5muA== 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=IVAmRraNnUJmBC/VMyugOTEm8Z3rU9TBm7lsug6RZWs=; b=PYW1frITUJjI6sO5nIDIFM6GTpiXOgKJKkRxx0fO3cl9s8ezOfbpXMaFrlPjGLkh588M3DbWxHAmpzser71yvzOFn6hdn91qr658MVZtDbZG6Rsu378IE1FC7pM9YasejKUyoThIVWdR14oa7RaRMH9eXwonEoUdGhrbtes0V2v0z+g5s79tvVtWNf4/xX6XuchI1e+e27EA8Mth4JetBLADp7jBBI3IZle0v1xu6kiih7EPGhTQBuHcbICndU2qJpE+HOFzGS6z3qwbgXzwnBmY4qZggR7i5LSC4f+A1Qca8dNLQl9AQt2SPp8oWUZEffSs42CF+wcwv5h0s1dtRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=intel.com 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=IVAmRraNnUJmBC/VMyugOTEm8Z3rU9TBm7lsug6RZWs=; b=fvdXYLQGsJcaQEa6xPhgnBRwYm0WUSEJkgYSSOtwralEhP7gveP8rPXprf0h9Sb7oOHD2j4WhZxzcl0UT2bICbyuNrk3A4Tzldfytgp3eokPGVBONK5ulhkjdJSkQ3gNCY/pYHDB1r6S8uUyAgBlHktmKE77X3WUfIMU2/PquTkUEwoZG5bJ3K/79JXKLIJWRKEJTbDgG54Eey0g2gh+eEZJTx3dixPglEmKdhUp1EMneXlZJgOrOUDOTvwXoWXg9TduM3wT6l7anvN4wk3qaeQo3cU+DdE77e0Bc7SAMFJOtPqihQkugRLI0MtiS9tKlT+56qdxpgT1Mt0w5hRC2g== Received: from BN9PR03CA0097.namprd03.prod.outlook.com (2603:10b6:408:fd::12) by CY4PR12MB1896.namprd12.prod.outlook.com (2603:10b6:903:124::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Wed, 18 May 2022 04:35:39 +0000 Received: from BN8NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fd:cafe::77) by BN9PR03CA0097.outlook.office365.com (2603:10b6:408:fd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13 via Frontend Transport; Wed, 18 May 2022 04:35:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT040.mail.protection.outlook.com (10.13.177.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5273.14 via Frontend Transport; Wed, 18 May 2022 04:35:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 18 May 2022 04:35:32 +0000 Received: from pegasus01.mtr.labs.mlnx (10.126.230.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.22; Tue, 17 May 2022 21:35:28 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , , , , Subject: [PATCH 4/4] ethdev: add meter color mark flow action Date: Wed, 18 May 2022 07:34:59 +0300 Message-ID: <20220518043459.1281590-5-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220518043459.1281590-1-akozyrev@nvidia.com> References: <20220502200439.4100965-1-akozyrev@nvidia.com> <20220518043459.1281590-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.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-Office365-Filtering-Correlation-Id: 67cab4df-8835-419c-34ed-08da3887dbf3 X-MS-TrafficTypeDiagnostic: CY4PR12MB1896: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: esP3gBHKKHW24kjxMEDv5fYOoHbvJxIsykYZqcdxSVz88H2T85XLSfyqUT3GLUc+X2L6EZExtq2bOUNBLVTxm8++cs7ynnp5ILcffijxzDu6SwM/bbdKYeOHDucBFHLg9HK18ydNnCjwYGB5HpjzOWeWuidGcDmWH+DZSk3LM8EjvELBNMyGCAHGvUjZ+n3YsG1yk7k8+W3FcvFEWpKYRPmN0Xt77dpCv5qrn/5AhFu1XtqFlz6FhvVrV1/5f1Q7S7hgpEAaIFpLD7tbq9GzVjuO4idfery773JNBKJjFYk6dPbe4FGiDjCRvDfOqmvEFlfx0iRg7HRnA9EQiaFE0e1O+XkWQW45hy6HqQgI3wyUhhSHzz1/kpzqMu911F9tTBQoAzaLWxeUrDA/moavwzAq7DxlDIB74JnLSxRhMxMorjwSQ4jkBrLk644p13rYSomD4b70pU2LVdcgNGJj0HODQTPlxb1ovfv1R/vbRRhdd06HwIjjunfJOY8VKlQzJ78y21Sv8r6V27h8mlW8a6Hbfh1HNb/4scEC9+3mofXG/L4aIEtFRhf9KGrw6LJC0qpsgub45Ydcl9qt1qe8zkQ7yK3jnMFo7TKVbrn9tJFq8Qwlq88Pf5bYIWqEHMGUxoZjNLP6XEQhpvDcC8IFvwqQpPKXlB+qpxXlLSSJsd6fdFFIb+pMMpw1i+DWLJ5wNc8JRakdliT9Z+Q/hp5rNg== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(2906002)(508600001)(6916009)(54906003)(316002)(70206006)(81166007)(86362001)(356005)(8676002)(4326008)(6666004)(40460700003)(5660300002)(186003)(26005)(36860700001)(426003)(47076005)(2616005)(336012)(8936002)(7416002)(82310400005)(16526019)(1076003)(70586007)(83380400001)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 04:35:38.6517 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67cab4df-8835-419c-34ed-08da3887dbf3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1896 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 an IP packet stream and marks its packets with colors. Unlike the METER action, it performs no policing at all. An user has the flexibility to create any policies with the help of the METER_COLOR item later, only meter profile is required now. Signed-off-by: Alexander Kozyrev --- doc/guides/prog_guide/rte_flow.rst | 26 +++++++++++++++++++ doc/guides/rel_notes/release_22_07.rst | 1 + lib/ethdev/rte_flow.h | 36 ++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 1877d4b9b5..f5a2150f86 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -3411,6 +3411,32 @@ This action is meant to use the same structure as `Action: PORT_REPRESENTOR`_. See also `Item: REPRESENTED_PORT`_. +Action: ``METER_MARK`` +^^^^^^^^^^^^^^^^^^^^^^ + +Meters an IP packet stream and marks its packets with colors. + +Applies a stage of metering only. Unlike the ``METER`` action, +no policing is performed and the ``METER_COLOR`` item may be used later. +The profle object has to be created using the rte_mtr_profile_create() API. +The ID of the profile object may be specified as an action parameter. +Or PMD-specific profile configuration may be used to save the time to calculate +the profile configuration via rte_mtr_profile_calculate() API. + +.. _table_rte_flow_action_meter_mark: + +.. table:: METER_MARK + + +------------------+----------------------+ + | Field | Value | + +==================+======================+ + | ``mode`` | Meter profile mode | + +------------------+----------------------+ + | ``profile_id`` | Meter profile ID | + +------------------+----------------------+ + | ``profile_cfg`` | Meter profile config | + +------------------+----------------------+ + Negative types ~~~~~~~~~~~~~~ diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst index 5f19223663..591ac7cfba 100644 --- a/doc/guides/rel_notes/release_22_07.rst +++ b/doc/guides/rel_notes/release_22_07.rst @@ -65,6 +65,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 calculate a profile configuration values. + * Added METER_MARK action to perform Meter color marking only. * **Updated Intel iavf driver.** diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 817df34ed0..ac3a3b338f 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -2906,6 +2906,15 @@ enum rte_flow_action_type { * @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + + /** + * Traffic metering and marking (MTR). + * the entity represented by the given ethdev. + * + * @see struct rte_flow_action_meter_mark + * See file rte_mtr.h for MTR profile object configuration. + */ + RTE_FLOW_ACTION_TYPE_METER_MARK, }; /** @@ -3775,6 +3784,33 @@ struct rte_flow_action_modify_field { uint32_t width; /**< Number of bits to use from a source field. */ }; +/** + * Meter profile mode for METER_MARK action. + */ +enum rte_flow_meter_profile_mode { + RTE_FLOW_METER_PROFILE_ID = 0, /**< Use profile ID. */ + RTE_FLOW_METER_PROFILE_CFG, /**< Use profile config. */ +}; + +/** + * RTE_FLOW_ACTION_TYPE_METER_MARK + * + * Traffic metering and marking (MTR). + * + * Meters an IP packet stream and marks its packets either + * green, yellow, or red according to the specified profile. + */ +struct rte_flow_action_meter_mark { + enum rte_flow_meter_profile_mode mode; /** Meter profile mode. */ + RTE_STD_C11 + union { + /**< Profile ID create with rte_mtr_profile_create(). */ + uint32_t profile_id; + /**< Profile config calculated with rte_mtr_profile_calculate(). */ + void *profile_cfg; + }; +}; + /* Mbuf dynamic field offset for metadata. */ extern int32_t rte_flow_dynf_metadata_offs; -- 2.18.2