diff mbox series

[ovs-dev,V2,2/3] compat: Fix build issue on RHEL 7.7

Message ID 20201112231039.1973-3-gvrose8192@gmail.com
State Accepted
Headers show
Series Fix RHEL 7.7 build | expand

Commit Message

Gregory Rose Nov. 12, 2020, 11:10 p.m. UTC
RHEL 7.2 introduced a KABI fixup in struct sk_buff for the name
change of  l4_rxhash to l4_hash.  Then patch
9ba57fc7cccc ("datapath: Add hash info to upcall") introduced a
compile error by using l4_hash and not fixing up the HAVE_L4_RXHASH
configuration flag.

Remove all references to HAVE_L4_RXHASH and always use l4_hash to
resolve the issue.  This will break compilation on RHEL 7.0 and
RHEL 7.1 but dropping support for these older kernels shouldn't be
a problem.

Fixes: 9ba57fc7cccc ("datapath: Add hash info to upcall")
Signed-off-by: Greg Rose <gvrose8192@gmail.com>

---
V2 - Just removes l4_rxhash and ends support for RHEL 7.x < 7.2
---
 acinclude.m4                                 |  2 --
 datapath/datapath.c                          |  4 ----
 datapath/linux/compat/include/linux/skbuff.h | 10 ++--------
 3 files changed, 2 insertions(+), 14 deletions(-)

Comments

Yi-Hung Wei Nov. 13, 2020, 7:24 p.m. UTC | #1
On Thu, Nov 12, 2020 at 3:10 PM Greg Rose <gvrose8192@gmail.com> wrote:
>
> RHEL 7.2 introduced a KABI fixup in struct sk_buff for the name
> change of  l4_rxhash to l4_hash.  Then patch
> 9ba57fc7cccc ("datapath: Add hash info to upcall") introduced a
> compile error by using l4_hash and not fixing up the HAVE_L4_RXHASH
> configuration flag.
>
> Remove all references to HAVE_L4_RXHASH and always use l4_hash to
> resolve the issue.  This will break compilation on RHEL 7.0 and
> RHEL 7.1 but dropping support for these older kernels shouldn't be
> a problem.
>
> Fixes: 9ba57fc7cccc ("datapath: Add hash info to upcall")
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>
> ---
> V2 - Just removes l4_rxhash and ends support for RHEL 7.x < 7.2
> ---
Thanks for v2. Looks good to me.

Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>

> diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
> index bc73255d5..d3bc6c715 100644
> --- a/datapath/linux/compat/include/linux/skbuff.h
> +++ b/datapath/linux/compat/include/linux/skbuff.h
> @@ -278,9 +278,7 @@ static inline void skb_clear_hash(struct sk_buff *skb)
>  #ifdef HAVE_RXHASH
>         skb->rxhash = 0;
>  #endif
> -#if defined(HAVE_L4_RXHASH)
> -       skb->l4_rxhash = 0;
> -#endif
> +       skb->l4_hash = 0;

There is a space before the tab in this line.  When the maintainer
commits this patch, please help to remove the space.
Ilya Maximets Nov. 16, 2020, 7:29 p.m. UTC | #2
On 11/13/20 8:24 PM, Yi-Hung Wei wrote:
> On Thu, Nov 12, 2020 at 3:10 PM Greg Rose <gvrose8192@gmail.com> wrote:
>>
>> RHEL 7.2 introduced a KABI fixup in struct sk_buff for the name
>> change of  l4_rxhash to l4_hash.  Then patch
>> 9ba57fc7cccc ("datapath: Add hash info to upcall") introduced a
>> compile error by using l4_hash and not fixing up the HAVE_L4_RXHASH
>> configuration flag.
>>
>> Remove all references to HAVE_L4_RXHASH and always use l4_hash to
>> resolve the issue.  This will break compilation on RHEL 7.0 and
>> RHEL 7.1 but dropping support for these older kernels shouldn't be
>> a problem.
>>
>> Fixes: 9ba57fc7cccc ("datapath: Add hash info to upcall")
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>>
>> ---
>> V2 - Just removes l4_rxhash and ends support for RHEL 7.x < 7.2
>> ---
> Thanks for v2. Looks good to me.
> 
> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
> 
>> diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
>> index bc73255d5..d3bc6c715 100644
>> --- a/datapath/linux/compat/include/linux/skbuff.h
>> +++ b/datapath/linux/compat/include/linux/skbuff.h
>> @@ -278,9 +278,7 @@ static inline void skb_clear_hash(struct sk_buff *skb)
>>  #ifdef HAVE_RXHASH
>>         skb->rxhash = 0;
>>  #endif
>> -#if defined(HAVE_L4_RXHASH)
>> -       skb->l4_rxhash = 0;
>> -#endif
>> +       skb->l4_hash = 0;
> 
> There is a space before the tab in this line.  When the maintainer
> commits this patch, please help to remove the space.

Thanks!
  I fixed that.
Applied to master and backported down to 2.14.



Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 9c2236f9e..ddf4b71e1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -877,8 +877,6 @@  AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_clear_hash])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [int.skb_zerocopy(],
                   [OVS_DEFINE([HAVE_SKB_ZEROCOPY])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u8.*l4_rxhash],
-                  [OVS_DEFINE([HAVE_L4_RXHASH])])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_ensure_writable])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_pop])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [__skb_vlan_pop])
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 52a59f135..8e9b9a706 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -529,11 +529,7 @@  static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 		hash |= OVS_PACKET_HASH_SW_BIT;
 #endif
 
-#ifdef HAVE_L4_RXHASH
-	if (skb->l4_rxhash)
-#else
 	if (skb->l4_hash)
-#endif
 		hash |= OVS_PACKET_HASH_L4_BIT;
 
 	if (nla_put(user_skb, OVS_PACKET_ATTR_HASH, sizeof (u64), &hash)) {
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index bc73255d5..d3bc6c715 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -278,9 +278,7 @@  static inline void skb_clear_hash(struct sk_buff *skb)
 #ifdef HAVE_RXHASH
 	skb->rxhash = 0;
 #endif
-#if defined(HAVE_L4_RXHASH)
-	skb->l4_rxhash = 0;
-#endif
+ 	skb->l4_hash = 0;
 }
 #endif
 
@@ -371,7 +369,7 @@  static inline void skb_pop_mac_header(struct sk_buff *skb)
 #ifndef HAVE_SKB_CLEAR_HASH_IF_NOT_L4
 static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
 {
-	if (!skb->l4_rxhash)
+	if (!skb->l4_hash)
 		skb_clear_hash(skb);
 }
 #endif
@@ -465,11 +463,7 @@  __skb_set_hash(struct sk_buff *skb, __u32 hash, bool is_sw, bool is_l4)
 #else
 	skb->hash = hash;
 #endif
-#if defined(HAVE_L4_RXHASH)
-	skb->l4_rxhash = is_l4;
-#else
 	skb->l4_hash = is_l4;
-#endif
 #ifdef HAVE_SW_HASH
 	skb->sw_hash = is_sw;
 #endif