Skip to content

Commit c691d6a

Browse files
cjubrangregkh
authored andcommitted
net/mlx5e: Don't query FEC statistics when FEC is disabled
[ Upstream commit 6b81b8a ] Update mlx5e_stats_fec_get() to check the active FEC mode and skip statistics collection when FEC is disabled. Signed-off-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Yael Chemla <ychemla@nvidia.com> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Link: https://patch.msgid.link/20250924124037.1508846-3-vadim.fedorenko@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 47ed17f commit c691d6a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,16 +1413,13 @@ static void fec_set_rs_stats(struct ethtool_fec_stats *fec_stats, u32 *ppcnt)
14131413
}
14141414

14151415
static void fec_set_block_stats(struct mlx5e_priv *priv,
1416+
int mode,
14161417
struct ethtool_fec_stats *fec_stats)
14171418
{
14181419
struct mlx5_core_dev *mdev = priv->mdev;
14191420
u32 out[MLX5_ST_SZ_DW(ppcnt_reg)] = {};
14201421
u32 in[MLX5_ST_SZ_DW(ppcnt_reg)] = {};
14211422
int sz = MLX5_ST_SZ_BYTES(ppcnt_reg);
1422-
int mode = fec_active_mode(mdev);
1423-
1424-
if (mode == MLX5E_FEC_NOFEC)
1425-
return;
14261423

14271424
MLX5_SET(ppcnt_reg, in, local_port, 1);
14281425
MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP);
@@ -1463,11 +1460,14 @@ static void fec_set_corrected_bits_total(struct mlx5e_priv *priv,
14631460
void mlx5e_stats_fec_get(struct mlx5e_priv *priv,
14641461
struct ethtool_fec_stats *fec_stats)
14651462
{
1466-
if (!MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group))
1463+
int mode = fec_active_mode(priv->mdev);
1464+
1465+
if (mode == MLX5E_FEC_NOFEC ||
1466+
!MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group))
14671467
return;
14681468

14691469
fec_set_corrected_bits_total(priv, fec_stats);
1470-
fec_set_block_stats(priv, fec_stats);
1470+
fec_set_block_stats(priv, mode, fec_stats);
14711471
}
14721472

14731473
#define PPORT_ETH_EXT_OFF(c) \

0 commit comments

Comments
 (0)