lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 26 May 2016 12:38:58 +0300
From:	Tariq Toukan <ttoukan.linux@...il.com>
To:	Eric Dumazet <edumazet@...gle.com>,
	"David S . Miller" <davem@...emloft.net>
Cc:	netdev <netdev@...r.kernel.org>,
	Willem de Bruijn <willemb@...gle.com>,
	Eugenia Emantayev <eugenia@...lanox.com>,
	Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH net 4/4] net/mlx4_en: get rid of private net_device_stats

Hi Eric,

Thanks for the fix.

> We do not need to clear fields that are already 0.
Why is it always true that dev->stats is already 0 at the point ndo_open 
is called?
Is it true also in a flow of open -> stop -> open? I searched the kernel 
stack for this but couldn't find.
> @@ -1877,7 +1877,6 @@ static void mlx4_en_clear_stats(struct net_device *dev)
>   	if (mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 1))
>   		en_dbg(HW, priv, "Failed dumping statistics\n");
>   
> -	memset(&priv->stats, 0, sizeof(priv->stats));
>   	memset(&priv->pstats, 0, sizeof(priv->pstats));
>   	memset(&priv->pkstats, 0, sizeof(priv->pkstats));
>   	memset(&priv->port_stats, 0, sizeof(priv->port_stats));
The role of this function is to clear the stats, no matter when and 
where it is called.
I am aware that clearing the stats structure might be redundant today, 
as the function is called only within mlx4_en_open, but we might want to 
call the function in other flows in the future.

Regards,
Tariq

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