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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Mar 2010 21:19:58 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Jan Engelhardt <jengelh@...ozas.de>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH 3/3] net: core: add IFLA_STATS64 support

Le jeudi 11 mars 2010 à 20:57 +0100, Jan Engelhardt a écrit :
> `ip -s link` shows interface counters truncated to 32 bit. This is
> because interface statistics are transported only in 32-bit quantity
> to userspace. This commit adds a new IFLA_STATS64 attribute that
> exports them in full 64 bit.
> 
> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html

oh oh, back to  2003 :)

> Signed-off-by: Jan Engelhardt <jengelh@...ozas.de>
> ---
>  
>  static inline int rtnl_vfinfo_size(const struct net_device *dev)
>  {
> @@ -698,6 +730,14 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>  	stats = dev_get_stats(dev);

OK, stats is up2date with device stats

>  	copy_rtnl_link_stats(nla_data(attr), stats);
>  
> +	attr = nla_reserve(skb, IFLA_STATS64,
> +			sizeof(struct rtnl_link_stats64));
> +	if (attr == NULL)
> +		goto nla_put_failure;
> +
> +	stats = dev_get_stats(dev);

Why calling dev_get_stats(dev) a second time ?
Its can be pretty expensive on some devices.

> +	copy_rtnl_link_stats64(nla_data(attr), stats);
> +
>  	if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
>  		int i;
>  		struct ifla_vf_info ivi;
> -- 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists