datapath: Add support for RHEL-7 / CentOS-7 kernel.
[cascardo/ovs.git] / datapath / linux / compat / include / linux / skbuff.h
index a9dc2e7..7be0271 100644 (file)
@@ -3,8 +3,13 @@
 
 #include_next <linux/skbuff.h>
 
+#include <linux/jhash.h>
 #include <linux/version.h>
 
+#ifndef HAVE_IGNORE_DF_RENAME
+#define ignore_df local_df
+#endif
+
 #ifndef HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET
 static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
                                                    const int offset, void *to,
@@ -260,7 +265,11 @@ static inline __u32 skb_get_hash(struct sk_buff *skb)
 {
 #ifdef HAVE_RXHASH
        if (skb->rxhash)
+#ifndef HAVE_U16_RXHASH
                return skb->rxhash;
+#else
+               return jhash_1word(skb->rxhash, 0);
+#endif
 #endif
        return __skb_get_hash(skb);
 }
@@ -279,6 +288,10 @@ static inline void skb_tx_error(struct sk_buff *skb)
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
+#endif
+
+#ifndef HAVE_SKB_ZEROCOPY
+#define skb_zerocopy rpl_skb_zerocopy
 int skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len,
                  int hlen);
 #endif
@@ -286,10 +299,10 @@ int skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len,
 #ifndef HAVE_SKB_CLEAR_HASH
 static inline void skb_clear_hash(struct sk_buff *skb)
 {
-#if HAVE_RXHASH
+#ifdef HAVE_RXHASH
        skb->rxhash = 0;
 #endif
-#if HAVE_L4_RXHASH
+#ifdef HAVE_L4_RXHASH
        skb->l4_rxhash = 0;
 #endif
 }