summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-03-11 15:16:02 -0800
committerJesse Gross <jesse@nicira.com>2011-03-14 09:53:37 -0700
commit23e795f4dd9af5191773a5ee840642737a37e91d (patch)
tree9eed4b80207588e48edb478a52007062d1b302a7
parent9cb8d24da006b562fecd17d34971822e3f6d1a78 (diff)
downloadopenvswitch-23e795f4dd9af5191773a5ee840642737a37e91d.tar.gz
datapath: Check for backported dev_get_by_index_rcu().
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--acinclude.m41
-rw-r--r--datapath/linux-2.6/compat-2.6/include/linux/netdevice.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index e2bd2c6ff..5843bfa58 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -167,6 +167,7 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro])
OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_stats])
+ OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_by_index_rcu])
OVS_GREP_IFELSE([$KSRC26/include/linux/rcupdate.h], [rcu_read_lock_held], [],
[OVS_GREP_IFELSE([$KSRC26/include/linux/rtnetlink.h],
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 da24b1c3f..04ebd89a7 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
@@ -124,7 +124,7 @@ static inline void netdev_rx_handler_unregister(struct net_device *dev)
#define dev_get_by_index_rcu(net, ifindex) dev_get_by_index_rcu(ifindex)
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#ifndef HAVE_DEV_GET_BY_INDEX_RCU
static inline struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex)
{
struct net_device *dev;