public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Neftin, Sasha" <sasha.neftin@intel•com>
To: "netdev@vger•kernel.org" <netdev@vger•kernel.org>
Cc: intel-wired-lan@lists•osuosl.org, "Ruinskiy,
	Dima" <dima.ruinskiy@intel•com>
Subject: Re: [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats
Date: Mon, 24 Apr 2017 11:17:39 +0300	[thread overview]
Message-ID: <caef8d69-9e47-bbcc-0758-e5900e1cb291@intel.com> (raw)
In-Reply-To: <630A6B92B7EDEB45A87E20D3D286660171182EED@hasmsx109.ger.corp.intel.com>

On 4/23/2017 15:53, Neftin, Sasha wrote:
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists•osuosl.org] On Behalf Of Benjamin Poirier
> Sent: Saturday, April 22, 2017 00:20
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel•com>
> Cc: netdev@vger•kernel.org; intel-wired-lan@lists•osuosl.org; Stefan Priebe <s.priebe@profihost•ag>
> Subject: [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats
>
> 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
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@lists•osuosl.org
> http://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Hello,

We would like to not accept this patch. Suggested generic method 
'*dev_get_stats' (net/core/dev.c) calls 'ops->ndo_get_stats64' method 
which eventually calls e1000e_get_stats64 (netdev.c) - so there is same 
functionality. Also, see that 'e1000e_get_stats64' method in netdev.c 
(line 5928) calls 'memset' with 0's before update statistics.  Local 
sanity check in our lab shows 'tx_heartbeat_errors' counter reported as 0.

Thanks,

Sasha

  parent reply	other threads:[~2017-04-24  8:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Neftin, Sasha [this message]
2017-04-24 19:10     ` [Intel-wired-lan] [PATCH 1/2] e1000e: Don't return uninitialized stats 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=caef8d69-9e47-bbcc-0758-e5900e1cb291@intel.com \
    --to=sasha.neftin@intel$(echo .)com \
    --cc=dima.ruinskiy@intel$(echo .)com \
    --cc=intel-wired-lan@lists$(echo .)osuosl.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox