patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/2] net/mlx5: fix the checking for age action
@ 2021-05-11  4:24 Jiawei Wang
  2021-05-11  4:24 ` [dpdk-stable] [PATCH 2/2] net/mlx5: fix ASO age null context issue Jiawei Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jiawei Wang @ 2021-05-11  4:24 UTC (permalink / raw)
  To: matan, orika, viacheslavo, thomas, Shahaf Shuler, Dekel Peled
  Cc: dev, rasland, stable

Current the ASO age action was supported in the non-root table,
and the counter based age action was be used in the root table.

The FDB table skips group 0 on MLX5 PMD by adding implicit rule
that jump to non-root table, but PMD code use the original group
value for checking.

This patch uses the actual group value for age action checking,

Fixes: f9bc5274a6f9 ("net/mlx5: allow age modes combination")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 70e8d0b113..8eddd850f2 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -12252,12 +12252,16 @@ flow_dv_translate(struct rte_eth_dev *dev,
 				MLX5_FLOW_FATE_QUEUE;
 			break;
 		case MLX5_RTE_FLOW_ACTION_TYPE_AGE:
-			flow->age = (uint32_t)(uintptr_t)(action->conf);
-			age_act = flow_aso_age_get_by_idx(dev, flow->age);
-			__atomic_fetch_add(&age_act->refcnt, 1,
-					   __ATOMIC_RELAXED);
-			age_act_pos = actions_n++;
-			action_flags |= MLX5_FLOW_ACTION_AGE;
+			if (priv->sh->flow_hit_aso_en && (attr->group ||
+			    attr->transfer)) {
+				flow->age = (uint32_t)(uintptr_t)(action->conf);
+				age_act = flow_aso_age_get_by_idx(dev,
+								  flow->age);
+				__atomic_fetch_add(&age_act->refcnt, 1,
+						   __ATOMIC_RELAXED);
+				age_act_pos = actions_n++;
+				action_flags |= MLX5_FLOW_ACTION_AGE;
+			}
 			break;
 		case RTE_FLOW_ACTION_TYPE_AGE:
 			non_shared_age = action->conf;
@@ -12615,7 +12619,7 @@ flow_dv_translate(struct rte_eth_dev *dev,
 				if ((non_shared_age &&
 				     count && !count->shared) ||
 				    !(priv->sh->flow_hit_aso_en &&
-				      attr->group)) {
+				      dev_flow->dv.group)) {
 					/* Creates age by counters. */
 					cnt_act = flow_dv_prepare_counter
 								(dev, dev_flow,
@@ -12628,7 +12632,9 @@ flow_dv_translate(struct rte_eth_dev *dev,
 								cnt_act->action;
 					break;
 				}
-				if (!flow->age && non_shared_age) {
+				if (!flow->age && non_shared_age &&
+				    priv->sh->flow_hit_aso_en &&
+				    dev_flow->dv.group) {
 					flow->age =
 						flow_dv_translate_create_aso_age
 								(dev,
@@ -12641,6 +12647,8 @@ flow_dv_translate(struct rte_eth_dev *dev,
 						     NULL,
 						     "can't create ASO age action");
 				}
+				if (!flow->age)
+					return -rte_errno;
 				age_act = flow_aso_age_get_by_idx(dev,
 								  flow->age);
 				dev_flow->dv.actions[age_act_pos] =
-- 
2.18.1


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

end of thread, other threads:[~2021-05-12 12:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11  4:24 [dpdk-stable] [PATCH 1/2] net/mlx5: fix the checking for age action Jiawei Wang
2021-05-11  4:24 ` [dpdk-stable] [PATCH 2/2] net/mlx5: fix ASO age null context issue Jiawei Wang
2021-05-12 11:52 ` [dpdk-stable] [PATCH v2 1/2] net/mlx5: fix age action in transfer root group Jiawei Wang
2021-05-12 11:52   ` [dpdk-stable] [PATCH 1/2] net/mlx5: fix the checking for age action Jiawei Wang
2021-05-12 11:52   ` [dpdk-stable] [PATCH 2/2] net/mlx5: fix ASO age null context issue Jiawei Wang
2021-05-12 11:52   ` [dpdk-stable] [PATCH v2 2/2] net/mlx5: fix default context in flow age action Jiawei Wang
2021-05-12 12:09 ` [dpdk-stable] [PATCH v3 1/2] net/mlx5: fix age action in transfer root group Jiawei Wang
2021-05-12 12:09   ` [dpdk-stable] [PATCH v3 2/2] net/mlx5: fix default context in flow age action Jiawei Wang
2021-05-12 12:41     ` 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).