Skip to content

Commit

Permalink
net: txgbe: add ethtool stats support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiawen Wu authored and Jakub Kicinski committed Oct 13, 2023
1 parent 46b92e1 commit 9224ade
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9224ade

Please sign in to comment.