[ovs-dev] [PATCH 1/2] datapath: backport kfree_skb_list()

Pravin B Shelar pshelar at nicira.com
Mon Mar 9 22:11:56 UTC 2015


Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
---
 acinclude.m4                                 |    1 +
 datapath/linux/compat/include/linux/skbuff.h |    3 +++
 datapath/linux/compat/skbuff-openvswitch.c   |   12 ++++++++++++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 18598b3..9acbfe9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -316,6 +316,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   # quoting rules.
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [[[^@]]proto_data_valid],
                   [OVS_DEFINE([HAVE_PROTO_DATA_VALID])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [rxhash])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u16.*rxhash],
                   [OVS_DEFINE([HAVE_U16_RXHASH])])
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index 78d84cc..06e58fb 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -352,4 +352,7 @@ int skb_vlan_pop(struct sk_buff *skb);
 int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
 #endif
 
+#ifndef HAVE_KFREE_SKB_LIST
+void kfree_skb_list(struct sk_buff *segs);
+#endif
 #endif
diff --git a/datapath/linux/compat/skbuff-openvswitch.c b/datapath/linux/compat/skbuff-openvswitch.c
index 5de43b3..bf9948e 100644
--- a/datapath/linux/compat/skbuff-openvswitch.c
+++ b/datapath/linux/compat/skbuff-openvswitch.c
@@ -234,3 +234,15 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
 	return 0;
 }
 #endif
+
+#ifndef HAVE_KFREE_SKB_LIST
+void kfree_skb_list(struct sk_buff *segs)
+{
+	while (segs) {
+		struct sk_buff *next = segs->next;
+
+		kfree_skb(segs);
+		segs = next;
+	}
+}
+#endif
-- 
1.7.1




More information about the dev mailing list