drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_stats.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_stats.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_stats.c
Extension
.c
Size
1975 bytes
Lines
71
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.

Dependency Surface

Detected Declarations

Annotated Snippet

static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(macsec_hw) {}

static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(macsec_hw)
{
	unsigned int i;

	if (!priv->macsec)
		return;

	if (!mlx5e_is_macsec_device(priv->mdev))
		return;

	for (i = 0; i < NUM_MACSEC_HW_COUNTERS; i++)
		ethtool_puts(data, mlx5e_macsec_hw_stats_desc[i].format);
}

static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(macsec_hw)
{
	struct mlx5_macsec_fs *macsec_fs;
	int i;

	if (!priv->macsec)
		return;

	if (!mlx5e_is_macsec_device(priv->mdev))
		return;

	macsec_fs = priv->mdev->macsec_fs;
	mlx5_macsec_fs_get_stats_fill(macsec_fs, mlx5_macsec_fs_get_stats(macsec_fs));
	for (i = 0; i < NUM_MACSEC_HW_COUNTERS; i++)
		mlx5e_ethtool_put_stat(
			data, MLX5E_READ_CTR64_CPU(
				      mlx5_macsec_fs_get_stats(macsec_fs),
				      mlx5e_macsec_hw_stats_desc, i));
}

MLX5E_DEFINE_STATS_GRP(macsec_hw, 0);

Annotation

Implementation Notes