[ovs-dev] [PATCH 02/16] datapath: Add dev_get_stats compatibility function.

Jesse Gross jesse at nicira.com
Tue Apr 13 14:41:04 UTC 2010


The dev_get_stats function wasn't added until 2.6.29 so provide
a replacement for it.
---
 .../linux-2.6/compat-2.6/include/linux/netdevice.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h b/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h
index 924dc0d..7080d01 100644
--- a/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h
+++ b/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h
@@ -77,4 +77,12 @@ extern void unregister_netdevice_many(struct list_head *head);
 extern void dev_disable_lro(struct net_device *dev);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+static inline const struct net_device_stats *
+dev_get_stats(struct net_device *dev)
+{
+	return dev->get_stats(dev);
+}
+#endif
+
 #endif
-- 
1.6.3.3





More information about the dev mailing list