drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c- Extension
.c- Size
- 4492 bytes
- Lines
- 133
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ethtool.hnet/sock.hen.hipsec.h
Detected Declarations
function MLX5E_DECLARE_STATS_GRP_OP_NUM_STATSfunction MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATSfunction MLX5E_DECLARE_STATS_GRP_OP_FILL_STATSfunction MLX5E_DECLARE_STATS_GRP_OP_NUM_STATSfunction MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATSfunction MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS
Annotated Snippet
static inline MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_hw) {}
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ipsec_hw)
{
unsigned int i;
if (!priv->ipsec)
return;
for (i = 0; i < NUM_IPSEC_HW_COUNTERS; i++)
ethtool_puts(data, mlx5e_ipsec_hw_stats_desc[i].format);
}
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_hw)
{
int i;
if (!priv->ipsec)
return;
mlx5e_accel_ipsec_fs_read_stats(priv, &priv->ipsec->hw_stats);
for (i = 0; i < NUM_IPSEC_HW_COUNTERS; i++)
mlx5e_ethtool_put_stat(
data,
MLX5E_READ_CTR_ATOMIC64(&priv->ipsec->hw_stats,
mlx5e_ipsec_hw_stats_desc, i));
}
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_sw)
{
return priv->ipsec ? NUM_IPSEC_SW_COUNTERS : 0;
}
static inline MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_sw) {}
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ipsec_sw)
{
unsigned int i;
if (priv->ipsec)
for (i = 0; i < NUM_IPSEC_SW_COUNTERS; i++)
ethtool_puts(data, mlx5e_ipsec_sw_stats_desc[i].format);
}
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_sw)
{
int i;
if (priv->ipsec)
for (i = 0; i < NUM_IPSEC_SW_COUNTERS; i++)
mlx5e_ethtool_put_stat(
data, MLX5E_READ_CTR_ATOMIC64(
&priv->ipsec->sw_stats,
mlx5e_ipsec_sw_stats_desc, i));
}
MLX5E_DEFINE_STATS_GRP(ipsec_hw, 0);
MLX5E_DEFINE_STATS_GRP(ipsec_sw, 0);
Annotation
- Immediate include surface: `linux/ethtool.h`, `net/sock.h`, `en.h`, `ipsec.h`.
- Detected declarations: `function MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS`, `function MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS`, `function MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS`, `function MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS`, `function MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS`, `function MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS`.
- 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.