drivers/infiniband/hw/ionic/ionic_hw_stats.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/ionic/ionic_hw_stats.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/ionic/ionic_hw_stats.c- Extension
.c- Size
- 11772 bytes
- Lines
- 481
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/dma-mapping.hionic_fw.hionic_ibdev.h
Detected Declarations
function ionic_v1_stat_normalizefunction ionic_fill_stats_descfunction ionic_v1_stat_valfunction ionic_hw_stats_cmdfunction ionic_init_hw_statsfunction ionic_get_hw_statsfunction ionic_counter_alloc_statsfunction ionic_counter_deallocfunction ionic_counter_bind_qpfunction ionic_counter_unbind_qpfunction ionic_get_qp_statsfunction list_for_each_entryfunction ionic_counter_update_statsfunction ionic_alloc_countersfunction ionic_stats_initfunction ionic_stats_cleanup
Annotated Snippet
if (rc) {
ibdev_dbg(&dev->ibdev, "Failed to init counter stats\n");
kfree(dev->counter_stats);
dev->counter_stats = NULL;
return;
}
xa_init_flags(&dev->counter_stats->xa_counters, XA_FLAGS_ALLOC);
ib_set_device_ops(&dev->ibdev, &ionic_counter_stats_ops);
}
}
void ionic_stats_cleanup(struct ionic_ibdev *dev)
{
if (dev->counter_stats) {
xa_destroy(&dev->counter_stats->xa_counters);
kfree(dev->counter_stats->hdr);
kfree(dev->counter_stats->stats_hdrs);
kfree(dev->counter_stats);
dev->counter_stats = NULL;
}
kfree(dev->hw_stats);
kfree(dev->hw_stats_buf);
kfree(dev->hw_stats_hdrs);
}
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `ionic_fw.h`, `ionic_ibdev.h`.
- Detected declarations: `function ionic_v1_stat_normalize`, `function ionic_fill_stats_desc`, `function ionic_v1_stat_val`, `function ionic_hw_stats_cmd`, `function ionic_init_hw_stats`, `function ionic_get_hw_stats`, `function ionic_counter_alloc_stats`, `function ionic_counter_dealloc`, `function ionic_counter_bind_qp`, `function ionic_counter_unbind_qp`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.