From: Jesse Gross Date: Thu, 6 May 2010 22:15:50 +0000 (-0700) Subject: datapath: Break out test for dev_disable_lro(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=090847a35fad779bf42061364d282619e07b8f80;p=openvswitch datapath: Break out test for dev_disable_lro(). It seems that dev_disable_lro() and skb_warn_if_lro() are not always defined at the same time, despite the fact that they are typically used together. This independently tests for them. --- diff --git a/acinclude.m4 b/acinclude.m4 index e52a884d..4c8cbdb3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -166,6 +166,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ [kmemdup], [OVS_DEFINE([HAVE_KMEMDUP])]) OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_warn_if_lro], [OVS_DEFINE([HAVE_SKB_WARN_LRO])]) + OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro], + [OVS_DEFINE([HAVE_DEV_DISABLE_LRO])]) # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the # member but retain the kerneldoc comment that describes it (which diff --git a/datapath/linux-2.6/compat-2.6/dev-openvswitch.c b/datapath/linux-2.6/compat-2.6/dev-openvswitch.c index 2bec4713..5b7444bb 100644 --- a/datapath/linux-2.6/compat-2.6/dev-openvswitch.c +++ b/datapath/linux-2.6/compat-2.6/dev-openvswitch.c @@ -1,4 +1,4 @@ -#ifndef HAVE_SKB_WARN_LRO +#ifndef HAVE_DEV_DISABLE_LRO #include @@ -25,7 +25,8 @@ void dev_disable_lro(struct net_device *dev) } WARN_ON(dev->features & NETIF_F_LRO); } - +#else +void dev_disable_lro(struct net_device *dev) { } #endif /* NETIF_F_LRO */ -#endif /* HAVE_SKB_WARN_LRO */ +#endif /* HAVE_DEV_DISABLE_LRO */ 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 b7fe8deb..2a05f370 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 @@ -73,7 +73,7 @@ extern void unregister_netdevice_queue(struct net_device *dev, extern void unregister_netdevice_many(struct list_head *head); #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) +#ifndef HAVE_DEV_DISABLE_LRO extern void dev_disable_lro(struct net_device *dev); #endif diff --git a/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c b/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c index 79917065..e639b5a1 100644 --- a/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c +++ b/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c @@ -1,4 +1,4 @@ -#ifndef HAVE_SKB_WARN_LRO +#if !defined(HAVE_SKB_WARN_LRO) && defined(NETIF_F_LRO) #include @@ -9,4 +9,4 @@ void __skb_warn_lro_forwarding(const struct sk_buff *skb) " while LRO is enabled\n", skb->dev->name); } -#endif /* HAVE_SKB_WARN_LRO */ +#endif