From patchwork Wed Nov 23 09:58:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhiyong Wu X-Patchwork-Id: 127244 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0EF1C1007D2 for ; Wed, 23 Nov 2011 20:59:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756996Ab1KWJ6z (ORCPT ); Wed, 23 Nov 2011 04:58:55 -0500 Received: from e3.ny.us.ibm.com ([32.97.182.143]:33063 "EHLO e3.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756079Ab1KWJ6x (ORCPT ); Wed, 23 Nov 2011 04:58:53 -0500 Received: from /spool/local by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 Nov 2011 04:58:52 -0500 Received: from d01relay07.pok.ibm.com ([9.56.227.147]) by e3.ny.us.ibm.com ([192.168.1.103]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 23 Nov 2011 04:58:50 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAN9wnCB2015274 for ; Wed, 23 Nov 2011 04:58:49 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAN9wmo4009045 for ; Wed, 23 Nov 2011 07:58:49 -0200 Received: from us.ibm.com ([9.115.118.38]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id pAN9wjcv008801; Wed, 23 Nov 2011 07:58:46 -0200 Received: by us.ibm.com (sSMTP sendmail emulation); Wed, 23 Nov 2011 17:58:44 +0800 From: Zhi Yong Wu To: dev@openvswitch.org Cc: netdev@vger.kernel.org, stefanha@gmail.com, aliguori@us.ibm.com, Zhi Yong Wu Subject: =?UTF-8?q?=5BPATCH=5D=20datapath=3A=20Fix=20build=20breakage=20on=20kernel=202=2E6=2E40?= Date: Wed, 23 Nov 2011 17:58:38 +0800 Message-Id: <1322042318-4809-1-git-send-email-zwu.kernel@gmail.com> X-Mailer: git-send-email 1.7.6 MIME-Version: 1.0 x-cbid: 11112309-8974-0000-0000-000002CDAB5D Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Zhi Yong Wu 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. Signed-off-by: Zhi Yong Wu --- acinclude.m4 | 2 ++ datapath/linux/compat/include/linux/skbuff.h | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 648132a..32cdf17 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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], diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h index 311bfdb..22ba2e6 100644 --- a/datapath/linux/compat/include/linux/skbuff.h +++ b/datapath/linux/compat/include/linux/skbuff.h @@ -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;