DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: allow jump to current group
@ 2023-11-13 10:43 Michael Baum
  2023-11-14  8:29 ` Raslan Darawsheh
  2023-11-27 12:42 ` [PATCH v2] net/mlx5: fix jump action validation Michael Baum
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Baum @ 2023-11-13 10:43 UTC (permalink / raw)
  To: dev
  Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou

In current implementation, jump action is allowed only if target
group is different than the current flow group.

Change jump action validation such that it allows jump to current group.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9753af2cb1..0d5bf92320 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5480,13 +5480,6 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
 				       &grp_info, error);
 	if (ret)
 		return ret;
-	if (attributes->group == target_group &&
-	    !(action_flags & (MLX5_FLOW_ACTION_TUNNEL_SET |
-			      MLX5_FLOW_ACTION_TUNNEL_MATCH)))
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
-					  "target group must be other than"
-					  " the current flow group");
 	if (table == 0)
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net/mlx5: allow jump to current group
  2023-11-13 10:43 [PATCH] net/mlx5: allow jump to current group Michael Baum
@ 2023-11-14  8:29 ` Raslan Darawsheh
  2023-11-27 12:42 ` [PATCH v2] net/mlx5: fix jump action validation Michael Baum
  1 sibling, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2023-11-14  8:29 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: Matan Azrad, Slava Ovsiienko, Ori Kam, Suanming Mou

Hi Michael,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Monday, November 13, 2023 12:44 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam
> <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>
> Subject: [PATCH] net/mlx5: allow jump to current group
I think this is a fix 
> 
> In current implementation, jump action is allowed only if target
> group is different than the current flow group.
> 
> Change jump action validation such that it allows jump to current group.
also don't forget to add Fixes tag
You should have a Cc: stable@dpdk.org

Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] net/mlx5: fix jump action validation
  2023-11-13 10:43 [PATCH] net/mlx5: allow jump to current group Michael Baum
  2023-11-14  8:29 ` Raslan Darawsheh
@ 2023-11-27 12:42 ` Michael Baum
  2024-01-07 12:35   ` Raslan Darawsheh
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Baum @ 2023-11-27 12:42 UTC (permalink / raw)
  To: dev
  Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko, Ori Kam,
	Suanming Mou, dekelp, stable

Currently PMD doesn't allow to jump to the same group in order to
avoid dead loop. But this also prevent experienced user to create
flow with less Hops in order to have better performance.

For example, rules in [1] should have better performance then [2].

Furthermore, this protection will not really prevent dead loop, i.e
[3]. So just remove this protection and user should take the
responsibility to avoid dead loop.

This patch enables jumping to the same group.

[1]:
flow create 0 group 1 priority 1 pattern eth / ipv4 / udp / gtp / end
actions raw_decap / raw_encap / jump group 1 / end
flow create 0 group 1 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
/ end actions queues index 1 / end

[2]:
flow create 0 group 1 priority 0 pattern eth / ipv4 / udp / gtp / end
actions raw_decap / raw_encap / jump group 2 / end
flow create 0 group 2 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
/ end actions queues index 1 / end

[3]:
flow create 0 group 1 pattern eth / end actions jump group 2 / end
flow create 0 group 2 pattern eth / end actions jump group 1 / end

Fixes: f78f747f41d0 ("net/mlx5: allow jump to group lower than current")
Cc: dekelp@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---

V2: change commit message to fix template.

 drivers/net/mlx5/mlx5_flow_dv.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 115d730317..5d0cb4278b 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5484,13 +5484,6 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
 				       &grp_info, error);
 	if (ret)
 		return ret;
-	if (attributes->group == target_group &&
-	    !(action_flags & (MLX5_FLOW_ACTION_TUNNEL_SET |
-			      MLX5_FLOW_ACTION_TUNNEL_MATCH)))
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
-					  "target group must be other than"
-					  " the current flow group");
 	if (table == 0)
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] net/mlx5: fix jump action validation
  2023-11-27 12:42 ` [PATCH v2] net/mlx5: fix jump action validation Michael Baum
@ 2024-01-07 12:35   ` Raslan Darawsheh
  0 siblings, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2024-01-07 12:35 UTC (permalink / raw)
  To: Michael Baum, dev
  Cc: Matan Azrad, Slava Ovsiienko, Ori Kam, Suanming Mou, dekelp, stable

Hi,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Monday, November 27, 2023 2:43 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam
> <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>;
> dekelp@mellanox.com; stable@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix jump action validation
> 
> Currently PMD doesn't allow to jump to the same group in order to
> avoid dead loop. But this also prevent experienced user to create
> flow with less Hops in order to have better performance.
> 
> For example, rules in [1] should have better performance then [2].
> 
> Furthermore, this protection will not really prevent dead loop, i.e
> [3]. So just remove this protection and user should take the
> responsibility to avoid dead loop.
> 
> This patch enables jumping to the same group.
> 
> [1]:
> flow create 0 group 1 priority 1 pattern eth / ipv4 / udp / gtp / end
> actions raw_decap / raw_encap / jump group 1 / end
> flow create 0 group 1 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
> / end actions queues index 1 / end
> 
> [2]:
> flow create 0 group 1 priority 0 pattern eth / ipv4 / udp / gtp / end
> actions raw_decap / raw_encap / jump group 2 / end
> flow create 0 group 2 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
> / end actions queues index 1 / end
> 
> [3]:
> flow create 0 group 1 pattern eth / end actions jump group 2 / end
> flow create 0 group 2 pattern eth / end actions jump group 1 / end
> 
> Fixes: f78f747f41d0 ("net/mlx5: allow jump to group lower than current")
> Cc: dekelp@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
> 
> V2: change commit message to fix template. 
 
Patch applied to next-net-mlx, 
Kindest regards
Raslan Darawsheh 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-07 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-13 10:43 [PATCH] net/mlx5: allow jump to current group Michael Baum
2023-11-14  8:29 ` Raslan Darawsheh
2023-11-27 12:42 ` [PATCH v2] net/mlx5: fix jump action validation Michael Baum
2024-01-07 12:35   ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).