drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c- Extension
.c- Size
- 12209 bytes
- Lines
- 488
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/kernel.hlinux/seq_file.hlinux/version.hinternal.h
Detected Declarations
function hws_debug_dump_matcher_template_definerfunction hws_debug_dump_matcher_match_templatefunction hws_debug_dump_matcher_action_templatefunction hws_debug_dump_matcher_attrfunction hws_debug_dump_matcherfunction hws_debug_dump_tablefunction list_for_each_entryfunction hws_debug_dump_context_send_enginefunction hws_debug_dump_context_capsfunction hws_debug_dump_context_attrfunction hws_debug_dump_context_infofunction hws_debug_dump_context_stc_resourcefunction hws_debug_dump_context_stcfunction hws_debug_dump_action_ste_tablefunction hws_debug_dump_action_ste_poolfunction list_for_each_entryfunction hws_debug_dump_contextfunction list_for_each_entryfunction hws_debug_dumpfunction hws_dump_showfunction mlx5hws_debug_init_dumpfunction mlx5hws_debug_uninit_dump
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
/* Copyright (c) 2024 NVIDIA Corporation & Affiliates */
#include <linux/debugfs.h>
#include <linux/kernel.h>
#include <linux/seq_file.h>
#include <linux/version.h>
#include "internal.h"
static int
hws_debug_dump_matcher_template_definer(struct seq_file *f,
void *parent_obj,
struct mlx5hws_definer *definer,
enum mlx5hws_debug_res_type type)
{
int i;
if (!definer)
return 0;
seq_printf(f, "%d,0x%llx,0x%llx,%d,%d,",
type,
HWS_PTR_TO_ID(definer),
HWS_PTR_TO_ID(parent_obj),
definer->obj_id,
definer->type);
for (i = 0; i < DW_SELECTORS; i++)
seq_printf(f, "0x%x%s", definer->dw_selector[i],
(i == DW_SELECTORS - 1) ? "," : "-");
for (i = 0; i < BYTE_SELECTORS; i++)
seq_printf(f, "0x%x%s", definer->byte_selector[i],
(i == BYTE_SELECTORS - 1) ? "," : "-");
for (i = 0; i < MLX5HWS_JUMBO_TAG_SZ; i++)
seq_printf(f, "%02x", definer->mask.jumbo[i]);
seq_puts(f, "\n");
return 0;
}
static int
hws_debug_dump_matcher_match_template(struct seq_file *f, struct mlx5hws_matcher *matcher)
{
enum mlx5hws_debug_res_type type;
int i, ret;
for (i = 0; i < matcher->num_of_mt; i++) {
struct mlx5hws_match_template *mt = &matcher->mt[i];
seq_printf(f, "%d,0x%llx,0x%llx,%d,%d,%d\n",
MLX5HWS_DEBUG_RES_TYPE_MATCHER_MATCH_TEMPLATE,
HWS_PTR_TO_ID(mt),
HWS_PTR_TO_ID(matcher),
mt->fc_sz,
0, 0);
type = MLX5HWS_DEBUG_RES_TYPE_MATCHER_TEMPLATE_MATCH_DEFINER;
ret = hws_debug_dump_matcher_template_definer(f, mt, mt->definer, type);
if (ret)
return ret;
}
return 0;
}
static int
hws_debug_dump_matcher_action_template(struct seq_file *f, struct mlx5hws_matcher *matcher)
{
enum mlx5hws_action_type action_type;
int i, j;
for (i = 0; i < matcher->num_of_at; i++) {
struct mlx5hws_action_template *at = &matcher->at[i];
seq_printf(f, "%d,0x%llx,0x%llx,%d,%d,%d",
MLX5HWS_DEBUG_RES_TYPE_MATCHER_ACTION_TEMPLATE,
HWS_PTR_TO_ID(at),
HWS_PTR_TO_ID(matcher),
at->only_term,
at->num_of_action_stes,
at->num_actions);
for (j = 0; j < at->num_actions; j++) {
action_type = at->action_type_arr[j];
seq_printf(f, ",%s", mlx5hws_action_type_to_str(action_type));
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/kernel.h`, `linux/seq_file.h`, `linux/version.h`, `internal.h`.
- Detected declarations: `function hws_debug_dump_matcher_template_definer`, `function hws_debug_dump_matcher_match_template`, `function hws_debug_dump_matcher_action_template`, `function hws_debug_dump_matcher_attr`, `function hws_debug_dump_matcher`, `function hws_debug_dump_table`, `function list_for_each_entry`, `function hws_debug_dump_context_send_engine`, `function hws_debug_dump_context_caps`, `function hws_debug_dump_context_attr`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.