DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix drop action validation
@ 2022-11-10  6:59 Shun Hao
  2022-11-10 12:18 ` Raslan Darawsheh
  0 siblings, 1 reply; 3+ messages in thread
From: Shun Hao @ 2022-11-10  6:59 UTC (permalink / raw)
  To: viacheslavo, matan, orika; +Cc: dev, rasland, stable

Currently there's limitation for Drop action that can only co-exist with
Count action.

Sample and Age actions are also able to exist with Drop within the same
flow, and this patch includes them in the Drop action validation.

Fixes: acb67cc8 ("net/mlx5: fix action flag data type")
Cc: stable@dpdk.org

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.h    | 3 +++
 drivers/net/mlx5/mlx5_flow_dv.c | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 187e9a23bf..4375ad33bd 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -304,6 +304,9 @@ enum mlx5_feature_name {
 #define MLX5_FLOW_ACTION_INDIRECT_COUNT (1ull << 43)
 #define MLX5_FLOW_ACTION_INDIRECT_AGE (1ull << 44)
 
+#define MLX5_FLOW_DROP_INCLUSIVE_ACTIONS \
+	(MLX5_FLOW_ACTION_COUNT | MLX5_FLOW_ACTION_SAMPLE | MLX5_FLOW_ACTION_AGE)
+
 #define MLX5_FLOW_FATE_ACTIONS \
 	(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | \
 	 MLX5_FLOW_ACTION_RSS | MLX5_FLOW_ACTION_JUMP | \
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index d79dd8d5f0..bc9a75f225 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -8103,18 +8103,18 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 	/*
 	 * Validate the drop action mutual exclusion with other actions.
 	 * Drop action is mutually-exclusive with any other action, except for
-	 * Count action.
+	 * Count/Sample/Age actions.
 	 * Drop action compatibility with tunnel offload was already validated.
 	 */
 	if (action_flags & (MLX5_FLOW_ACTION_TUNNEL_MATCH |
 			    MLX5_FLOW_ACTION_TUNNEL_MATCH));
 	else if ((action_flags & MLX5_FLOW_ACTION_DROP) &&
-	    (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_COUNT)))
+	    (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_DROP_INCLUSIVE_ACTIONS)))
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 					  "Drop action is mutually-exclusive "
 					  "with any other action, except for "
-					  "Count action");
+					  "Count/Sample/Age action");
 	/* Eswitch has few restrictions on using items and actions */
 	if (attr->transfer) {
 		if (!mlx5_flow_ext_mreg_supported(dev) &&
-- 
2.20.0


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

* RE: [PATCH] net/mlx5: fix drop action validation
  2022-11-10  6:59 [PATCH] net/mlx5: fix drop action validation Shun Hao
@ 2022-11-10 12:18 ` Raslan Darawsheh
  2022-11-14 17:04   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Raslan Darawsheh @ 2022-11-10 12:18 UTC (permalink / raw)
  To: Shun Hao, Slava Ovsiienko, Matan Azrad, Ori Kam; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: Shun Hao <shunh@nvidia.com>
> Sent: Thursday, November 10, 2022 8:59 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix drop action validation
> 
> Currently there's limitation for Drop action that can only co-exist with
> Count action.
> 
> Sample and Age actions are also able to exist with Drop within the same
> flow, and this patch includes them in the Drop action validation.
> 
> Fixes: acb67cc8 ("net/mlx5: fix action flag data type")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shun Hao <shunh@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [PATCH] net/mlx5: fix drop action validation
  2022-11-10 12:18 ` Raslan Darawsheh
@ 2022-11-14 17:04   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2022-11-14 17:04 UTC (permalink / raw)
  To: Shun Hao, Matan Azrad
  Cc: Slava Ovsiienko, Ori Kam, dev, stable, Raslan Darawsheh

10/11/2022 13:18, Raslan Darawsheh:
> From: Shun Hao <shunh@nvidia.com>
> > Currently there's limitation for Drop action that can only co-exist with
> > Count action.
> > 
> > Sample and Age actions are also able to exist with Drop within the same
> > flow, and this patch includes them in the Drop action validation.
> > 
> > Fixes: acb67cc8 ("net/mlx5: fix action flag data type")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Shun Hao <shunh@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> 
> Patch applied to next-net-mlx,

Fixed the root cause while pulling:

Fixes: 70faf9ae0a29 ("net/mlx5: unify validation of drop action")

Please check the "Fixes" reference while reviewing.
Also, the commit ID should be 12 characters long.



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

end of thread, other threads:[~2022-11-14 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10  6:59 [PATCH] net/mlx5: fix drop action validation Shun Hao
2022-11-10 12:18 ` Raslan Darawsheh
2022-11-14 17:04   ` Thomas Monjalon

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).