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.

Dependency Surface

Detected Declarations

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

Implementation Notes