public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats
@ 2026-03-09  9:55 Tariq Toukan
  2026-03-09  9:55 ` [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Tariq Toukan @ 2026-03-09  9:55 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, Moshe Shemesh,
	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/RX csum
- TX queue stop/wake

Regards,
Tariq

V2:
- Link to V1: https://lore.kernel.org/all/20260204193315.1722983-1-tariqt@nvidia.com/
- Fix GRO counters of patch #2.

Gal Pressman (5):
  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 netdev stats
  net/mlx5e: Report RX csum netdev stats
  net/mlx5e: Report stop and wake TX queue stats

 .../net/ethernet/mellanox/mlx5/core/en_main.c | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)


base-commit: 0bcac7b11262557c990da1ac564d45777eb6b005
-- 
2.44.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats
  2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
@ 2026-03-09  9:55 ` Tariq Toukan
  2026-03-11  3:12   ` Jakub Kicinski
  2026-03-09  9:55 ` [PATCH net-next V2 2/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Tariq Toukan @ 2026-03-09  9:55 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, Moshe Shemesh,
	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 f7009da94f0b..3e934e269139 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5479,6 +5479,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,
@@ -5518,6 +5522,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];
@@ -5544,6 +5550,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;
 		}
 	}
 
@@ -5562,6 +5572,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] 15+ messages in thread

* [PATCH net-next V2 2/5] net/mlx5e: Report RX HW-GRO netdev stats
  2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
  2026-03-09  9:55 ` [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
@ 2026-03-09  9:55 ` Tariq Toukan
  2026-03-11  3:14   ` Jakub Kicinski
  2026-03-09  9:55 ` [PATCH net-next V2 3/5] net/mlx5e: Report TX csum " Tariq Toukan
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Tariq Toukan @ 2026-03-09  9:55 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, Moshe Shemesh,
	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 3e934e269139..f20fec154d47 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5461,6 +5461,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,
@@ -5497,6 +5502,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};
@@ -5506,6 +5514,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
@@ -5517,6 +5528,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] 15+ messages in thread

