From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Mohsin Bashir <mohsin.bashr@gmail.com>, netdev@vger.kernel.org
Cc: alexanderduyck@fb.com, andrew+netdev@lunn.ch, andrew@lunn.ch,
davem@davemloft.net, donald.hunter@gmail.com,
edumazet@google.com, gal@nvidia.com, horms@kernel.org,
idosch@nvidia.com, jacob.e.keller@intel.com,
kernel-team@meta.com, kory.maincent@bootlin.com, kuba@kernel.org,
lee@trager.us, leon@kernel.org, linux-rdma@vger.kernel.org,
linux@armlinux.org.uk, mbloch@nvidia.com,
o.rempel@pengutronix.de, pabeni@redhat.com, saeedm@nvidia.com,
tariqt@nvidia.com, vadim.fedorenko@linux.dev
Subject: Re: [PATCH net-next V2 5/5] eth: mlx5: Move pause storm errors to pause stats
Date: Wed, 11 Feb 2026 11:49:44 +0200 [thread overview]
Message-ID: <b108212c-99c8-4f02-9e61-3564e544eab3@gmail.com> (raw)
In-Reply-To: <20260207010525.3808842-6-mohsin.bashr@gmail.com>
On 07/02/2026 3:05, Mohsin Bashir wrote:
> Report device_stall_critical_watermark_cnt as tx_pause_storm_events in
> the ethtool_pause_stats struct. This counter tracks pause storm error
> events which indicate the NIC has been sending pause frames for an
> extended period due to a stall.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
> ---
> .../ethernet/mellanox/mlx5/core/en_stats.c | 25 +++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> index a8af84fc9763..2fe779c164e4 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
> @@ -916,6 +916,23 @@ static int mlx5e_stats_get_ieee(struct mlx5_core_dev *mdev,
> sz, MLX5_REG_PPCNT, 0, 0);
> }
>
> +static int mlx5e_stats_get_per_prio(struct mlx5_core_dev *mdev,
> + u32 *ppcnt_per_prio)
> +{
> + u32 in[MLX5_ST_SZ_DW(ppcnt_reg)] = {};
> + int sz = MLX5_ST_SZ_BYTES(ppcnt_reg);
> +
> + if (!(MLX5_CAP_PCAM_FEATURE(mdev, pfcc_mask) &&
> + MLX5_CAP_DEBUG(mdev, stall_detect)))
> + return -EOPNOTSUPP;
> +
> + MLX5_SET(ppcnt_reg, in, local_port, 1);
> + MLX5_SET(ppcnt_reg, in, grp, MLX5_PER_PRIORITY_COUNTERS_GROUP);
> + MLX5_SET(ppcnt_reg, in, prio_tc, 0);
No interest in all other non-0 prios?
> + return mlx5_core_access_reg(mdev, in, sz, ppcnt_per_prio, sz,
> + MLX5_REG_PPCNT, 0, 0);
> +}
> +
> void mlx5e_stats_pause_get(struct mlx5e_priv *priv,
> struct ethtool_pause_stats *pause_stats)
> {
> @@ -933,6 +950,14 @@ void mlx5e_stats_pause_get(struct mlx5e_priv *priv,
> MLX5E_READ_CTR64_BE_F(ppcnt_ieee_802_3,
> eth_802_3_cntrs_grp_data_layout,
> a_pause_mac_ctrl_frames_received);
> +
> + if (mlx5e_stats_get_per_prio(mdev, ppcnt_ieee_802_3))
> + return;
> +
> + pause_stats->tx_pause_storm_events =
> + MLX5E_READ_CTR64_BE_F(ppcnt_ieee_802_3,
> + eth_per_prio_grp_data_layout,
> + device_stall_critical_watermark_cnt);
> }
>
> void mlx5e_stats_eth_phy_get(struct mlx5e_priv *priv,
next prev parent reply other threads:[~2026-02-11 9:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 1:05 [PATCH net-next V2 0/5] net: ethtool: Track TX pause storm Mohsin Bashir
2026-02-07 1:05 ` [PATCH net-next V2 1/5] net: ethtool: Track pause storm events Mohsin Bashir
2026-02-11 9:28 ` Paolo Abeni
2026-02-07 1:05 ` [PATCH net-next V2 2/5] net: ethtool: Update doc for tunable Mohsin Bashir
2026-02-07 1:05 ` [PATCH net-next V2 3/5] eth: fbnic: Add protection against pause storm Mohsin Bashir
2026-02-07 1:05 ` [PATCH net-next V2 4/5] eth: fbnic: Fetch TX pause storm stats Mohsin Bashir
2026-02-07 1:05 ` [PATCH net-next V2 5/5] eth: mlx5: Move pause storm errors to pause stats Mohsin Bashir
2026-02-11 9:26 ` Paolo Abeni
2026-02-11 9:49 ` Tariq Toukan [this message]
2026-02-11 21:18 ` Mohsin Bashir
2026-02-07 1:38 ` [PATCH net-next V2 2/5] net: ethtool: Update doc for tunable Mohsin Bashir
2026-02-07 1:42 ` [PATCH net-next V2 0/5] net: ethtool: Track TX pause storm Mohsin Bashir
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b108212c-99c8-4f02-9e61-3564e544eab3@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jacob.e.keller@intel.com \
--cc=kernel-team@meta.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=lee@trager.us \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mbloch@nvidia.com \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox