public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
Date: Thu, 11 Mar 2010 21:19:58 +0100	[thread overview]
Message-ID: <1268338798.2845.3.camel@edumazet-laptop> (raw)
In-Reply-To: <1268337450-6749-4-git-send-email-jengelh@medozas.de>

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@medozas.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;
> -- 



  parent reply	other threads:[~2010-03-11 20:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 19:57 [net-next] IFLA_STATS64, tcp cong modules Jan Engelhardt
2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt
2010-03-11 20:10   ` Stephen Hemminger
2010-03-11 20:19     ` Jan Engelhardt
2010-03-17  4:29   ` David Miller
2010-03-11 19:57 ` [PATCH 2/3] net: tcp: make veno " Jan Engelhardt
2010-03-17  4:29   ` David Miller
2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt
2010-03-11 20:12   ` Stephen Hemminger
2010-03-11 20:26     ` David Miller
2010-03-11 21:07       ` Jan Engelhardt
2010-03-11 21:30         ` David Miller
2010-03-11 22:04       ` Stephen Hemminger
2010-03-11 22:13         ` Jan Engelhardt
2010-03-11 22:50           ` Stephen Hemminger
2010-03-11 22:54             ` David Miller
2010-03-11 23:10               ` Stephen Hemminger
2010-03-11 23:15                 ` David Miller
2010-03-11 23:44                   ` Stephen Hemminger
2010-03-11 22:13         ` David Miller
2010-03-11 22:15           ` Jan Engelhardt
2010-03-11 20:19   ` Eric Dumazet [this message]
2010-03-17  4:29   ` 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=1268338798.2845.3.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jengelh@medozas.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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