From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE296314D37 for ; Thu, 5 Mar 2026 14:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772719938; cv=none; b=Fdeg9r/PwjBgqU5OavddJq4t8Slwyiro+Lt5g7JvbyY08jav/LcjN1xvNnhIlHU4Nf22qSt5pyrGybXc5562Low+YWt7ShQczJWcQt+h13OtENggI2XyJVUfIekunI/RCXxMJbhRrnzGFf97TzX4ZZwhAsrdY/K+EwlX/wrYANU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772719938; c=relaxed/simple; bh=mWUWRxoauzJOOGx1fQb6UZox9B27uD9K39OrpcrXzuw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BWCe8uS6ZwCMzMYTTaQ7MTKXrzkaAlEFzkikFeJDr9jwUROzZcx/2yWdhZsuSJ+6IpNQRDiLtAXiLcFauiRn8ey2QPxECXTpi35HCC3hawzeXh6SJcfw9Bl1KXIUgh/vRA7BtjCqwyZm4Vs+CvXCjiOhI5MNR6tnIA1VDU2CTpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HWVeuOIq; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HWVeuOIq" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4837584120eso61493975e9.1 for ; Thu, 05 Mar 2026 06:12:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772719935; x=1773324735; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5ae8c1J9pdWn7b1F5/jsy8UBNAYMEbo6epboWQWtLHg=; b=HWVeuOIqpF0iObb3QPWJLOdeXE3TrRF7H7HLnUM7k+/9qDbTJzkhw1dSyMsos99pSv tgzu6lzfoXn7xZKk1EXGqhQcV5Xd/MS3mos2kJocR18UIejtXP4xFTmsTGczVmVtnLtF ji5KnVON/C7+g67HsVzYlyDWxnE0HyMWywNQYGncc3TIjbn+wVb+k5EMhmcEiUyz6AkM JO4bjG/TKcvG9+nN9KXkbf+9TdVp81t1WwZnU1Sr0atNflul8MMIAtUId3Zbb6DsVQAp AprUFqhEDjJ2uWWwFmk8Cec5gPxL+MddNYvwF7znJTKy0ufeZM3psjdsgb0vy+THiPmO g3Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772719935; x=1773324735; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5ae8c1J9pdWn7b1F5/jsy8UBNAYMEbo6epboWQWtLHg=; b=UbtGaWrHjjI5ojK9q1q74oeB91BZsFSdOfsL4BUZ15373qcO3D81beZDOgWEQT07HH w2uzAvhj1HEx/P8t4/LaP/QlFtcaxB2egiXQBDsMk0NRArmO7N+VBoiCG91FrkNI0kyD LHWiXyPmDnfPCsfeEEWdHLsurtfyer+1lFwtfslG6CspORjcPQbiWfaPKyyii740RkE2 ddxUdebLEKUCIRehTv4+sV/fWM2GvkNY9hHc5roHEnawiRxowLF9R16EHl7a3A8VYSz9 93cNXVaZ347n2Ub0hO0ImUe89pXnIhlqKULsDoIvpgIRwsk08LqhmWGXOMkIhIdEp+Mv lnDw== X-Forwarded-Encrypted: i=1; AJvYcCVu93d5aRHTG4C1O+xgQNS02mRopNo9+Eo7KIfSRtFjbBHNXnpimOWImyA18XB83I8SMd4znPSzVo23XB8=@vger.kernel.org X-Gm-Message-State: AOJu0YxnYBi5h0/CVGqBkYI8keWAsJwPBqxRchSTez+dvcaE8eYq3BnE rwOkzs+Orc0Y4IbJEe3nd3E5OGI50PGvMe5R2bzOO9atybuwcyU+RgsS X-Gm-Gg: ATEYQzzUBmpE3OGUJoo8S2CJnDOkBqfksyfei9sz7FjyyUM+nVUyltG1KHBME0ZLpSh 1jOA3blp6p2UvvKQUYr9fBQCLKrq9zO4ZMml3fjtcz7KU14oGZo+MHscjs3dlXy910HiFzBOv2Z oncqxot72HUGFzwMqD3hpTthIgO2Vk1LcwD4R4IXzHJe1ykv7RI+9VSVb8CmrJLsXLTSWFlvWMx 2EzKqEuMmnZPgkkZTtSc5bYmP82IeewNNbccgYcHryMab7bNBpQwIWs+6VYQGGiF3cI9U2Y1jsd NhOx4pJxiu1fWEa6D6MihnaQLwtWe9om3X0XS3A2G/dAZOUm3j/QkAegaYdr0AXh6l0UN/CpFLC GdpFgn88oMJKnlumyM6FPkCk3AlPJAZXi0XnbXvTXAXillXXwmZCvf0OELsHZAPu0TMx6jqeoWe FZLqq3niY+UoYhoY3zBR5N6VWXvjxB7S247mySrQvLOxadGBo= X-Received: by 2002:a05:600c:4e0b:b0:47a:81b7:9a20 with SMTP id 5b1f17b1804b1-4851982e869mr108951345e9.9.1772719934829; Thu, 05 Mar 2026 06:12:14 -0800 (PST) Received: from [10.221.197.238] ([165.85.126.96]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4851fae475csm41723335e9.8.2026.03.05.06.12.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Mar 2026 06:12:14 -0800 (PST) Message-ID: Date: Thu, 5 Mar 2026 16:12:11 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [net-next V4 5/5] eth: mlx5: Move pause storm errors to pause stats To: Mohsin Bashir , netdev@vger.kernel.org Cc: alexanderduyck@fb.com, alok.a.tiwari@oracle.com, andrew+netdev@lunn.ch, andrew@lunn.ch, davem@davemloft.net, dg573847474@gmail.com, 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-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux@armlinux.org.uk, mbloch@nvidia.com, mike.marciniszyn@gmail.com, o.rempel@pengutronix.de, pabeni@redhat.com, saeedm@nvidia.com, tariqt@nvidia.com, vadim.fedorenko@linux.dev References: <20260302230149.1580195-1-mohsin.bashr@gmail.com> <20260302230149.1580195-6-mohsin.bashr@gmail.com> Content-Language: en-US From: Tariq Toukan In-Reply-To: <20260302230149.1580195-6-mohsin.bashr@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/03/2026 1:01, 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. > > The ethtool_pause_stats struct reports these stalls as a single value, > whereas the device supports tracking them per priority. Aggregate the > counter across all priority classes to capture stalls on all priorities. > Note that the stats are fetched from the device for each priority via > mlx5_core_access_reg(). > > Signed-off-by: Jakub Kicinski > Signed-off-by: Mohsin Bashir > --- Hi, Sorry for the delay :/ Overall patch looks better now. Just one small comment/question. > .../ethernet/mellanox/mlx5/core/en_stats.c | 30 +++++++++++++++++++ > 1 file changed, 30 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..1a3ecf073913 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c > @@ -916,11 +916,30 @@ 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, int 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, prio); > + 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) > { > u32 ppcnt_ieee_802_3[MLX5_ST_SZ_DW(ppcnt_reg)]; > struct mlx5_core_dev *mdev = priv->mdev; > + u64 ps_stats = 0; > + int prio; > > if (mlx5e_stats_get_ieee(mdev, ppcnt_ieee_802_3)) > return; > @@ -933,6 +952,17 @@ 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); > + > + for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { > + if (mlx5e_stats_get_per_prio(mdev, ppcnt_ieee_802_3, prio)) > + return; If we return here, tx_pause_storm_events remains unset, while rx/tx_pause_frames are already assigned. Is that acceptable? I'm probably fine with it. > + > + ps_stats += MLX5E_READ_CTR64_BE_F(ppcnt_ieee_802_3, > + eth_per_prio_grp_data_layout, > + device_stall_critical_watermark_cnt); > + } > + > + pause_stats->tx_pause_storm_events = ps_stats; > } > > void mlx5e_stats_eth_phy_get(struct mlx5e_priv *priv,