[v4,1/3] ethdev: add flow rule group description

Message ID 20230118154447.595231-2-rongweil@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series add API for live migration |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Rongwei Liu Jan. 18, 2023, 3:44 p.m. UTC
  Add more sentences to describe the group concepts
and define group 0 as root group for traffic to search a
hit rule.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
---
 lib/ethdev/rte_flow.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
  

Comments

Ori Kam Jan. 31, 2023, 11:53 a.m. UTC | #1
Hi Rongwei,

> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: Wednesday, 18 January 2023 17:45
> 
> Add more sentences to describe the group concepts
> and define group 0 as root group for traffic to search a
> hit rule.
> 
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> ---
>  lib/ethdev/rte_flow.h | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index b60987db4b..e71ac0c199 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -86,7 +86,18 @@ extern "C" {
>   * but may be valid in a few cases.
>   */
>  struct rte_flow_attr {
> -	uint32_t group; /**< Priority group. */
> +	/**
> +	 * A group is a superset of multiple rules.
> +	 * The default group is 0 and is processed for all packets.
> +	 * The group 0 of bifurcated drivers is shared with the kernel.
> +	 * Rules in other groups are processed only if the group is chained
> +	 * by a jump action from a previously matched rule.
> +	 * It means the group hierarchy is made by the flow rules,
> +	 * and the group 0 is the hierarchy root.
> +	 * Note there is no automatic dead loop protection.
> +	 * @see rte_flow_action_jump
> +	 */
> +	uint32_t group;
>  	uint32_t priority; /**< Rule priority level within group. */
>  	/**
>  	 * The rule in question applies to ingress traffic (non-"transfer").
> --
> 2.27.0

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
  
Rongwei Liu Feb. 6, 2023, 12:15 p.m. UTC | #2
HI:
Andrew, Thomas, Ferruh, are we good with this commit. Can you share some comments?
We still need this one after moving live migration API to MLX private.

BR
Rongwei

> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Tuesday, January 31, 2023 19:53
> To: Rongwei Liu <rongweil@nvidia.com>; dev@dpdk.org; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; NBU-
> Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> jerinjacobk@gmail.com; stephen@networkplumber.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; Ferruh Yigit
> <ferruh.yigit@amd.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>
> Subject: RE: [PATCH v4 1/3] ethdev: add flow rule group description
> 
> Hi Rongwei,
> 
> > -----Original Message-----
> > From: Rongwei Liu <rongweil@nvidia.com>
> > Sent: Wednesday, 18 January 2023 17:45
> >
> > Add more sentences to describe the group concepts and define group 0
> > as root group for traffic to search a hit rule.
> >
> > Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> > ---
> >  lib/ethdev/rte_flow.h | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> > b60987db4b..e71ac0c199 100644
> > --- a/lib/ethdev/rte_flow.h
> > +++ b/lib/ethdev/rte_flow.h
> > @@ -86,7 +86,18 @@ extern "C" {
> >   * but may be valid in a few cases.
> >   */
> >  struct rte_flow_attr {
> > -	uint32_t group; /**< Priority group. */
> > +	/**
> > +	 * A group is a superset of multiple rules.
> > +	 * The default group is 0 and is processed for all packets.
> > +	 * The group 0 of bifurcated drivers is shared with the kernel.
> > +	 * Rules in other groups are processed only if the group is chained
> > +	 * by a jump action from a previously matched rule.
> > +	 * It means the group hierarchy is made by the flow rules,
> > +	 * and the group 0 is the hierarchy root.
> > +	 * Note there is no automatic dead loop protection.
> > +	 * @see rte_flow_action_jump
> > +	 */
> > +	uint32_t group;
> >  	uint32_t priority; /**< Rule priority level within group. */
> >  	/**
> >  	 * The rule in question applies to ingress traffic (non-"transfer").
> > --
> > 2.27.0
> 
> Acked-by: Ori Kam <orika@nvidia.com>
> Best,
> Ori
  

Patch

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..e71ac0c199 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -86,7 +86,18 @@  extern "C" {
  * but may be valid in a few cases.
  */
 struct rte_flow_attr {
-	uint32_t group; /**< Priority group. */
+	/**
+	 * A group is a superset of multiple rules.
+	 * The default group is 0 and is processed for all packets.
+	 * The group 0 of bifurcated drivers is shared with the kernel.
+	 * Rules in other groups are processed only if the group is chained
+	 * by a jump action from a previously matched rule.
+	 * It means the group hierarchy is made by the flow rules,
+	 * and the group 0 is the hierarchy root.
+	 * Note there is no automatic dead loop protection.
+	 * @see rte_flow_action_jump
+	 */
+	uint32_t group;
 	uint32_t priority; /**< Rule priority level within group. */
 	/**
 	 * The rule in question applies to ingress traffic (non-"transfer").