Commit 6a009718 authored by Jiawen Wu's avatar Jiawen Wu Committed by Duanqiang Wen
Browse files

net: ngbe: add ethtool stats support

mainline inclusion
from mainline-v6.7-rc1
commit 0a2714d5e2d3bf57f42d2ee58a04416a42f84f89
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I93QRU
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a2714d5e2d3bf57f42d2ee58a04416a42f84f89



---------------------------------------------------------

Support to show ethtool statistics.

Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Link: https://lore.kernel.org/r/20231011091906.70486-4-jiawenwu@trustnetic.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDuanqiang Wen <duanqiangwen@net-swift.com>
parent a0063d54
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ static const struct ethtool_ops ngbe_ethtool_ops = {
	.nway_reset		= phy_ethtool_nway_reset,
	.get_wol		= ngbe_get_wol,
	.set_wol		= ngbe_set_wol,
	.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 ngbe_set_ethtool_ops(struct net_device *netdev)
+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ int ngbe_reset_hw(struct wx *wx)
	}
	ngbe_reset_misc(wx);

	wx_clear_hw_cntrs(wx);

	/* Store the permanent mac address */
	wx_get_mac_addr(wx, wx->mac.perm_addr);

+2 −0
Original line number Diff line number Diff line
@@ -330,6 +330,8 @@ static void ngbe_disable_device(struct wx *wx)

		wr32(wx, WX_PX_TR_CFG(reg_idx), WX_PX_TR_CFG_SWFLSH);
	}

	wx_update_stats(wx);
}

static void ngbe_down(struct wx *wx)