patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix domains selection for meter policy
@ 2021-10-11  2:40 Li Zhang
  2021-10-14 12:17 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zhang @ 2021-10-11  2:40 UTC (permalink / raw)
  To: dekelp, orika, viacheslavo, matan; +Cc: dev, thomas, rasland, stable

Fate actions are different per domain.
When all the domains, ingress, egress and FDB (transfer),
can support all the policy actions, i.e. [SET_TAG],
the policy prepares resources for all the domains and
failure happens if one of the domains misses its fate action
in the policy action list.

Remove the domains missing their fate action
from the meter policy preparation.

Now, the policy will prepare a domain only when the domain supports
all the actions and when one of the domain fate actions is on the list.

Fixes: afb4aa4f ("net/mlx5: support meter policy operations")
Cc: stable@dpdk.org

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c6370cd1d6..ea737e3e35 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -17856,18 +17856,23 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,
 					"Doesn't support optional action");
 			}
 		}
-		if (action_flags[i] & MLX5_FLOW_ACTION_PORT_ID)
+		if (action_flags[i] & MLX5_FLOW_ACTION_PORT_ID) {
 			domain_color[i] = MLX5_MTR_DOMAIN_TRANSFER_BIT;
-		else if ((action_flags[i] &
+		} else if ((action_flags[i] &
 			  (MLX5_FLOW_ACTION_RSS | MLX5_FLOW_ACTION_QUEUE)) ||
-			 (action_flags[i] & MLX5_FLOW_ACTION_MARK))
+			  (action_flags[i] & MLX5_FLOW_ACTION_MARK)) {
 			/*
 			 * Only support MLX5_XMETA_MODE_LEGACY
 			 * so MARK action is only in ingress domain.
 			 */
 			domain_color[i] = MLX5_MTR_DOMAIN_INGRESS_BIT;
-		else
+		} else {
 			domain_color[i] = def_domain;
+			if (action_flags[i] &&
+			    !(action_flags[i] & MLX5_FLOW_FATE_ESWITCH_ACTIONS))
+				domain_color[i] &=
+				~MLX5_MTR_DOMAIN_TRANSFER_BIT;
+		}
 		if (action_flags[i] &
 		    MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY)
 			domain_color[i] &= hierarchy_domain;
-- 
2.27.0


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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix domains selection for meter policy
  2021-10-11  2:40 [dpdk-stable] [PATCH] net/mlx5: fix domains selection for meter policy Li Zhang
@ 2021-10-14 12:17 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2021-10-14 12:17 UTC (permalink / raw)
  To: Li Zhang, dekelp, Ori Kam, Slava Ovsiienko, Matan Azrad
  Cc: dev, NBU-Contact-Thomas Monjalon, stable

Hi,

> -----Original Message-----
> From: Li Zhang <lizh@nvidia.com>
> Sent: Monday, October 11, 2021 5:41 AM
> To: dekelp@nvidia.com; Ori Kam <orika@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix domains selection for meter policy
> 
> Fate actions are different per domain.
> When all the domains, ingress, egress and FDB (transfer),
> can support all the policy actions, i.e. [SET_TAG],
> the policy prepares resources for all the domains and
> failure happens if one of the domains misses its fate action
> in the policy action list.
> 
> Remove the domains missing their fate action
> from the meter policy preparation.
> 
> Now, the policy will prepare a domain only when the domain supports
> all the actions and when one of the domain fate actions is on the list.
> 
> Fixes: afb4aa4f ("net/mlx5: support meter policy operations")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Li Zhang <lizh@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2021-10-14 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  2:40 [dpdk-stable] [PATCH] net/mlx5: fix domains selection for meter policy Li Zhang
2021-10-14 12:17 ` Raslan Darawsheh

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git