* [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats
@ 2026-05-04 18:36 Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 1/5] net/mlx5e: Count full skb length in TSO byte counters Tariq Toukan
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-05-04 18:36 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Dragos Tatulea
Hi,
This series by Gal extends the set of counters reported in netdev stats,
by adding:
- hw_gso_packets/bytes
- RX HW-GRO stats
- TX csum_none
- TX queue stop/wake
It also aligns the tso_bytes/tso_inner_bytes counters with the netdev
stats API and virtio spec definition.
Regards,
Tariq
---
V3:
- Add tso_bytes/tso_inner_bytes patch.
- Drop RX csum patch from the series.
- Reduce TX csum patch to csum_none only.
V2: https://lore.kernel.org/all/20260309095519.1854805-1-tariqt@nvidia.com/
V1: https://lore.kernel.org/all/20260204193315.1722983-1-tariqt@nvidia.com/
Gal Pressman (5):
net/mlx5e: Count full skb length in TSO byte counters
net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats
net/mlx5e: Report RX HW-GRO netdev stats
net/mlx5e: Report TX csum_none netdev stat
net/mlx5e: Report stop and wake TX queue stats
.../net/ethernet/mellanox/mlx5/core/en_main.c | 42 +++++++++++++++++++
.../net/ethernet/mellanox/mlx5/core/en_tx.c | 4 +-
2 files changed, 44 insertions(+), 2 deletions(-)
base-commit: 98878ed91b68a3150126fccef125ee7b1bb86ab2
--
2.44.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next V3 1/5] net/mlx5e: Count full skb length in TSO byte counters
2026-05-04 18:36 [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
@ 2026-05-04 18:37 ` Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 2/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats Tariq Toukan
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-05-04 18:37 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
The tso_bytes and tso_inner_bytes counters currently subtract the header
length from skb->len, counting only the payload. This is confusing and
doesn't align with the behavior of other _bytes counters in the driver.
Report the full skb length to align with this expectation.
This also makes our behavior consistent with the netdev stats API and
virtio spec definition.
Signed-off-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 9f0272649fa1..0b5e600e4a6a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -164,14 +164,14 @@ mlx5e_tx_get_gso_ihs(struct mlx5e_txqsq *sq, struct sk_buff *skb)
else
ihs = skb_inner_tcp_all_headers(skb);
stats->tso_inner_packets++;
- stats->tso_inner_bytes += skb->len - ihs;
+ stats->tso_inner_bytes += skb->len;
} else {
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
ihs = skb_transport_offset(skb) + sizeof(struct udphdr);
else
ihs = skb_tcp_all_headers(skb);
stats->tso_packets++;
- stats->tso_bytes += skb->len - ihs;
+ stats->tso_bytes += skb->len;
}
return ihs;
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next V3 2/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats
2026-05-04 18:36 [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 1/5] net/mlx5e: Count full skb length in TSO byte counters Tariq Toukan
@ 2026-05-04 18:37 ` Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 3/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-05-04 18:37 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
Report hardware GSO statistics via the netdev queue stats API by mapping
the existing TSO counters to hw_gso_packets and hw_gso_bytes 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 | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 5a46870c4b74..f3a936d5a62d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5518,6 +5518,10 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
sq_stats = priv->txq2sq_stats[i];
stats->packets = sq_stats->packets;
stats->bytes = sq_stats->bytes;
+
+ stats->hw_gso_packets =
+ sq_stats->tso_packets + sq_stats->tso_inner_packets;
+ stats->hw_gso_bytes = sq_stats->tso_bytes + sq_stats->tso_inner_bytes;
}
static void mlx5e_get_base_stats(struct net_device *dev,
@@ -5557,6 +5561,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->packets = 0;
tx->bytes = 0;
+ tx->hw_gso_packets = 0;
+ tx->hw_gso_bytes = 0;
for (i = 0; i < priv->stats_nch; i++) {
struct mlx5e_channel_stats *channel_stats = priv->channel_stats[i];
@@ -5583,6 +5589,10 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->packets += sq_stats->packets;
tx->bytes += sq_stats->bytes;
+ tx->hw_gso_packets += sq_stats->tso_packets +
+ sq_stats->tso_inner_packets;
+ tx->hw_gso_bytes += sq_stats->tso_bytes +
+ sq_stats->tso_inner_bytes;
}
}
@@ -5601,6 +5611,10 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->packets += sq_stats->packets;
tx->bytes += sq_stats->bytes;
+ tx->hw_gso_packets += sq_stats->tso_packets +
+ sq_stats->tso_inner_packets;
+ tx->hw_gso_bytes += sq_stats->tso_bytes +
+ sq_stats->tso_inner_bytes;
}
}
}
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next V3 3/5] net/mlx5e: Report RX HW-GRO netdev stats
2026-05-04 18:36 [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 1/5] net/mlx5e: Count full skb length in TSO byte counters Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 2/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats Tariq Toukan
@ 2026-05-04 18:37 ` Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 4/5] net/mlx5e: Report TX csum_none netdev stat Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-05-04 18:37 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
Report RX hardware GRO statistics via the netdev queue stats API by
mapping the existing gro_packets, gro_bytes and gro_skbs counters to the
hw_gro_wire_packets, hw_gro_wire_bytes and hw_gro_packets fields.
Signed-off-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index f3a936d5a62d..a8b55af21ec0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5500,6 +5500,11 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i,
stats->bytes = rq_stats->bytes + xskrq_stats->bytes;
stats->alloc_fail = rq_stats->buff_alloc_err +
xskrq_stats->buff_alloc_err;
+
+ stats->hw_gro_packets = rq_stats->gro_skbs + xskrq_stats->gro_skbs;
+ stats->hw_gro_wire_packets =
+ rq_stats->gro_packets + xskrq_stats->gro_packets;
+ stats->hw_gro_wire_bytes = rq_stats->gro_bytes + xskrq_stats->gro_bytes;
}
static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
@@ -5536,6 +5541,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
rx->packets = 0;
rx->bytes = 0;
rx->alloc_fail = 0;
+ rx->hw_gro_packets = 0;
+ rx->hw_gro_wire_packets = 0;
+ rx->hw_gro_wire_bytes = 0;
for (i = priv->channels.params.num_channels; i < priv->stats_nch; i++) {
struct netdev_queue_stats_rx rx_i = {0};
@@ -5545,6 +5553,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
rx->packets += rx_i.packets;
rx->bytes += rx_i.bytes;
rx->alloc_fail += rx_i.alloc_fail;
+ rx->hw_gro_packets += rx_i.hw_gro_packets;
+ rx->hw_gro_wire_packets += rx_i.hw_gro_wire_packets;
+ rx->hw_gro_wire_bytes += rx_i.hw_gro_wire_bytes;
}
/* always report PTP RX stats from base as there is no
@@ -5556,6 +5567,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
rx->packets += rq_stats->packets;
rx->bytes += rq_stats->bytes;
+ rx->hw_gro_packets += rq_stats->gro_skbs;
+ rx->hw_gro_wire_packets += rq_stats->gro_packets;
+ rx->hw_gro_wire_bytes += rq_stats->gro_bytes;
}
}
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next V3 4/5] net/mlx5e: Report TX csum_none netdev stat
2026-05-04 18:36 [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
` (2 preceding siblings ...)
2026-05-04 18:37 ` [PATCH net-next V3 3/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
@ 2026-05-04 18:37 ` Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-05-04 18:37 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
Report TX csum_none statistic via the netdev queue stats API by mapping
the existing csum_none counter to the csum_none field.
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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index a8b55af21ec0..6fc354a7c5c6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5527,6 +5527,8 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
stats->hw_gso_packets =
sq_stats->tso_packets + sq_stats->tso_inner_packets;
stats->hw_gso_bytes = sq_stats->tso_bytes + sq_stats->tso_inner_bytes;
+
+ stats->csum_none = sq_stats->csum_none;
}
static void mlx5e_get_base_stats(struct net_device *dev,
@@ -5577,6 +5579,7 @@ static void mlx5e_get_base_stats(struct net_device *dev,
tx->bytes = 0;
tx->hw_gso_packets = 0;
tx->hw_gso_bytes = 0;
+ tx->csum_none = 0;
for (i = 0; i < priv->stats_nch; i++) {
struct mlx5e_channel_stats *channel_stats = priv->channel_stats[i];
@@ -5607,6 +5610,7 @@ static void mlx5e_get_base_stats(struct net_device *dev,
sq_stats->tso_inner_packets;
tx->hw_gso_bytes += sq_stats->tso_bytes +
sq_stats->tso_inner_bytes;
+ tx->csum_none += sq_stats->csum_none;
}
}
@@ -5629,6 +5633,7 @@ static void mlx5e_get_base_stats(struct net_device *dev,
sq_stats->tso_inner_packets;
tx->hw_gso_bytes += sq_stats->tso_bytes +
sq_stats->tso_inner_bytes;
+ tx->csum_none += sq_stats->csum_none;
}
}
}
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next V3 5/5] net/mlx5e: Report stop and wake TX queue stats
2026-05-04 18:36 [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
` (3 preceding siblings ...)
2026-05-04 18:37 ` [PATCH net-next V3 4/5] net/mlx5e: Report TX csum_none netdev stat Tariq Toukan
@ 2026-05-04 18:37 ` Tariq Toukan
4 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2026-05-04 18:37 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Dragos Tatulea
From: Gal Pressman <gal@nvidia.com>
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-04 18:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 18:36 [PATCH net-next V3 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 1/5] net/mlx5e: Count full skb length in TSO byte counters Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 2/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 3/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 4/5] net/mlx5e: Report TX csum_none netdev stat Tariq Toukan
2026-05-04 18:37 ` [PATCH net-next V3 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox