diff mbox

[ovs-dev] datapath: Fix compilation on kernel 2.6.32

Message ID 1444422090-1799-1-git-send-email-pshelar@nicira.com
State Accepted
Headers show

Commit Message

Pravin B Shelar Oct. 9, 2015, 8:21 p.m. UTC
Fixes following compilation error:

CC [M]  /home/travis/build/openvswitch/ovs/datapath/linux/actions.o

In file included from
/home/travis/build/openvswitch/ovs/datapath/linux/actions.c:21:0:

/home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:
In function ‘rpl_skb_postpull_rcsum’:

/home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:384:4:
error: implicit declaration of function ‘skb_checksum_start_offset’
[-Werror=implicit-function-declaration]

cc1: some warnings being treated as errors

Reported-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
 acinclude.m4                                 |    1 +
 datapath/linux/compat/include/linux/skbuff.h |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

Comments

Joe Stringer Oct. 9, 2015, 9:03 p.m. UTC | #1
On 9 October 2015 at 13:21, Pravin B Shelar <pshelar@nicira.com> wrote:
> Fixes following compilation error:
>
> CC [M]  /home/travis/build/openvswitch/ovs/datapath/linux/actions.o
>
> In file included from
> /home/travis/build/openvswitch/ovs/datapath/linux/actions.c:21:0:
>
> /home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:
> In function ‘rpl_skb_postpull_rcsum’:
>
> /home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:384:4:
> error: implicit declaration of function ‘skb_checksum_start_offset’
> [-Werror=implicit-function-declaration]
>
> cc1: some warnings being treated as errors
>
> Reported-by: Joe Stringer <joestringer@nicira.com>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>

Is there a reason that we shouldn't backport skb_checksum_start_offset()?

This fixes the compile issue, so if we're happy that this doesn't
cause a regression on commit a2cf7524787d ("datapath: Backport
"skbuff: Fix skb checksum flag on skb pull""), then it's fine by me.

Tested-at: https://travis-ci.org/joestringer/openvswitch/jobs/84578330
Acked-by: Joe Stringer <joestringer@nicira.com>

Separately, have you looked into whether upstream commit 31b33dfb0a14
("skbuff: Fix skb checksum partial check.") needs to be backported?
Pravin B Shelar Oct. 9, 2015, 9:14 p.m. UTC | #2
On Fri, Oct 9, 2015 at 2:03 PM, Joe Stringer <joestringer@nicira.com> wrote:
> On 9 October 2015 at 13:21, Pravin B Shelar <pshelar@nicira.com> wrote:
>> Fixes following compilation error:
>>
>> CC [M]  /home/travis/build/openvswitch/ovs/datapath/linux/actions.o
>>
>> In file included from
>> /home/travis/build/openvswitch/ovs/datapath/linux/actions.c:21:0:
>>
>> /home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:
>> In function ‘rpl_skb_postpull_rcsum’:
>>
>> /home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:384:4:
>> error: implicit declaration of function ‘skb_checksum_start_offset’
>> [-Werror=implicit-function-declaration]
>>
>> cc1: some warnings being treated as errors
>>
>> Reported-by: Joe Stringer <joestringer@nicira.com>
>> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
>
> Is there a reason that we shouldn't backport skb_checksum_start_offset()?
>
The fix is related bug which can occur only on GRO, This function did
exist in kernel which support vxlan gro. but it is probably good to
backport this function. so I will update patch and push it.

> This fixes the compile issue, so if we're happy that this doesn't
> cause a regression on commit a2cf7524787d ("datapath: Backport
> "skbuff: Fix skb checksum flag on skb pull""), then it's fine by me.
>
> Tested-at: https://travis-ci.org/joestringer/openvswitch/jobs/84578330
> Acked-by: Joe Stringer <joestringer@nicira.com>
>
> Separately, have you looked into whether upstream commit 31b33dfb0a14
> ("skbuff: Fix skb checksum partial check.") needs to be backported?

Yes, I am planning on posting the patch.
diff mbox

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 42d1f45..e4846d9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -363,6 +363,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], [skb_checksum_start_offset])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [rxhash])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u16.*rxhash],
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index 23b13b8..331a523 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -380,9 +380,11 @@  static inline void skb_postpull_rcsum(struct sk_buff *skb,
 {
 	if (skb->ip_summed == CHECKSUM_COMPLETE)
 		skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
+#ifdef HAVE_SKB_CHECKSUM_START_OFFSET
 	else if (skb->ip_summed == CHECKSUM_PARTIAL &&
 			skb_checksum_start_offset(skb) <= len)
 		skb->ip_summed = CHECKSUM_NONE;
+#endif
 }
 
 #define skb_pull_rcsum rpl_skb_pull_rcsum