[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101216131021.GA20139@redhat.com>
Date: Thu, 16 Dec 2010 11:10:21 -0200
From: Flavio Leitner <fleitner@...hat.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, e1000-devel@...ts.sourceforge.net,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Subject: Re: [PATCH v2] e1000e: convert to stats64
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@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Flavio
--
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