datapath: Backport consume_skb().
authorJesse Gross <jesse@nicira.com>
Thu, 16 Jun 2011 22:14:08 +0000 (15:14 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 17 Jun 2011 00:03:29 +0000 (17:03 -0700)
Kernels before 2.6.30 did not implement consume_skb() although RHEL
backports it.  For other kernels, this provides a backport.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
acinclude.m4
datapath/linux-2.6/compat-2.6/include/linux/skbuff.h

index 3cf793d425b61487e4a4e801c8e5d5b87e995ffb..63a036e3d16123082c2ce21ef53f967af26cba15 100644 (file)
@@ -204,6 +204,7 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
                   [OVS_DEFINE([HAVE_ICMP6_HDR])])
   OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_warn_if_lro],
                   [OVS_DEFINE([HAVE_SKB_WARN_LRO])])
+  OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [consume_skb])
 
   OVS_GREP_IFELSE([$KSRC26/include/linux/string.h], [kmemdup], [],
                   [OVS_GREP_IFELSE([$KSRC26/include/linux/slab.h], [kmemdup])])
index 9cd7e1d5d67a89dcf979d42dc23f14e583c79b55..b728c51793d3c4658a37adea2bb6861954b29f87 100644 (file)
@@ -228,4 +228,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
 #endif /* NETIF_F_LRO */
 #endif /* HAVE_SKB_WARN_LRO */
 
+#ifndef HAVE_CONSUME_SKB
+#define consume_skb kfree_skb
+#endif
+
 #endif