netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] e1000e: Don't return uninitialized stats
@ 2017-04-21 21:20 Benjamin Poirier
  2017-04-21 21:20 ` [PATCH 2/2] igb: Remove useless argument Benjamin Poirier
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Benjamin Poirier @ 2017-04-21 21:20 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Stefan Priebe, intel-wired-lan, netdev

Some statistics passed to ethtool are garbage because e1000e_get_stats64()
doesn't write them, for example: tx_heartbeat_errors. This leaks kernel
memory to userspace and confuses users.

Do like ixgbe and use dev_get_stats() which first zeroes out
rtnl_link_stats64.

Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
---
 drivers/net/ethernet/intel/e1000e/ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index 7aff68a4a4df..f117b90cdc2f 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -2063,7 +2063,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
 
 	pm_runtime_get_sync(netdev->dev.parent);
 
-	e1000e_get_stats64(netdev, &net_stats);
+	dev_get_stats(netdev, &net_stats);
 
 	pm_runtime_put_sync(netdev->dev.parent);
 
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-05-19 21:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-21 21:20 [PATCH 1/2] e1000e: Don't return uninitialized stats Benjamin Poirier
2017-04-21 21:20 ` [PATCH 2/2] igb: Remove useless argument Benjamin Poirier
     [not found] ` <630A6B92B7EDEB45A87E20D3D286660171182EED@hasmsx109.ger.corp.intel.com>
2017-04-24  8:17   ` [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats Neftin, Sasha
2017-04-24 19:10     ` Benjamin Poirier
2017-04-25  7:10       ` Brown, Aaron F
2017-04-25  9:07         ` Jeff Kirsher
2017-04-25 17:54           ` Benjamin Poirier
2017-05-17 20:24             ` [PATCH v2] " Benjamin Poirier
2017-05-18 14:46               ` David Miller
2017-05-19  8:16                 ` Jeff Kirsher
2017-05-19 21:12                   ` Brown, Aaron F
     [not found]           ` <20170425105405.01541742@xeon-e3>
2017-04-25 18:44             ` [Intel-wired-lan] [PATCH 1/2] " Benjamin Poirier
2017-04-24  8:23 ` Paul Menzel
2017-04-24 19:01   ` Benjamin Poirier
2017-04-24 19:15     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).