[ovs-dev] [PATCH 1/2] datapath: Backport consume_skb().

Jesse Gross jesse at nicira.com
Thu Jun 16 23:10:52 UTC 2011


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 at nicira.com>
---
 acinclude.m4                                       |    1 +
 .../linux-2.6/compat-2.6/include/linux/skbuff.h    |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 3cf793d..63a036e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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])])
diff --git a/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h b/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h
index 9cd7e1d..b728c51 100644
--- a/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h
+++ b/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h
@@ -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
-- 
1.7.4.1




More information about the dev mailing list