* [PATCH net-next 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes netdev stats
2026-02-04 19:33 [PATCH net-next 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
@ 2026-02-04 19:33 ` Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes " Tariq Toukan
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Tariq Toukan @ 2026-02-04 19:33 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 96dc6a6dc737..0e955568c2f4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5550,6 +5550,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,
@@ -5589,6 +5593,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];
@@ -5615,6 +5621,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;
}
}
@@ -5633,6 +5643,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] 8+ messages in thread* [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes netdev stats
2026-02-04 19:33 [PATCH net-next 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
@ 2026-02-04 19:33 ` Tariq Toukan
2026-02-05 5:23 ` Jakub Kicinski
2026-02-04 19:33 ` [PATCH net-next 3/5] net/mlx5e: Report TX csum " Tariq Toukan
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Tariq Toukan @ 2026-02-04 19:33 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 and gro_bytes counters to the
hw_gro_packets and hw_gro_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 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 0e955568c2f4..774a2e32d5f9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5532,6 +5532,10 @@ 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_packets + xskrq_stats->gro_packets;
+ stats->hw_gro_bytes = rq_stats->gro_bytes + xskrq_stats->gro_bytes;
}
static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
@@ -5568,6 +5572,8 @@ 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_bytes = 0;
for (i = priv->channels.params.num_channels; i < priv->stats_nch; i++) {
struct netdev_queue_stats_rx rx_i = {0};
@@ -5577,6 +5583,8 @@ 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_bytes += rx_i.hw_gro_bytes;
}
/* always report PTP RX stats from base as there is no
@@ -5588,6 +5596,8 @@ 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_packets;
+ rx->hw_gro_bytes += rq_stats->gro_bytes;
}
}
--
2.44.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes netdev stats
2026-02-04 19:33 ` [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes " Tariq Toukan
@ 2026-02-05 5:23 ` Jakub Kicinski
2026-02-05 7:43 ` Gal Pressman
0 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2026-02-05 5:23 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 Wed, 4 Feb 2026 21:33:12 +0200 Tariq Toukan wrote:
> + stats->hw_gro_packets =
> + rq_stats->gro_packets + xskrq_stats->gro_packets;
> + stats->hw_gro_bytes = rq_stats->gro_bytes + xskrq_stats->gro_bytes;
Doesn't look right..
mlx5e_shampo_flush_skb(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match)
{
struct sk_buff *skb = rq->hw_gro_data->skb;
struct mlx5e_rq_stats *stats = rq->stats;
u16 gro_count = NAPI_GRO_CB(skb)->count;
if (likely(skb_shinfo(skb)->nr_frags))
mlx5e_shampo_align_fragment(skb, rq->mpwqe.log_stride_sz);
if (gro_count > 1) {
stats->gro_skbs++;
stats->gro_packets += gro_count;
And:
-
name: rx-hw-gro-packets
doc: |
Number of packets that were coalesced from smaller packets by the
device. Counts only packets coalesced with the HW-GRO netdevice
feature, LRO-coalesced packets are not counted.
-
name: rx-hw-gro-wire-packets
doc: |
Number of packets that were coalesced to bigger packetss with the
HW-GRO netdevice feature. LRO-coalesced packets are not counted.
type: uint
Your gro_packets are "gro-wire-packets" and "gro-packets" are your
gro_skbs.
I really wish the AI was clever enough to catch uAPI mis-reading :(
--
pw-bot: cr
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes netdev stats
2026-02-05 5:23 ` Jakub Kicinski
@ 2026-02-05 7:43 ` Gal Pressman
0 siblings, 0 replies; 8+ messages in thread
From: Gal Pressman @ 2026-02-05 7:43 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 05/02/2026 7:23, Jakub Kicinski wrote:
> On Wed, 4 Feb 2026 21:33:12 +0200 Tariq Toukan wrote:
>> + stats->hw_gro_packets =
>> + rq_stats->gro_packets + xskrq_stats->gro_packets;
>> + stats->hw_gro_bytes = rq_stats->gro_bytes + xskrq_stats->gro_bytes;
>
> Doesn't look right..
>
> mlx5e_shampo_flush_skb(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match)
> {
> struct sk_buff *skb = rq->hw_gro_data->skb;
> struct mlx5e_rq_stats *stats = rq->stats;
> u16 gro_count = NAPI_GRO_CB(skb)->count;
>
> if (likely(skb_shinfo(skb)->nr_frags))
> mlx5e_shampo_align_fragment(skb, rq->mpwqe.log_stride_sz);
> if (gro_count > 1) {
> stats->gro_skbs++;
> stats->gro_packets += gro_count;
>
> And:
> -
> name: rx-hw-gro-packets
> doc: |
> Number of packets that were coalesced from smaller packets by the
> device. Counts only packets coalesced with the HW-GRO netdevice
> feature, LRO-coalesced packets are not counted.
>
> -
> name: rx-hw-gro-wire-packets
> doc: |
> Number of packets that were coalesced to bigger packetss with the
> HW-GRO netdevice feature. LRO-coalesced packets are not counted.
> type: uint
>
> Your gro_packets are "gro-wire-packets" and "gro-packets" are your
> gro_skbs.
You're absolutely right, thanks Jakub!
>
> I really wish the AI was clever enough to catch uAPI mis-reading :(
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 3/5] net/mlx5e: Report TX csum netdev stats
2026-02-04 19:33 [PATCH net-next 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 1/5] net/mlx5e: Report hw_gso_packets and hw_gso_bytes " Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes " Tariq Toukan
@ 2026-02-04 19:33 ` Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 4/5] net/mlx5e: Report RX " Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
4 siblings, 0 replies; 8+ messages in thread
From: Tariq Toukan @ 2026-02-04 19:33 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 774a2e32d5f9..8c4ab3f81bbc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5558,6 +5558,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,
@@ -5605,6 +5609,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];
@@ -5635,6 +5641,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;
}
}
@@ -5657,6 +5666,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] 8+ messages in thread* [PATCH net-next 4/5] net/mlx5e: Report RX csum netdev stats
2026-02-04 19:33 [PATCH net-next 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
` (2 preceding siblings ...)
2026-02-04 19:33 ` [PATCH net-next 3/5] net/mlx5e: Report TX csum " Tariq Toukan
@ 2026-02-04 19:33 ` Tariq Toukan
2026-02-04 19:33 ` [PATCH net-next 5/5] net/mlx5e: Report stop and wake TX queue stats Tariq Toukan
4 siblings, 0 replies; 8+ messages in thread
From: Tariq Toukan @ 2026-02-04 19:33 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 8c4ab3f81bbc..036587123a6a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5536,6 +5536,14 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i,
stats->hw_gro_packets =
rq_stats->gro_packets + xskrq_stats->gro_packets;
stats->hw_gro_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,
@@ -5578,6 +5586,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
rx->alloc_fail = 0;
rx->hw_gro_packets = 0;
rx->hw_gro_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};
@@ -5589,6 +5600,9 @@ static void mlx5e_get_base_stats(struct net_device *dev,
rx->alloc_fail += rx_i.alloc_fail;
rx->hw_gro_packets += rx_i.hw_gro_packets;
rx->hw_gro_bytes += rx_i.hw_gro_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
@@ -5602,6 +5616,11 @@ static void mlx5e_get_base_stats(struct net_device *dev,
rx->bytes += rq_stats->bytes;
rx->hw_gro_packets += rq_stats->gro_packets;
rx->hw_gro_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] 8+ messages in thread* [PATCH net-next 5/5] net/mlx5e: Report stop and wake TX queue stats
2026-02-04 19:33 [PATCH net-next 0/5] net/mlx5e: Report more netdev stats Tariq Toukan
` (3 preceding siblings ...)
2026-02-04 19:33 ` [PATCH net-next 4/5] net/mlx5e: Report RX " Tariq Toukan
@ 2026-02-04 19:33 ` Tariq Toukan
4 siblings, 0 replies; 8+ messages in thread
From: Tariq Toukan @ 2026-02-04 19:33 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 036587123a6a..4ed0449a27bd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5570,6 +5570,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,
@@ -5630,6 +5633,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];
@@ -5663,6 +5668,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;
}
}
@@ -5688,6 +5695,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] 8+ messages in thread