[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260204193315.1722983-3-tariqt@nvidia.com>
Date: Wed, 4 Feb 2026 21:33:12 +0200
From: Tariq Toukan <tariqt@...dia.com>
To: Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
S. Miller" <davem@...emloft.net>
CC: Saeed Mahameed <saeedm@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
"Mark Bloch" <mbloch@...dia.com>, Leon Romanovsky <leon@...nel.org>,
<netdev@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Gal Pressman <gal@...dia.com>, Moshe Shemesh
<moshe@...dia.com>, Dragos Tatulea <dtatulea@...dia.com>
Subject: [PATCH net-next 2/5] net/mlx5e: Report hw_gro_packets and hw_gro_bytes netdev stats
From: Gal Pressman <gal@...dia.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@...dia.com>
Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
Signed-off-by: Tariq Toukan <tariqt@...dia.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
Powered by blists - more mailing lists