On 06/11/2024 8:40, Yafang Shao wrote:
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.
Hi,
Thanks for your patch.
It's a matter of interpretation...
The documentation in
Documentation/ABI/testing/sysfs-class-net-statistics refers to the
driver for the exact meaning.
rx_discards_phy counts packet drops due to exhaustion of the physical
port memory (not in the host), this happen way before steering the
packet to any receive queue.
Today, rx_missed_errors counts SW/host memory buffer exhaustion of the
receive queues.
I don't think that rx_missed_errors should mix both.
Maybe some other counter can be used for rx_discards_phy, like
rx_fifo_errors?
Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
Cc: Saeed Mahameed <saeedm@xxxxxxxxxx>
Cc: Tariq Toukan <tariqt@xxxxxxxxxx>
Cc: Leon Romanovsky <leon@xxxxxxxxxx>
---
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) +