[v5,2/2] ethdev: add indirect list METER_MARK update structures

Message ID 20230525081216.43604-2-getelson@nvidia.com (mailing list archive)
State Superseded, archived
Headers
Series ethdev: add indirect list flow action |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues
ci/intel-Functional success Functional PASS

Commit Message

Gregory Etelson May 25, 2023, 8:12 a.m. UTC
  In the indirect list API, update action and update flow contexts
are mutually exclusive.
The patch splits legacy METER_MASK update structure to support
indirect list API:

`struct rte_flow_indirect_update_action_meter_mark` defines METER_MARK
action context that is shared between all flows that reference a given
indirect list handle.

`struct rte_flow_indirect_update_flow_meter_mark` defines METER_MARK
context private to specific flow.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
 lib/ethdev/rte_flow.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
  

Comments

Ori Kam May 28, 2023, 2:07 p.m. UTC | #1
Hi Gregory,

> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Thursday, May 25, 2023 11:12 AM
> 
> In the indirect list API, update action and update flow contexts
> are mutually exclusive.
> The patch splits legacy METER_MASK update structure to support
> indirect list API:
> 
> `struct rte_flow_indirect_update_action_meter_mark` defines
> METER_MARK
> action context that is shared between all flows that reference a given
> indirect list handle.
> 
> `struct rte_flow_indirect_update_flow_meter_mark` defines METER_MARK
> context private to specific flow.
> 
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> ---
>  lib/ethdev/rte_flow.h | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index a0d01a97e7..ce1aa336f2 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3891,6 +3891,38 @@ struct rte_flow_update_meter_mark {
>  	uint32_t reserved:27;
>  };
> 
> +/**
> + * @see RTE_FLOW_ACTION_TYPE_METER_MARK
> + * @see RTE_FLOW_ACTION_TYPE_INDIRECT_LIST
> + *
> + * Update action mutable context.
> + */
> +struct rte_flow_indirect_update_action_meter_mark {
> +	/** New meter_mark parameters to be updated. */
> +	struct rte_flow_action_meter_mark meter_mark;
> +	/** The profile will be updated. */
> +	uint32_t profile_valid:1;
> +	/** The policy will be updated. */
> +	uint32_t policy_valid:1;
> +	/** The color mode will be updated. */
> +	uint32_t color_mode_valid:1;
> +	/** The meter state will be updated. */
> +	uint32_t state_valid:1;
> +	/** Reserved bits for the future usage. */
> +	uint32_t reserved:28;
> +};
> +

Why did you create new meter_mark structure?

> +/**
> + * @see RTE_FLOW_ACTION_TYPE_METER_MARK
> + * @see RTE_FLOW_ACTION_TYPE_INDIRECT_LIST
> + *
> + * Update flow mutable context.
> + */
> +struct rte_flow_indirect_update_flow_meter_mark {
> +	/** Updated init color applied to packet */
> +	enum rte_color init_color;
> +};
> +
>  /* Mbuf dynamic field offset for metadata. */
>  extern int32_t rte_flow_dynf_metadata_offs;
> 
> --
> 2.34.1

Best,
Ori
  
Gregory Etelson May 29, 2023, 4:03 a.m. UTC | #2
Hello Ori,

[snip]

> > +/**
> > + * @see RTE_FLOW_ACTION_TYPE_METER_MARK
> > + * @see RTE_FLOW_ACTION_TYPE_INDIRECT_LIST
> > + *
> > + * Update action mutable context.
> > + */
> > +struct rte_flow_indirect_update_action_meter_mark {
> > +	/** New meter_mark parameters to be updated. */
> > +	struct rte_flow_action_meter_mark meter_mark;
> > +	/** The profile will be updated. */
> > +	uint32_t profile_valid:1;
> > +	/** The policy will be updated. */
> > +	uint32_t policy_valid:1;
> > +	/** The color mode will be updated. */
> > +	uint32_t color_mode_valid:1;
> > +	/** The meter state will be updated. */
> > +	uint32_t state_valid:1;
> > +	/** Reserved bits for the future usage. */
> > +	uint32_t reserved:28;
> > +};
> > +
> 
> Why did you create new meter_mark structure?
> 


Fixed.

> > +/**
> > + * @see RTE_FLOW_ACTION_TYPE_METER_MARK
> > + * @see RTE_FLOW_ACTION_TYPE_INDIRECT_LIST
> > + *
> > + * Update flow mutable context.
> > + */
> > +struct rte_flow_indirect_update_flow_meter_mark {
> > +	/** Updated init color applied to packet */
> > +	enum rte_color init_color;
> > +};
> > +
> >  /* Mbuf dynamic field offset for metadata. */
> >  extern int32_t rte_flow_dynf_metadata_offs;
> >
> > --
> > 2.34.1
> 
> Best,
> Ori
  

Patch

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index a0d01a97e7..ce1aa336f2 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3891,6 +3891,38 @@  struct rte_flow_update_meter_mark {
 	uint32_t reserved:27;
 };
 
+/**
+ * @see RTE_FLOW_ACTION_TYPE_METER_MARK
+ * @see RTE_FLOW_ACTION_TYPE_INDIRECT_LIST
+ *
+ * Update action mutable context.
+ */
+struct rte_flow_indirect_update_action_meter_mark {
+	/** New meter_mark parameters to be updated. */
+	struct rte_flow_action_meter_mark meter_mark;
+	/** The profile will be updated. */
+	uint32_t profile_valid:1;
+	/** The policy will be updated. */
+	uint32_t policy_valid:1;
+	/** The color mode will be updated. */
+	uint32_t color_mode_valid:1;
+	/** The meter state will be updated. */
+	uint32_t state_valid:1;
+	/** Reserved bits for the future usage. */
+	uint32_t reserved:28;
+};
+
+/**
+ * @see RTE_FLOW_ACTION_TYPE_METER_MARK
+ * @see RTE_FLOW_ACTION_TYPE_INDIRECT_LIST
+ *
+ * Update flow mutable context.
+ */
+struct rte_flow_indirect_update_flow_meter_mark {
+	/** Updated init color applied to packet */
+	enum rte_color init_color;
+};
+
 /* Mbuf dynamic field offset for metadata. */
 extern int32_t rte_flow_dynf_metadata_offs;