From: Flavio Leitner <fleitner@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: Re: [PATCH v2] e1000e: convert to stats64
Date: Thu, 16 Dec 2010 11:10:21 -0200 [thread overview]
Message-ID: <20101216131021.GA20139@redhat.com> (raw)
In-Reply-To: <1292503830.2883.92.camel@edumazet-laptop>
On Thu, Dec 16, 2010 at 01:50:30PM +0100, Eric Dumazet wrote:
> Le jeudi 16 décembre 2010 à 10:31 -0200, Flavio Leitner a écrit :
>
> > -static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
> > +struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
> > + struct rtnl_link_stats64 *stats)
> > {
> > - /* only return the current stats */
> > - return &netdev->stats;
> > + struct e1000_adapter *adapter = netdev_priv(netdev);
> > +
> > + memset(stats, 0, sizeof(struct rtnl_link_stats64));
>
> You dont need this memset(), stats is cleared by caller (dev_get_stats()
> in net/core/dev.c), as this was always done ;)
Yes, but e1000_get_ethtool_stats() also calls it and doesn't do that.
I could move the memset to the caller, but I thought it would be cleaner
to leave where it is now.
> > + spin_lock(&adapter->stats64_lock);
> > + e1000e_update_stats(adapter);
> > + /* Fill out the OS statistics structure */
> > + stats->rx_bytes = adapter->stats.gorc;
> > + stats->rx_packets = adapter->stats.gprc;
> > + stats->tx_bytes = adapter->stats.gotc;
> > + stats->tx_packets = adapter->stats.gptc;
> > + stats->multicast = adapter->stats.mprc;
> > + stats->collisions = adapter->stats.colc;
> > +
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Flavio
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
next prev parent reply other threads:[~2010-12-16 13:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 20:32 [PATCH] e1000e: convert to stats64 Flavio Leitner
2010-12-14 21:29 ` Eric Dumazet
2010-12-16 12:31 ` [PATCH v2] " Flavio Leitner
2010-12-16 12:50 ` Eric Dumazet
2010-12-16 13:10 ` Flavio Leitner [this message]
2010-12-16 13:18 ` Eric Dumazet
2010-12-17 3:14 ` Jeff Kirsher
2011-01-21 17:03 ` Flavio Leitner
2011-01-21 22:19 ` Jeff Kirsher
2010-12-15 23:59 ` [PATCH] " Jeff Kirsher
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=20101216131021.GA20139@redhat.com \
--to=fleitner@redhat.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=eric.dumazet@gmail.com \
--cc=jeffrey.t.kirsher@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).