From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A111A34DB4A; Fri, 21 Nov 2025 13:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733004; cv=none; b=KmZwhXamTKbJhrQ1Z02HObmd1aCGqsSArLSJ+qfNTkhEfh7EE6d/hdE/lWx7HaOiC5uvgvVd0b24mkm67BPNSrmwVGgFRHd8NEovHvTUG31aZZxD4QgqRLkva1kojxcZhNDnVds08XOy8oC+FQ+VJvEzTOdArypYIoI4GArp9fI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733004; c=relaxed/simple; bh=0pml3A/P7t+lMlNAT4jMezfvsVbnAToJcDXw2dF3sXc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hZMarbsEZ3OjWI480hoeLcQwRsGZjweB6ONOSVtL57lthcHNYz5nTlI3bwUX9bibOmBnCfem9a/RnumNu6RDs84eLStMh8fCWB5sHcvtC8gbgSqcQUE2MjwhusjXV5VLBx4MMQuAyBhb26bRhY8zqo+O+VdqIRz3o4/vEXwKhT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=acSMd4AF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="acSMd4AF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E06C1C4CEF1; Fri, 21 Nov 2025 13:50:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763733004; bh=0pml3A/P7t+lMlNAT4jMezfvsVbnAToJcDXw2dF3sXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acSMd4AFhM3a5xN5sG2NiHTCUdwgI3kcyMem9NGwANhGC7j+vbL3Gxq1JEp8Bbpd5 bDJZoTPH+xwW9Wmasj8M1+WGKJSFNtieV2y3BD6rrI2wT3eGtBSN5mDOnmCgzJfkDo +5EKiMNcQ5sAmgZM5ErhBE7On4d7Gwl1zgVbb1/g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Carolina Jubran , Dragos Tatulea , Yael Chemla , Vadim Fedorenko , Aleksandr Loktionov , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 284/529] net/mlx5e: Dont query FEC statistics when FEC is disabled Date: Fri, 21 Nov 2025 14:09:43 +0100 Message-ID: <20251121130241.134528535@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130230.985163914@linuxfoundation.org> References: <20251121130230.985163914@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Carolina Jubran [ Upstream commit 6b81b8a0b1978284e007566d7a1607b47f92209f ] Update mlx5e_stats_fec_get() to check the active FEC mode and skip statistics collection when FEC is disabled. Signed-off-by: Carolina Jubran Reviewed-by: Dragos Tatulea Reviewed-by: Yael Chemla Signed-off-by: Vadim Fedorenko Reviewed-by: Aleksandr Loktionov Link: https://patch.msgid.link/20250924124037.1508846-3-vadim.fedorenko@linux.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 4b96ad657145b..1c69244e00d75 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -1339,16 +1339,13 @@ static void fec_set_rs_stats(struct ethtool_fec_stats *fec_stats, u32 *ppcnt) } static void fec_set_block_stats(struct mlx5e_priv *priv, + int mode, struct ethtool_fec_stats *fec_stats) { struct mlx5_core_dev *mdev = priv->mdev; u32 out[MLX5_ST_SZ_DW(ppcnt_reg)] = {}; u32 in[MLX5_ST_SZ_DW(ppcnt_reg)] = {}; int sz = MLX5_ST_SZ_BYTES(ppcnt_reg); - int mode = fec_active_mode(mdev); - - if (mode == MLX5E_FEC_NOFEC) - return; MLX5_SET(ppcnt_reg, in, local_port, 1); MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP); @@ -1389,11 +1386,14 @@ static void fec_set_corrected_bits_total(struct mlx5e_priv *priv, void mlx5e_stats_fec_get(struct mlx5e_priv *priv, struct ethtool_fec_stats *fec_stats) { - if (!MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group)) + int mode = fec_active_mode(priv->mdev); + + if (mode == MLX5E_FEC_NOFEC || + !MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group)) return; fec_set_corrected_bits_total(priv, fec_stats); - fec_set_block_stats(priv, fec_stats); + fec_set_block_stats(priv, mode, fec_stats); } #define PPORT_ETH_EXT_OFF(c) \ -- 2.51.0