[PATCH net-next V3 5/5] net/mlx5e: Report stop and wake TX queue stats

Tariq Toukan
2026-05-04T18:38:27Z

Report TX queue stop and wake statistics via the netdev queue stats API
by mapping the existing stopped and wake counters to the stop and wake
fields.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 6fc354a7c5c6..469e066dc432 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5529,6 +5529,9 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
stats->hw_gso_bytes = sq_stats->tso_bytes + sq_stats->tso_inner_bytes;

stats->csum_none = sq_stats->csum_none;
+
+ stats->stop = sq_stats->stopped;
+ stats->wake = sq_stats->wake;
}

static void mlx5e_get_base_stats(struct net_device *dev,
@@ -5580,6 +5583,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->hw_gso_packets = 0;
tx->hw_gso_bytes = 0;
tx->csum_none = 0;
+ tx->stop = 0;
+ tx->wake = 0;

for (i = 0; i < priv->stats_nch; i++) {
struct mlx5e_channel_stats *channel_stats = priv->channel_stats[i];
@@ -5611,6 +5616,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->hw_gso_bytes += sq_stats->tso_bytes +
sq_stats->tso_inner_bytes;
tx->csum_none += sq_stats->csum_none;
+ tx->stop += sq_stats->stopped;
+ tx->wake += sq_stats->wake;
}
}

@@ -5634,6 +5641,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->hw_gso_bytes += sq_stats->tso_bytes +
sq_stats->tso_inner_bytes;
tx->csum_none += sq_stats->csum_none;
+ tx->stop += sq_stats->stopped;
+ tx->wake += sq_stats->wake;
}
}
}
--
2.44.0