datapath: Fix build with backported dev_get_stats().
authorJustin Pettit <jpettit@nicira.com>
Mon, 17 May 2010 21:13:32 +0000 (14:13 -0700)
committerJustin Pettit <jpettit@nicira.com>
Mon, 17 May 2010 22:07:10 +0000 (15:07 -0700)
An upcoming backport adds dev_get_stats() to a pre-2.6.29 Linux kernel, so we
have to check for the presence of an dev_get_stats() definition instead of for
the particular kernel version.

acinclude.m4
datapath/linux-2.6/compat-2.6/include/linux/netdevice.h

index 8643cf7..6a37443 100644 (file)
@@ -150,6 +150,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
 
   OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro],
                   [OVS_DEFINE([HAVE_DEV_DISABLE_LRO])])
+  OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_stats],
+                  [OVS_DEFINE([HAVE_DEV_GET_STATS])])
 
   # Check for the proto_data_valid member in struct sk_buff.  The [^@]
   # is necessary because some versions of this header remove the
index 2a05f37..1e354e7 100644 (file)
@@ -77,7 +77,7 @@ 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)
+#ifndef HAVE_DEV_GET_STATS
 static inline const struct net_device_stats *
 dev_get_stats(struct net_device *dev)
 {