| 293 | } |
| 294 | |
| 295 | static int mlx5dr_debug_dump_table(FILE *f, struct mlx5dr_table *tbl) |
| 296 | { |
| 297 | bool is_shared = mlx5dr_context_shared_gvmi_used(tbl->ctx); |
| 298 | bool is_root = tbl->level == MLX5DR_ROOT_LEVEL; |
| 299 | struct mlx5dr_cmd_ft_query_attr ft_attr = {0}; |
| 300 | struct mlx5dr_matcher *matcher; |
| 301 | uint64_t local_icm_addr_0 = 0; |
| 302 | uint64_t local_icm_addr_1 = 0; |
| 303 | uint64_t icm_addr_0 = 0; |
| 304 | uint64_t icm_addr_1 = 0; |
| 305 | int ret; |
| 306 | |
| 307 | ret = fprintf(f, "%d,0x%" PRIx64 ",0x%" PRIx64 ",%d,%d,%d,%d,%d", |
| 308 | MLX5DR_DEBUG_RES_TYPE_TABLE, |
| 309 | (uint64_t)(uintptr_t)tbl, |
| 310 | (uint64_t)(uintptr_t)tbl->ctx, |
| 311 | is_root ? 0 : tbl->ft->id, |
| 312 | tbl->type, |
| 313 | is_root ? 0 : tbl->fw_ft_type, |
| 314 | tbl->level, |
| 315 | is_shared && !is_root ? tbl->local_ft->id : 0); |
| 316 | if (ret < 0) |
| 317 | goto out_err; |
| 318 | |
| 319 | if (!is_root) { |
| 320 | ft_attr.type = tbl->fw_ft_type; |
| 321 | ret = mlx5dr_cmd_flow_table_query(tbl->ft, |
| 322 | &ft_attr, |
| 323 | &icm_addr_0, |
| 324 | &icm_addr_1); |
| 325 | if (ret) |
| 326 | return ret; |
| 327 | |
| 328 | if (is_shared) { |
| 329 | ft_attr.type = tbl->fw_ft_type; |
| 330 | ret = mlx5dr_cmd_flow_table_query(tbl->local_ft, |
| 331 | &ft_attr, |
| 332 | &local_icm_addr_0, |
| 333 | &local_icm_addr_1); |
| 334 | if (ret) |
| 335 | return ret; |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | ret = fprintf(f, ",0x%" PRIx64 ",0x%" PRIx64 ",0x%" PRIx64 ",0x%" PRIx64 ",0x%" PRIx64 "\n", |
| 340 | mlx5dr_debug_icm_to_idx(icm_addr_0), |
| 341 | mlx5dr_debug_icm_to_idx(icm_addr_1), |
| 342 | mlx5dr_debug_icm_to_idx(local_icm_addr_0), |
| 343 | mlx5dr_debug_icm_to_idx(local_icm_addr_1), |
| 344 | (uint64_t)(uintptr_t)tbl->default_miss.miss_tbl); |
| 345 | if (ret < 0) |
| 346 | goto out_err; |
| 347 | |
| 348 | LIST_FOREACH(matcher, &tbl->head, next) { |
| 349 | ret = mlx5dr_debug_dump_matcher(f, matcher); |
| 350 | if (ret) |
| 351 | return ret; |
| 352 | } |
no test coverage detected