From 6c4ea27c48b30eaec8e37e642d5072f53c5b2670 Mon Sep 17 00:00:00 2001 From: Tadaaki Nagao Date: Thu, 12 Jul 2012 16:25:29 +0900 Subject: [PATCH] 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 --- acinclude.m4 | 1 + datapath/linux/compat/include/linux/skbuff.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 43f044a95..b5876a880 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 01e524ef7..7fbe9d81a 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; -- 2.43.0