Skip to content

Commit 6c75dc9

Browse files
Alexei Lazarkuba-moo
authored andcommitted
net/mlx5e: Don't gate FEC histograms on ppcnt_statistical_group
Currently, the ppcnt_statistical_group capability check incorrectly gates access to FEC histogram statistics. This capability applies only to statistical and physical counter groups, not for histogram data. Restrict the ppcnt_statistical_group check to the Physical_Layer_Counters and Physical_Layer_Statistical_Counters groups. Histogram statistics access remains gated by the pphcr capability. The issue is harmless as of today, as it happens that ppcnt_statistical_group is set on all existing devices that have pphcr set. Fixes: 6b81b8a ("net/mlx5e: Don't query FEC statistics when FEC is disabled") Signed-off-by: Alexei Lazar <alazar@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/20251225132717.358820-3-mbloch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3105797 commit 6c75dc9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,12 +1608,13 @@ void mlx5e_stats_fec_get(struct mlx5e_priv *priv,
16081608
{
16091609
int mode = fec_active_mode(priv->mdev);
16101610

1611-
if (mode == MLX5E_FEC_NOFEC ||
1612-
!MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group))
1611+
if (mode == MLX5E_FEC_NOFEC)
16131612
return;
16141613

1615-
fec_set_corrected_bits_total(priv, fec_stats);
1616-
fec_set_block_stats(priv, mode, fec_stats);
1614+
if (MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group)) {
1615+
fec_set_corrected_bits_total(priv, fec_stats);
1616+
fec_set_block_stats(priv, mode, fec_stats);
1617+
}
16171618

16181619
if (MLX5_CAP_PCAM_REG(priv->mdev, pphcr))
16191620
fec_set_histograms_stats(priv, mode, hist);

0 commit comments

Comments
 (0)