drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c- Extension
.c- Size
- 19989 bytes
- Lines
- 775
- 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/ethtool.hlinux/vmalloc.hnfp_asm.hnfp_main.hnfpcore/nfp.hnfpcore/nfp_nffw.hnfpcore/nfp6000/nfp6000.h
Detected Declarations
struct nfp_dump_tlstruct nfp_dumpspec_cpp_isl_idstruct nfp_dump_common_cppstruct nfp_dumpspec_csrstruct nfp_dumpspec_rtsymstruct nfp_dump_csrstruct nfp_dump_rtsymstruct nfp_dump_prologstruct nfp_dump_errorstruct nfp_level_sizestruct nfp_dump_stateenum nfp_dumpspec_typefunction nfp_traverse_tlvsfunction nfp_get_numeric_cpp_idfunction nfp_net_dump_load_dumpspecfunction nfp_dump_error_tlv_sizefunction nfp_calc_fwname_tlv_sizefunction nfp_calc_hwinfo_field_szfunction nfp_csr_spec_validfunction nfp_calc_rtsym_dump_szfunction nfp_add_tlv_sizefunction nfp_calc_specific_level_sizefunction nfp_net_dump_calculate_sizefunction nfp_add_tlvfunction nfp_dump_error_tlvfunction nfp_dump_fwnamefunction nfp_dump_hwinfofunction nfp_dump_hwinfo_fieldfunction is_xpb_readfunction nfp_dump_csr_rangefunction nfp_read_indirect_csrfunction nfp_read_all_indirect_csr_ctxfunction nfp_dump_indirect_csr_rangefunction nfp_dump_single_rtsymfunction nfp_dump_for_tlvfunction nfp_dump_specific_levelfunction nfp_dump_populate_prologfunction nfp_net_dump_populate_buffer
Annotated Snippet
struct nfp_dump_tl {
/* New members must be added within the struct_group() macro below. */
struct_group_tagged(nfp_dump_tl_hdr, hdr,
__be32 type;
__be32 length; /* chunk length to follow, aligned to 8 bytes */
);
char data[];
};
static_assert(offsetof(struct nfp_dump_tl, data) == sizeof(struct nfp_dump_tl_hdr),
"struct member likely outside of struct_group_tagged()");
/* NFP CPP parameters */
struct nfp_dumpspec_cpp_isl_id {
u8 target;
u8 action;
u8 token;
u8 island;
};
struct nfp_dump_common_cpp {
struct nfp_dumpspec_cpp_isl_id cpp_id;
__be32 offset; /* address to start dump */
__be32 dump_length; /* total bytes to dump, aligned to reg size */
};
/* CSR dumpables */
struct nfp_dumpspec_csr {
struct nfp_dump_tl_hdr tl;
struct nfp_dump_common_cpp cpp;
__be32 register_width; /* in bits */
};
struct nfp_dumpspec_rtsym {
struct nfp_dump_tl_hdr tl;
char rtsym[];
};
/* header for register dumpable */
struct nfp_dump_csr {
struct nfp_dump_tl_hdr tl;
struct nfp_dump_common_cpp cpp;
__be32 register_width; /* in bits */
__be32 error; /* error code encountered while reading */
__be32 error_offset; /* offset being read when error occurred */
};
struct nfp_dump_rtsym {
struct nfp_dump_tl_hdr tl;
struct nfp_dump_common_cpp cpp;
__be32 error; /* error code encountered while reading */
u8 padded_name_length; /* pad so data starts at 8 byte boundary */
char rtsym[];
/* after padded_name_length, there is dump_length data */
};
struct nfp_dump_prolog {
struct nfp_dump_tl_hdr tl;
__be32 dump_level;
};
struct nfp_dump_error {
struct nfp_dump_tl_hdr tl;
__be32 error;
char padding[4];
char spec[];
};
/* to track state through debug size calculation TLV traversal */
struct nfp_level_size {
__be32 requested_level; /* input */
u32 total_size; /* output */
};
/* to track state during debug dump creation TLV traversal */
struct nfp_dump_state {
__be32 requested_level; /* input param */
u32 dumped_size; /* adds up to size of dumped data */
u32 buf_size; /* size of buffer pointer to by p */
void *p; /* current point in dump buffer */
};
typedef int (*nfp_tlv_visit)(struct nfp_pf *pf, struct nfp_dump_tl *tl,
void *param);
static int
nfp_traverse_tlvs(struct nfp_pf *pf, void *data, u32 data_length, void *param,
nfp_tlv_visit tlv_visit)
{
long long remaining = data_length;
struct nfp_dump_tl *tl;
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/vmalloc.h`, `nfp_asm.h`, `nfp_main.h`, `nfpcore/nfp.h`, `nfpcore/nfp_nffw.h`, `nfpcore/nfp6000/nfp6000.h`.
- Detected declarations: `struct nfp_dump_tl`, `struct nfp_dumpspec_cpp_isl_id`, `struct nfp_dump_common_cpp`, `struct nfp_dumpspec_csr`, `struct nfp_dumpspec_rtsym`, `struct nfp_dump_csr`, `struct nfp_dump_rtsym`, `struct nfp_dump_prolog`, `struct nfp_dump_error`, `struct nfp_level_size`.
- 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.