[v2,03/16] net/mlx5/hws: add mlx5dr DevX object struct to mlx5dr action

Message ID 20231016184235.200427-3-getelson@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: support indirect list actions |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Gregory Etelson Oct. 16, 2023, 6:42 p.m. UTC
  From: Hamdan Igbaria <hamdani@nvidia.com>

Add mlx5dr_devx_obj struct to mlx5dr_action, so we could hold
the FT obj in dest table action.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 4 ++++
 drivers/net/mlx5/hws/mlx5dr_action.h | 3 +++
 drivers/net/mlx5/hws/mlx5dr_table.c  | 1 -
 3 files changed, 7 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index ea9fc23732..55ec4f71c9 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -787,6 +787,8 @@  mlx5dr_action_create_dest_table(struct mlx5dr_context *ctx,
 		ret = mlx5dr_action_create_stcs(action, tbl->ft);
 		if (ret)
 			goto free_action;
+
+		action->devx_dest.devx_obj = tbl->ft;
 	}
 
 	return action;
@@ -864,6 +866,8 @@  mlx5dr_action_create_dest_tir(struct mlx5dr_context *ctx,
 		ret = mlx5dr_action_create_stcs(action, cur_obj);
 		if (ret)
 			goto clean_obj;
+
+		action->devx_dest.devx_obj = cur_obj;
 	}
 
 	return action;
diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h
index 314e289780..104c6880c1 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.h
+++ b/drivers/net/mlx5/hws/mlx5dr_action.h
@@ -148,6 +148,9 @@  struct mlx5dr_action {
 				struct {
 					struct mlx5dv_steering_anchor *sa;
 				} root_tbl;
+				struct {
+					struct mlx5dr_devx_obj *devx_obj;
+				} devx_dest;
 			};
 		};
 
diff --git a/drivers/net/mlx5/hws/mlx5dr_table.c b/drivers/net/mlx5/hws/mlx5dr_table.c
index e1150cd75d..91eb92db78 100644
--- a/drivers/net/mlx5/hws/mlx5dr_table.c
+++ b/drivers/net/mlx5/hws/mlx5dr_table.c
@@ -68,7 +68,6 @@  static void mlx5dr_table_down_default_fdb_miss_tbl(struct mlx5dr_table *tbl)
 		return;
 
 	mlx5dr_cmd_forward_tbl_destroy(default_miss);
-
 	ctx->common_res[tbl_type].default_miss = NULL;
 }