Skip to content

Commit 3db55f8

Browse files
ddvladkuba-moo
authored andcommitted
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: Vlad Dogaru <[email protected]> Reviewed-by: Hamdan Agbariya <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Michal Kubiak <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 864531c commit 3db55f8

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,41 @@ static int hws_debug_dump_context_stc(struct seq_file *f, struct mlx5hws_context
387387
return 0;
388388
}
389389

390+
static void
391+
hws_debug_dump_action_ste_table(struct seq_file *f,
392+
struct mlx5hws_action_ste_table *action_tbl)
393+
{
394+
int ste_0_id = mlx5hws_pool_get_base_id(action_tbl->pool);
395+
int ste_1_id = mlx5hws_pool_get_base_mirror_id(action_tbl->pool);
396+
397+
seq_printf(f, "%d,0x%llx,%d,%d,%d,%d\n",
398+
MLX5HWS_DEBUG_RES_TYPE_ACTION_STE_TABLE,
399+
HWS_PTR_TO_ID(action_tbl),
400+
action_tbl->rtc_0_id, ste_0_id,
401+
action_tbl->rtc_1_id, ste_1_id);
402+
}
403+
404+
static void hws_debug_dump_action_ste_pool(struct seq_file *f,
405+
struct mlx5hws_action_ste_pool *pool)
406+
{
407+
struct mlx5hws_action_ste_table *action_tbl;
408+
enum mlx5hws_pool_optimize opt;
409+
410+
mutex_lock(&pool->lock);
411+
for (opt = MLX5HWS_POOL_OPTIMIZE_NONE; opt < MLX5HWS_POOL_OPTIMIZE_MAX;
412+
opt++) {
413+
list_for_each_entry(action_tbl, &pool->elems[opt].available,
414+
list_node) {
415+
hws_debug_dump_action_ste_table(f, action_tbl);
416+
}
417+
}
418+
mutex_unlock(&pool->lock);
419+
}
420+
390421
static int hws_debug_dump_context(struct seq_file *f, struct mlx5hws_context *ctx)
391422
{
392423
struct mlx5hws_table *tbl;
393-
int ret;
424+
int ret, i;
394425

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

444+
for (i = 0; i < ctx->queues; i++)
445+
hws_debug_dump_action_ste_pool(f, &ctx->action_ste_pool[i]);
446+
413447
return 0;
414448
}
415449

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ enum mlx5hws_debug_res_type {
2626
MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_HASH_DEFINER = 4205,
2727
MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_RANGE_DEFINER = 4206,
2828
MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_COMPARE_MATCH_DEFINER = 4207,
29+
30+
MLX5HWS_DEBUG_RES_TYPE_ACTION_STE_TABLE = 4300,
2931
};
3032

3133
static inline u64

0 commit comments

Comments
 (0)