drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c- Extension
.c- Size
- 16788 bytes
- Lines
- 735
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/slab.hlinux/debugfs.hmvpp2.hmvpp2_prs.hmvpp2_cls.h
Detected Declarations
struct mvpp2_dbgfs_prs_entrystruct mvpp2_dbgfs_c2_entrystruct mvpp2_dbgfs_flow_entrystruct mvpp2_dbgfs_flow_tbl_entrystruct mvpp2_dbgfs_port_flow_entrystruct mvpp2_dbgfs_entriesfunction mvpp2_dbgfs_flow_flt_hits_showfunction mvpp2_dbgfs_flow_dec_hits_showfunction mvpp2_dbgfs_flow_type_showfunction mvpp2_dbgfs_flow_id_showfunction mvpp2_dbgfs_port_flow_hash_opt_showfunction mvpp2_dbgfs_port_flow_engine_showfunction mvpp2_dbgfs_flow_c2_hits_showfunction mvpp2_dbgfs_flow_c2_rxq_showfunction mvpp2_dbgfs_flow_c2_enable_showfunction mvpp2_dbgfs_port_vid_showfunction mvpp2_dbgfs_port_parser_showfunction mvpp2_dbgfs_filter_showfunction mvpp2_dbgfs_prs_lu_showfunction mvpp2_dbgfs_prs_pmap_showfunction mvpp2_dbgfs_prs_ai_showfunction mvpp2_dbgfs_prs_hdata_showfunction mvpp2_dbgfs_prs_sram_showfunction mvpp2_dbgfs_prs_hits_showfunction mvpp2_dbgfs_prs_valid_showfunction mvpp2_dbgfs_flow_port_initfunction mvpp2_dbgfs_flow_entry_initfunction mvpp2_dbgfs_flow_initfunction mvpp2_dbgfs_prs_entry_initfunction mvpp2_dbgfs_prs_initfunction mvpp2_dbgfs_c2_entry_initfunction mvpp2_dbgfs_flow_tbl_entry_initfunction mvpp2_dbgfs_cls_initfunction mvpp2_dbgfs_port_initfunction mvpp2_dbgfs_exitfunction mvpp2_dbgfs_cleanupfunction mvpp2_dbgfs_init
Annotated Snippet
struct mvpp2_dbgfs_prs_entry {
int tid;
struct mvpp2 *priv;
};
struct mvpp2_dbgfs_c2_entry {
int id;
struct mvpp2 *priv;
};
struct mvpp2_dbgfs_flow_entry {
int flow;
struct mvpp2 *priv;
};
struct mvpp2_dbgfs_flow_tbl_entry {
int id;
struct mvpp2 *priv;
};
struct mvpp2_dbgfs_port_flow_entry {
struct mvpp2_port *port;
struct mvpp2_dbgfs_flow_entry *dbg_fe;
};
struct mvpp2_dbgfs_entries {
/* Entries for Header Parser debug info */
struct mvpp2_dbgfs_prs_entry prs_entries[MVPP2_PRS_TCAM_SRAM_SIZE];
/* Entries for Classifier C2 engine debug info */
struct mvpp2_dbgfs_c2_entry c2_entries[MVPP22_CLS_C2_N_ENTRIES];
/* Entries for Classifier Flow Table debug info */
struct mvpp2_dbgfs_flow_tbl_entry flt_entries[MVPP2_CLS_FLOWS_TBL_SIZE];
/* Entries for Classifier flows debug info */
struct mvpp2_dbgfs_flow_entry flow_entries[MVPP2_N_PRS_FLOWS];
/* Entries for per-port flows debug info */
struct mvpp2_dbgfs_port_flow_entry port_flow_entries[MVPP2_MAX_PORTS];
};
static int mvpp2_dbgfs_flow_flt_hits_show(struct seq_file *s, void *unused)
{
struct mvpp2_dbgfs_flow_tbl_entry *entry = s->private;
u32 hits = mvpp2_cls_flow_hits(entry->priv, entry->id);
seq_printf(s, "%u\n", hits);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(mvpp2_dbgfs_flow_flt_hits);
static int mvpp2_dbgfs_flow_dec_hits_show(struct seq_file *s, void *unused)
{
struct mvpp2_dbgfs_flow_entry *entry = s->private;
u32 hits = mvpp2_cls_lookup_hits(entry->priv, entry->flow);
seq_printf(s, "%u\n", hits);
return 0;
}
DEFINE_SHOW_ATTRIBUTE(mvpp2_dbgfs_flow_dec_hits);
static int mvpp2_dbgfs_flow_type_show(struct seq_file *s, void *unused)
{
struct mvpp2_dbgfs_flow_entry *entry = s->private;
const struct mvpp2_cls_flow *f;
const char *flow_name;
f = mvpp2_cls_flow_get(entry->flow);
if (!f)
return -EINVAL;
switch (f->flow_type) {
case IPV4_FLOW:
flow_name = "ipv4";
break;
case IPV6_FLOW:
flow_name = "ipv6";
break;
case TCP_V4_FLOW:
flow_name = "tcp4";
break;
case TCP_V6_FLOW:
flow_name = "tcp6";
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/slab.h`, `linux/debugfs.h`, `mvpp2.h`, `mvpp2_prs.h`, `mvpp2_cls.h`.
- Detected declarations: `struct mvpp2_dbgfs_prs_entry`, `struct mvpp2_dbgfs_c2_entry`, `struct mvpp2_dbgfs_flow_entry`, `struct mvpp2_dbgfs_flow_tbl_entry`, `struct mvpp2_dbgfs_port_flow_entry`, `struct mvpp2_dbgfs_entries`, `function mvpp2_dbgfs_flow_flt_hits_show`, `function mvpp2_dbgfs_flow_dec_hits_show`, `function mvpp2_dbgfs_flow_type_show`, `function mvpp2_dbgfs_flow_id_show`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.