[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1292503830.2883.92.camel@edumazet-laptop>
Date: Thu, 16 Dec 2010 13:50:30 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Flavio Leitner <fleitner@...hat.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
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 ;)
> + 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
Powered by blists - more mailing lists