]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5e: Report RX HW-GRO netdev stats
authorGal Pressman <gal@nvidia.com>
Mon, 4 May 2026 18:37:02 +0000 (21:37 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 May 2026 01:38:57 +0000 (18:38 -0700)
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>
Link: https://patch.msgid.link/20260504183704.272322-4-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index f3a936d5a62db28d757dd393108fa9aa6a0bedd3..a8b55af21ec06c789846890e31826c6558b9cb01 100644 (file)
@@ -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;
                }
        }