Commit 3db55f8c authored by Vlad Dogaru's avatar Vlad Dogaru Committed by Jakub Kicinski
Browse files

net/mlx5: HWS, Export action STE tables to debugfs



Introduce a new type of dump object and dump all action STE tables,
along with information on their RTCs and STEs.

Signed-off-by: default avatarVlad Dogaru <vdogaru@nvidia.com>
Reviewed-by: default avatarHamdan Agbariya <hamdani@nvidia.com>
Reviewed-by: default avatarMark Bloch <mbloch@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarMichal Kubiak <michal.kubiak@intel.com>
Link: https://patch.msgid.link/1744312662-356571-13-git-send-email-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 864531ca
Loading
Loading
Loading
Loading
+35 −1
Original line number Diff line number Diff line
@@ -387,10 +387,41 @@ static int hws_debug_dump_context_stc(struct seq_file *f, struct mlx5hws_context
	return 0;
}

static void
hws_debug_dump_action_ste_table(struct seq_file *f,
				struct mlx5hws_action_ste_table *action_tbl)
{
	int ste_0_id = mlx5hws_pool_get_base_id(action_tbl->pool);
	int ste_1_id = mlx5hws_pool_get_base_mirror_id(action_tbl->pool);

	seq_printf(f, "%d,0x%llx,%d,%d,%d,%d\n",
		   MLX5HWS_DEBUG_RES_TYPE_ACTION_STE_TABLE,
		   HWS_PTR_TO_ID(action_tbl),
		   action_tbl->rtc_0_id, ste_0_id,
		   action_tbl->rtc_1_id, ste_1_id);
}

static void hws_debug_dump_action_ste_pool(struct seq_file *f,
					   struct mlx5hws_action_ste_pool *pool)
{
	struct mlx5hws_action_ste_table *action_tbl;
	enum mlx5hws_pool_optimize opt;

	mutex_lock(&pool->lock);
	for (opt = MLX5HWS_POOL_OPTIMIZE_NONE; opt < MLX5HWS_POOL_OPTIMIZE_MAX;
	     opt++) {
		list_for_each_entry(action_tbl, &pool->elems[opt].available,
				    list_node) {
			hws_debug_dump_action_ste_table(f, action_tbl);
		}
	}
	mutex_unlock(&pool->lock);
}

static int hws_debug_dump_context(struct seq_file *f, struct mlx5hws_context *ctx)
{
	struct mlx5hws_table *tbl;
	int ret;
	int ret, i;

	ret = hws_debug_dump_context_info(f, ctx);
	if (ret)
@@ -410,6 +441,9 @@ static int hws_debug_dump_context(struct seq_file *f, struct mlx5hws_context *ct
			return ret;
	}

	for (i = 0; i < ctx->queues; i++)
		hws_debug_dump_action_ste_pool(f, &ctx->action_ste_pool[i]);

	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ enum mlx5hws_debug_res_type {
	MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_HASH_DEFINER = 4205,
	MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_RANGE_DEFINER = 4206,
	MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_COMPARE_MATCH_DEFINER = 4207,

	MLX5HWS_DEBUG_RES_TYPE_ACTION_STE_TABLE = 4300,
};

static inline u64