diff options
author | Simon Horman <horms@verge.net.au> | 2010-08-23 15:30:11 +0900 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2010-08-23 14:37:44 -0400 |
commit | 67b30fcde789088b2e43407167f9ad656c2cc1e5 (patch) | |
tree | 38a2dbfe364bfe5e67e17d5137d5b14fc60096a8 /datapath/vport-netdev.c | |
parent | 37f055c758e2d74ee4abc1ebca94aa62700f3ca0 (diff) |
datapath: Use rtnl_link_stats64
This adds compatibility with a series kernel changesets that
introduces 64bit statistics. The final changeset (to date) being
"net: Document that dev_get_stats() returns the given pointer".
The relevant changesets were added between 2.6.35 and 2.6.36-rc1.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/vport-netdev.c')
-rw-r--r-- | datapath/vport-netdev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index e93a5ff3..f6709e2a 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -211,9 +211,15 @@ struct kobject *netdev_get_kobj(const struct vport *vport) int netdev_get_stats(const struct vport *vport, struct odp_vport_stats *stats) { const struct netdev_vport *netdev_vport = netdev_vport_priv(vport); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) + struct rtnl_link_stats64 *netdev_stats, storage; + + netdev_stats = dev_get_stats(netdev_vport->dev, &storage); +#else const struct net_device_stats *netdev_stats; netdev_stats = dev_get_stats(netdev_vport->dev); +#endif stats->rx_bytes = netdev_stats->rx_bytes; stats->rx_packets = netdev_stats->rx_packets; |