From: Pravin B Shelar Date: Wed, 4 Dec 2013 19:26:36 +0000 (-0800) Subject: datapath: Add compile time check for rxhash X-Git-Tag: sliver-openvswitch-2.0.90-1~1^2~16 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=60c4904fec5a26fcd5d46eaacd87a6601a9ea470 datapath: Add compile time check for rxhash Some distribution kernel has backported skb->rxhash (e.g. RHEL) Following patch allows use precalculated rxhash. Signed-off-by: Pravin B Shelar Reviewed-by: Thomas Graf Acked-by: Jesse Gross --- diff --git a/acinclude.m4 b/acinclude.m4 index f987fa0bd..94f9b6186 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -240,6 +240,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], [rxhash]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_dst(], [OVS_DEFINE([HAVE_SKB_DST_ACCESSOR_FUNCS])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], diff --git a/datapath/linux/compat/flow_dissector.c b/datapath/linux/compat/flow_dissector.c index f176f9ae7..7a0d09b98 100644 --- a/datapath/linux/compat/flow_dissector.c +++ b/datapath/linux/compat/flow_dissector.c @@ -226,7 +226,7 @@ u32 __skb_get_rxhash(struct sk_buff *skb) if (!hash) hash = 1; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34) +#ifdef HAVE_RXHASH skb->rxhash = hash; #endif return hash; diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h index 3af3ddc0b..4f2260040 100644 --- a/datapath/linux/compat/include/linux/skbuff.h +++ b/datapath/linux/compat/include/linux/skbuff.h @@ -220,7 +220,7 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri) extern u32 __skb_get_rxhash(struct sk_buff *skb); static inline __u32 skb_get_rxhash(struct sk_buff *skb) { -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34) +#ifdef HAVE_RXHASH if (skb->rxhash) return skb->rxhash; #endif