Skip to contentSkip to conversation

datapath: Fix build breakage on kernel 2.6.40

PATCH In review Zhi Yong Wu 2 participants 4 messages Nov 23, 2011 – Dec 2, 2011 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 datapath: Fix build breakage on kernel 2.6.40

From: Zhi Yong Wu <[email protected]>

Today i played with openvswitch on my workstation with kernel 2.6.40 and found that it break when i built. The issue is introduced by commit ceb176fdb72bb7ce90debc66e1eeb1d25823d30a

Below is the error log.

from /home/zwu/work/virt/openvswitch/datapath/linux/genetlink-brcompat.c:10:
/home/zwu/work/virt/openvswitch/datapath/linux/compat/include/linux/skbuff.h:243:20: error: redefinition of ‘skb_reset_mac_len’ include/linux/skbuff.h:1259:20: note: previous definition of ‘skb_reset_mac_len’ was here
make[5]: *** [/home/zwu/work/virt/openvswitch/datapath/linux/genetlink-brcompat.o] Error 1
make[4]: *** [_module_/home/zwu/work/virt/openvswitch/datapath/linux] Error 2
make[4]: Leaving directory `/usr/src/kernels/2.6.40.6-0.fc15.x86_64'
make[3]: *** [default] Error 2
make[3]: Leaving directory `/home/zwu/work/virt/openvswitch/datapath/linux'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/zwu/work/virt/openvswitch/datapath'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zwu/work/virt/openvswitch'
make: *** [all] Error 2

After this patch is applied, i can successfully do one build and be happy to see that multiple VMs can communicate with each other.

---
 acinclude.m4                                 |    2 ++
 datapath/linux/compat/include/linux/skbuff.h |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
acinclude.m4 +2 -0
index 648132a..32cdf17 100644
@@ -233,6 +233,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_cow_head])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_transport_header],
                   [OVS_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_reset_mac_len],
+                  [OVS_DEFINE([HAVE_SKB_RESET_MAC_LEN])])
   OVS_GREP_IFELSE([$KSRC/include/linux/icmpv6.h], [icmp6_hdr],
                   [OVS_DEFINE([HAVE_ICMP6_HDR])])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_warn_if_lro],
datapath/linux/compat/include/linux/skbuff.h +1 -1
index 311bfdb..22ba2e6 100644
@@ -239,7 +239,7 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#ifndef HAVE_SKB_RESET_MAC_LEN
 static inline void skb_reset_mac_len(struct sk_buff *skb)
 {
 	skb->mac_len = skb->network_header - skb->mac_header;
Signature · 6 lines
1.7.6

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
#2 lore raw
In reply to a message not in the archive

datapath/linux/compat/include/linux/skbuff.h static inline struct page *skb_frag_page(const skb_frag_t *frag) · line 242

Quoted 10 lines · Zhi Yong Wu
datapath/linux/compat/include/linux/skbuff.h +1 -1
index 311bfdb..22ba2e6 100644
@@ -239,7 +239,7 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
  }
  #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#ifndef HAVE_SKB_RESET_MAC_LEN

2.6.40 is the early name for 3.0. Does it work if you just replace the check with KERNEL_VERSION(2,6,40)?
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

#4 lore raw
In reply to a message not in the archive
Quoted 9 lines · Jesse Gross
Quoted 8 lines · Zhi Yong Wu
datapath/linux/compat/include/linux/skbuff.h +0 -0
index 311bfdb..22ba2e6 100644
@@ -239,7 +239,7 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
  }
  #endif
 
Quoted 5 lines

datapath/linux/compat/include/linux/skbuff.h static inline struct page *skb_frag_page(const skb_frag_t *frag) · line 242

Quoted 2 lines
datapath/linux/compat/include/linux/skbuff.h +1 -1
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#ifndef HAVE_SKB_RESET_MAC_LEN

2.6.40 is the early name for 3.0.  Does it work if you just replace the check with KERNEL_VERSION(2,6,40)?

Yeah, it can work now, but i don't know if this issue exist on other old kernel version < 2.6.40.

Should we send one updated patch for this based on your suggestion?

Signature · 3 lines
Regards,

Zhi Yong Wu
#6 lore raw
In reply to a message not in the archive
Quoted 10 lines · Zhi Yong Wu
Quoted 9 lines · Jesse Gross
Quoted 8 lines · Zhi Yong Wu
datapath/linux/compat/include/linux/skbuff.h +0 -0
index 311bfdb..22ba2e6 100644
@@ -239,7 +239,7 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
  }
  #endif
 
Quoted 7 lines
Quoted 5 lines

datapath/linux/compat/include/linux/skbuff.h static inline struct page *skb_frag_page(const skb_frag_t *frag) · line 242

Quoted 2 lines
datapath/linux/compat/include/linux/skbuff.h +1 -1
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#ifndef HAVE_SKB_RESET_MAC_LEN

2.6.40 is the early name for 3.0.  Does it work if you just replace the check with KERNEL_VERSION(2,6,40)?

Yeah, it can work now, but i don't know if this issue exist on other old kernel version < 2.6.40.

Usually we just do these types of checks as we see examples of actual backporting to avoid having hundreds of tests at configure time. In this case, I think the issue is just a difference in how the same kernel is numbered not backporting, so there isn't really a reason to believe that this is a bigger problem.

Quoted 1 line

Should we send one updated patch for this based on your suggestion?

That would be great, thanks.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev