]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: airoha: Add missing stats to ethtool_eth_mac_stats
authorLorenzo Bianconi <lorenzo@kernel.org>
Mon, 13 Oct 2025 14:29:41 +0000 (16:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Oct 2025 02:35:45 +0000 (19:35 -0700)
Add the following stats to ethtool ethtool_eth_mac_stats stats:
- FramesTransmittedOK
- OctetsTransmittedOK
- FramesReceivedOK
- OctetsReceivedOK

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20251013-airoha-ethtool-improvements-v1-1-fdd1c6fc9be1@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.c

index 833dd911980b3f698bd7e5f9fd9e2ce131dd5222..2fe1f39558b80926439cc2f765eb5057464dd76e 100644 (file)
@@ -2022,8 +2022,12 @@ static void airoha_ethtool_get_mac_stats(struct net_device *dev,
        airoha_update_hw_stats(port);
        do {
                start = u64_stats_fetch_begin(&port->stats.syncp);
+               stats->FramesTransmittedOK = port->stats.tx_ok_pkts;
+               stats->OctetsTransmittedOK = port->stats.tx_ok_bytes;
                stats->MulticastFramesXmittedOK = port->stats.tx_multicast;
                stats->BroadcastFramesXmittedOK = port->stats.tx_broadcast;
+               stats->FramesReceivedOK = port->stats.rx_ok_pkts;
+               stats->OctetsReceivedOK = port->stats.rx_ok_bytes;
                stats->BroadcastFramesReceivedOK = port->stats.rx_broadcast;
        } while (u64_stats_fetch_retry(&port->stats.syncp, start));
 }