]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: txgbe: add ethtool stats support
authorJiawen Wu <jiawenwu@trustnetic.com>
Wed, 11 Oct 2023 09:19:05 +0000 (17:19 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Oct 2023 23:56:07 +0000 (16:56 -0700)
Support to show ethtool statistics.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Link: https://lore.kernel.org/r/20231011091906.70486-3-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c
drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c

index 859da112586a427043e2f608793d4d81226bcc63..3f336a088e43f3340b8d4265700b76720acef759 100644 (file)
@@ -39,6 +39,11 @@ static const struct ethtool_ops txgbe_ethtool_ops = {
        .get_link               = ethtool_op_get_link,
        .get_link_ksettings     = txgbe_get_link_ksettings,
        .set_link_ksettings     = txgbe_set_link_ksettings,
+       .get_sset_count         = wx_get_sset_count,
+       .get_strings            = wx_get_strings,
+       .get_ethtool_stats      = wx_get_ethtool_stats,
+       .get_eth_mac_stats      = wx_get_mac_stats,
+       .get_pause_stats        = wx_get_pause_stats,
 };
 
 void txgbe_set_ethtool_ops(struct net_device *netdev)
index 37274525027002a42d21fa36ea6db39b03f5cb68..474d55524e82fa58d327911730f315fb6dfbcfeb 100644 (file)
@@ -306,6 +306,8 @@ int txgbe_reset_hw(struct wx *wx)
 
        txgbe_reset_misc(wx);
 
+       wx_clear_hw_cntrs(wx);
+
        /* Store the permanent mac address */
        wx_get_mac_addr(wx, wx->mac.perm_addr);
 
index 5c3aed516ac2082262bb90d00e0d8b10c8055310..394f699c51da6337d319a2c98c20da13b9ae7eeb 100644 (file)
@@ -286,6 +286,8 @@ static void txgbe_disable_device(struct wx *wx)
 
        /* Disable the Tx DMA engine */
        wr32m(wx, WX_TDM_CTL, WX_TDM_CTL_TE, 0);
+
+       wx_update_stats(wx);
 }
 
 static void txgbe_down(struct wx *wx)