From: Tadaaki Nagao Date: Thu, 12 Jul 2012 07:25:29 +0000 (+0900) Subject: datapath: Check for backported skb_frag_page(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c4ea27c48b30eaec8e37e642d5072f53c5b2670;p=openvswitch datapath: Check for backported skb_frag_page(). Recently released CentOS 6.3 (and probably also RHEL 6.3, I assume) backported skb_frag_page() and others to their 2.6.32-based kernel, which caused build failure of Open vSwitch kernel modules. Signed-off-by: Tadaaki Nagao Signed-off-by: Jesse Gross --- diff --git a/acinclude.m4 b/acinclude.m4 index 43f044a9..b5876a88 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -247,6 +247,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_warn_if_lro], [OVS_DEFINE([HAVE_SKB_WARN_LRO])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [consume_skb]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_frag_page]) OVS_GREP_IFELSE([$KSRC/include/linux/string.h], [kmemdup], [], [OVS_GREP_IFELSE([$KSRC/include/linux/slab.h], [kmemdup])]) diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h index 01e524ef..7fbe9d81 100644 --- a/datapath/linux/compat/include/linux/skbuff.h +++ b/datapath/linux/compat/include/linux/skbuff.h @@ -238,7 +238,7 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb) #define consume_skb kfree_skb #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) +#ifndef HAVE_SKB_FRAG_PAGE static inline struct page *skb_frag_page(const skb_frag_t *frag) { return frag->page;