[v3,2/7] ethdev: allow meter color marker modification

Message ID 20220601034408.2579943-3-akozyrev@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Andrew Rybchenko
Headers
Series ethdev: separate metering and marking from policing |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Alexander Kozyrev June 1, 2022, 3:44 a.m. UTC
  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 <akozyrev@nvidia.com>
---
 doc/guides/rel_notes/release_22_07.rst | 1 +
 lib/ethdev/rte_flow.h                  | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Ori Kam June 1, 2022, 8:45 a.m. UTC | #1
Hi Alexander,

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, June 1, 2022 6:44 AM
> To: dev@dpdk.org
> Subject: [PATCH v3 2/7] ethdev: allow meter color marker modification
> 
> 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 <akozyrev@nvidia.com>
> ---
>  doc/guides/rel_notes/release_22_07.rst | 1 +
>  lib/ethdev/rte_flow.h                  | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
> index c1804bc74f..451ff8d460 100644
> --- a/doc/guides/rel_notes/release_22_07.rst
> +++ b/doc/guides/rel_notes/release_22_07.rst
> @@ -72,6 +72,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.
> 
>  * **Updated Intel iavf driver.**
> 
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 75ec6621ac..68af109554 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3714,6 +3714,7 @@ enum rte_flow_field_id {
>  	RTE_FLOW_FIELD_META,		/**< Metadata value. */
>  	RTE_FLOW_FIELD_POINTER,		/**< Memory pointer. */
>  	RTE_FLOW_FIELD_VALUE,		/**< Immediate value. */
> +	RTE_FLOW_FIELD_METER_COLOR,	/**< Meter color marker. */
>  };
> 
>  /**
> --
> 2.18.2


Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
  
Andrew Rybchenko June 9, 2022, 12:18 p.m. UTC | #2
On 6/1/22 06:44, Alexander Kozyrev wrote:
> 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 <akozyrev@nvidia.com>

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  

Patch

diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index c1804bc74f..451ff8d460 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -72,6 +72,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.
 
 * **Updated Intel iavf driver.**
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 75ec6621ac..68af109554 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3714,6 +3714,7 @@  enum rte_flow_field_id {
 	RTE_FLOW_FIELD_META,		/**< Metadata value. */
 	RTE_FLOW_FIELD_POINTER,		/**< Memory pointer. */
 	RTE_FLOW_FIELD_VALUE,		/**< Immediate value. */
+	RTE_FLOW_FIELD_METER_COLOR,	/**< Meter color marker. */
 };
 
 /**