* [PATCH net-next V2 3/5] net/mlx5e: Report TX csum netdev stats
  2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
  2026-03-09  9:55 ` [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
  2026-03-09  9:55 ` [PATCH net-next V2 2/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
@ 2026-03-09  9:55 ` Tariq Toukan
  2026-03-11  3:18   ` Jakub Kicinski
  2026-03-09  9:55 ` [PATCH net-next V2 4/5] net/mlx5e: Report RX " Tariq Toukan
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Tariq Toukan @ 2026-03-09  9:55 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, Moshe Shemesh,
	Dragos Tatulea

From: Gal Pressman <gal@nvidia.com>

Report TX checksum statistics via the netdev queue stats API by mapping
the existing csum_none and csum_partial counters to the csum_none and
needs_csum 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 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index f20fec154d47..e2f98b1f8636 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5488,6 +5488,10 @@ 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;
+	stats->needs_csum =
+		sq_stats->csum_partial + sq_stats->csum_partial_inner;
 }
 
 static void mlx5e_get_base_stats(struct net_device *dev,
@@ -5538,6 +5542,8 @@ 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;
+	tx->needs_csum = 0;
 
 	for (i = 0; i < priv->stats_nch; i++) {
 		struct mlx5e_channel_stats *channel_stats = priv->channel_stats[i];
@@ -5568,6 +5574,9 @@ 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;
+			tx->needs_csum += sq_stats->csum_partial +
+					  sq_stats->csum_partial_inner;
 		}
 	}
 
@@ -5590,6 +5599,9 @@ 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;
+			tx->needs_csum += sq_stats->csum_partial +
+					  sq_stats->csum_partial_inner;
 		}
 	}
 }
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next V2 4/5] net/mlx5e: Report RX csum netdev stats
  2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
                   ` (2 preceding siblings ...)
  2026-03-09  9:55 ` [PATCH net-next V2 3/5] net/mlx5e: Report TX csum " Tariq Toukan
@ 2026-03-09  9:55 ` Tariq Toukan
  2026-03-11  3:20   ` Jakub Kicinski
  2026-03-09  9:55 ` [PATCH net-next V2 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
  2026-03-10 17:38 ` [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Simon Horman
  5 siblings, 1 reply; 15+ messages in thread
From: Tariq Toukan @ 2026-03-09  9:55 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, Moshe Shemesh,
	Dragos Tatulea

From: Gal Pressman <gal@nvidia.com>

Report RX checksum statistics via the netdev queue stats API by mapping
the existing csum_complete, csum_unnecessary, csum_unnecessary_inner,
and csum_none counters to the csum_complete, csum_unnecessary and
csum_none fields.

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

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index e2f98b1f8636..a03fbf1cb362 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5466,6 +5466,14 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i,
 	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;
+
+	stats->csum_complete =
+		rq_stats->csum_complete + xskrq_stats->csum_complete;
+	stats->csum_unnecessary = rq_stats->csum_unnecessary +
+				  xskrq_stats->csum_unnecessary +
+				  rq_stats->csum_unnecessary_inner +
+				  xskrq_stats->csum_unnecessary_inner;
+	stats->csum_none = rq_stats->csum_none + xskrq_stats->csum_none;
 }
 
 static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
@@ -5509,6 +5517,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
 		rx->hw_gro_packets = 0;
 		rx->hw_gro_wire_packets = 0;
 		rx->hw_gro_wire_bytes = 0;
+		rx->csum_complete = 0;
+		rx->csum_unnecessary = 0;
+		rx->csum_none = 0;
 
 		for (i = priv->channels.params.num_channels; i < priv->stats_nch; i++) {
 			struct netdev_queue_stats_rx rx_i = {0};
@@ -5521,6 +5532,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
 			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;
+			rx->csum_complete += rx_i.csum_complete;
+			rx->csum_unnecessary += rx_i.csum_unnecessary;
+			rx->csum_none += rx_i.csum_none;
 		}
 
 		/* always report PTP RX stats from base as there is no
@@ -5535,6 +5549,11 @@ static void mlx5e_get_base_stats(struct net_device *dev,
 			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;
+			rx->csum_complete += rq_stats->csum_complete;
+			rx->csum_unnecessary +=
+				rq_stats->csum_unnecessary +
+				rq_stats->csum_unnecessary_inner;
+			rx->csum_none += rq_stats->csum_none;
 		}
 	}
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH net-next V2 5/5] net/mlx5e: Report stop and wake TX queue stats
  2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
                   ` (3 preceding siblings ...)
  2026-03-09  9:55 ` [PATCH net-next V2 4/5] net/mlx5e: Report RX " Tariq Toukan
@ 2026-03-09  9:55 ` Tariq Toukan
  2026-03-10 17:38 ` [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Simon Horman
  5 siblings, 0 replies; 15+ messages in thread
From: Tariq Toukan @ 2026-03-09  9:55 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, Moshe Shemesh,
	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 a03fbf1cb362..ebab82297231 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5500,6 +5500,9 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
 	stats->csum_none = sq_stats->csum_none;
 	stats->needs_csum =
 		sq_stats->csum_partial + sq_stats->csum_partial_inner;
+
+	stats->stop = sq_stats->stopped;
+	stats->wake = sq_stats->wake;
 }
 
 static void mlx5e_get_base_stats(struct net_device *dev,
@@ -5563,6 +5566,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
 	tx->hw_gso_bytes = 0;
 	tx->csum_none = 0;
 	tx->needs_csum = 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];
@@ -5596,6 +5601,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
 			tx->csum_none += sq_stats->csum_none;
 			tx->needs_csum += sq_stats->csum_partial +
 					  sq_stats->csum_partial_inner;
+			tx->stop += sq_stats->stopped;
+			tx->wake += sq_stats->wake;
 		}
 	}
 
@@ -5621,6 +5628,8 @@ static void mlx5e_get_base_stats(struct net_device *dev,
 			tx->csum_none += sq_stats->csum_none;
 			tx->needs_csum += sq_stats->csum_partial +
 					  sq_stats->csum_partial_inner;
+			tx->stop += sq_stats->stopped;
+			tx->wake += sq_stats->wake;
 		}
 	}
 }
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats
  2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
                   ` (4 preceding siblings ...)
  2026-03-09  9:55 ` [PATCH net-next V2 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
@ 2026-03-10 17:38 ` Simon Horman
  5 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2026-03-10 17:38 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	David S. Miller, Saeed Mahameed, Mark Bloch, Leon Romanovsky,
	netdev, linux-rdma, linux-kernel, Gal Pressman, Moshe Shemesh,
	Dragos Tatulea

On Mon, Mar 09, 2026 at 11:55:14AM +0200, Tariq Toukan wrote:
> 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/RX csum
> - TX queue stop/wake
> 
> Regards,
> Tariq
> 
> V2:
> - Link to V1: https://lore.kernel.org/all/20260204193315.1722983-1-tariqt@nvidia.com/
> - Fix GRO counters of patch #2.

Thanks.

For the series,

Reviewed-by: Simon Horman <horms@kernel.org>

...

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats
  2026-03-09  9:55 ` [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
@ 2026-03-11  3:12   ` Jakub Kicinski
  2026-03-12  9:49     ` Gal Pressman
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2026-03-11  3:12 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Gal Pressman, Moshe Shemesh, Dragos Tatulea

On Mon, 9 Mar 2026 11:55:15 +0200 Tariq Toukan wrote:
> 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.

The docs on our stats are based on the virtio spec:
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
which is not very detailed, but to me "bytes of TSO packets"
is a sum of skb->len of those packets. And mlx5 seems to only
be counting payloads??

Maybe given the ambiguity / mismatch report just the packet
count? IDK how useful the bytes are in real life anyway.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 2/5] net/mlx5e: Report RX HW-GRO netdev stats
  2026-03-09  9:55 ` [PATCH net-next V2 2/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
@ 2026-03-11  3:14   ` Jakub Kicinski
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2026-03-11  3:14 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Gal Pressman, Moshe Shemesh, Dragos Tatulea

On Mon, 9 Mar 2026 11:55:16 +0200 Tariq Toukan wrote:
> 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.

This looks right now:

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 3/5] net/mlx5e: Report TX csum netdev stats
  2026-03-09  9:55 ` [PATCH net-next V2 3/5] net/mlx5e: Report TX csum " Tariq Toukan
@ 2026-03-11  3:18   ` Jakub Kicinski
  2026-03-12  9:50     ` Gal Pressman
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2026-03-11  3:18 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Gal Pressman, Moshe Shemesh, Dragos Tatulea

On Mon, 9 Mar 2026 11:55:17 +0200 Tariq Toukan wrote:
> Report TX checksum statistics via the netdev queue stats API by mapping
> the existing csum_none and csum_partial counters to the csum_none and
> needs_csum fields.

      -
        name: tx-needs-csum
        doc: |
          Number of packets that required the device to calculate the checksum.
          This counter includes the number of GSO wire packets for which device
          calculated the L4 checksum.
        type: uint

Looking at drivers currently implementing this it seems like the idea
was to avoid having to increment two counters in the drivers, given
that TSO always implies csum offload

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 4/5] net/mlx5e: Report RX csum netdev stats
  2026-03-09  9:55 ` [PATCH net-next V2 4/5] net/mlx5e: Report RX " Tariq Toukan
@ 2026-03-11  3:20   ` Jakub Kicinski
  2026-03-12  9:50     ` Gal Pressman
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2026-03-11  3:20 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Gal Pressman, Moshe Shemesh, Dragos Tatulea

On Mon, 9 Mar 2026 11:55:18 +0200 Tariq Toukan wrote:
> Report RX checksum statistics via the netdev queue stats API by mapping
> the existing csum_complete, csum_unnecessary, csum_unnecessary_inner,
> and csum_none counters to the csum_complete, csum_unnecessary and
> csum_none fields.

The doc doesnt say clearly but I'd assume this should also count wire
frames for consistency with the Tx one

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats
  2026-03-11  3:12   ` Jakub Kicinski
@ 2026-03-12  9:49     ` Gal Pressman
  0 siblings, 0 replies; 15+ messages in thread
From: Gal Pressman @ 2026-03-12  9:49 UTC (permalink / raw)
  To: Jakub Kicinski, Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Moshe Shemesh, Dragos Tatulea

Thanks for the review on the series Jakub!

On 11/03/2026 5:12, Jakub Kicinski wrote:
> On Mon, 9 Mar 2026 11:55:15 +0200 Tariq Toukan wrote:
>> 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.
> 
> The docs on our stats are based on the virtio spec:
> https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
> which is not very detailed, but to me "bytes of TSO packets"
> is a sum of skb->len of those packets. And mlx5 seems to only
> be counting payloads??

TBH, I'm surprised this is our behavior, not intuitive at all..

I'm inclined to just change it to account for the headers, hope it won't
break anything.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 3/5] net/mlx5e: Report TX csum netdev stats
  2026-03-11  3:18   ` Jakub Kicinski
@ 2026-03-12  9:50     ` Gal Pressman
  2026-03-12 14:22       ` Jakub Kicinski
  0 siblings, 1 reply; 15+ messages in thread
From: Gal Pressman @ 2026-03-12  9:50 UTC (permalink / raw)
  To: Jakub Kicinski, Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Moshe Shemesh, Dragos Tatulea

On 11/03/2026 5:18, Jakub Kicinski wrote:
> On Mon, 9 Mar 2026 11:55:17 +0200 Tariq Toukan wrote:
>> Report TX checksum statistics via the netdev queue stats API by mapping
>> the existing csum_none and csum_partial counters to the csum_none and
>> needs_csum fields.
> 
>       -
>         name: tx-needs-csum
>         doc: |
>           Number of packets that required the device to calculate the checksum.
>           This counter includes the number of GSO wire packets for which device
>           calculated the L4 checksum.
>         type: uint

Yea, we count GSO packets as one, so not a direct fit.

> 
> Looking at drivers currently implementing this it seems like the idea
> was to avoid having to increment two counters in the drivers, given
> that TSO always implies csum offload

I don't think I understand what you're trying to say here.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 4/5] net/mlx5e: Report RX csum netdev stats
  2026-03-11  3:20   ` Jakub Kicinski
@ 2026-03-12  9:50     ` Gal Pressman
  0 siblings, 0 replies; 15+ messages in thread
From: Gal Pressman @ 2026-03-12  9:50 UTC (permalink / raw)
  To: Jakub Kicinski, Tariq Toukan
  Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
	Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
	linux-kernel, Moshe Shemesh, Dragos Tatulea

On 11/03/2026 5:20, Jakub Kicinski wrote:
> On Mon, 9 Mar 2026 11:55:18 +0200 Tariq Toukan wrote:
>> Report RX checksum statistics via the netdev queue stats API by mapping
>> the existing csum_complete, csum_unnecessary, csum_unnecessary_inner,
>> and csum_none counters to the csum_complete, csum_unnecessary and
>> csum_none fields.
> 
> The doc doesnt say clearly but I'd assume this should also count wire
> frames for consistency with the Tx one

Makes sense, so this also doesn't fit naturally.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH net-next V2 3/5] net/mlx5e: Report TX csum netdev stats
  2026-03-12  9:50     ` Gal Pressman
@ 2026-03-12 14:22       ` Jakub Kicinski
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2026-03-12 14:22 UTC (permalink / raw)
  To: Gal Pressman
  Cc: Tariq Toukan, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	David S. Miller, Saeed Mahameed, Mark Bloch, Leon Romanovsky,
	netdev, linux-rdma, linux-kernel, Moshe Shemesh, Dragos Tatulea

On Thu, 12 Mar 2026 11:50:10 +0200 Gal Pressman wrote:
> > Looking at drivers currently implementing this it seems like the idea
> > was to avoid having to increment two counters in the drivers, given
> > that TSO always implies csum offload  
> 
> I don't think I understand what you're trying to say here.

The existing drivers seem to do something like:

	tx->needs_csum += just_csum + tso_segs;

IOW for packets that need tso/uso they don't increment any csum stat 
on the fastpath.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-03-12 14:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09  9:55 [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
2026-03-09  9:55 ` [PATCH net-next V2 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
2026-03-11  3:12   ` Jakub Kicinski
2026-03-12  9:49     ` Gal Pressman
2026-03-09  9:55 ` [PATCH net-next V2 2/5] net/mlx5e: Report RX HW-GRO " Tariq Toukan
2026-03-11  3:14   ` Jakub Kicinski
2026-03-09  9:55 ` [PATCH net-next V2 3/5] net/mlx5e: Report TX csum " Tariq Toukan
2026-03-11  3:18   ` Jakub Kicinski
2026-03-12  9:50     ` Gal Pressman
2026-03-12 14:22       ` Jakub Kicinski
2026-03-09  9:55 ` [PATCH net-next V2 4/5] net/mlx5e: Report RX " Tariq Toukan
2026-03-11  3:20   ` Jakub Kicinski
2026-03-12  9:50     ` Gal Pressman
2026-03-09  9:55 ` [PATCH net-next V2 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
2026-03-10 17:38 ` [PATCH net-next V2 0/5] net/mlx5e: Report more netdev stats Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox