From: Yafang Shao <laoar.shao@gmail.com>
To: saeedm@nvidia.com, tariqt@nvidia.com, leon@kernel.org
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH] net/mlx5e: Report rx_discards_phy via rx_missed_errors
Date: Wed, 6 Nov 2024 14:40:15 +0800 [thread overview]
Message-ID: <20241106064015.4118-1-laoar.shao@gmail.com> (raw)
We observed a high number of rx_discards_phy events on some servers when
running `ethtool -S`. However, this important counter is not currently
reflected in the /proc/net/dev statistics file, making it challenging to
monitor effectively.
Since rx_missed_errors represents packets dropped due to buffer exhaustion,
it makes sense to include rx_discards_phy in this counter to enhance
monitoring visibility. This change will help administrators track these
events more effectively through standard interfaces.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Tariq Toukan <tariqt@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 6f686fabed44..42c1b791a74c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3903,7 +3903,8 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
mlx5e_fold_sw_stats64(priv, stats);
}
- stats->rx_missed_errors = priv->stats.qcnt.rx_out_of_buffer;
+ stats->rx_missed_errors = priv->stats.qcnt.rx_out_of_buffer +
+ PPORT_2863_GET(pstats, if_in_discards);
stats->rx_length_errors =
PPORT_802_3_GET(pstats, a_in_range_length_errors) +
--
2.30.1 (Apple Git-130)
next reply other threads:[~2024-11-06 6:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 6:40 Yafang Shao [this message]
2024-11-06 9:56 ` [PATCH] net/mlx5e: Report rx_discards_phy via rx_missed_errors Tariq Toukan
2024-11-06 11:49 ` Yafang Shao
2024-11-06 19:23 ` Gal Pressman
2024-11-07 1:17 ` Jakub Kicinski
2024-11-08 8:39 ` Yafang Shao
2024-11-08 8:37 ` Yafang Shao
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=20241106064015.4118-1-laoar.shao@gmail.com \
--to=laoar.shao@gmail.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/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