From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 929F8C8BA for ; Sat, 27 Jun 2015 00:14:50 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 26 Jun 2015 15:14:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,687,1427785200"; d="scan'208";a="595535260" Received: from mbernalm-mobl3.amr.corp.intel.com (HELO mbernalm-mobl3.zpn.intel.com) ([10.219.18.109]) by orsmga003.jf.intel.com with ESMTP; 26 Jun 2015 15:14:49 -0700 From: Miguel Bernal Marin To: dev@dpdk.org Date: Fri, 26 Jun 2015 17:14:35 -0500 Message-Id: <1435356878-10304-2-git-send-email-miguel.bernal.marin@linux.intel.com> X-Mailer: git-send-email 2.4.4 In-Reply-To: <1435356878-10304-1-git-send-email-miguel.bernal.marin@linux.intel.com> References: <1435259380-26251-1-git-send-email-miguel.bernal.marin@linux.intel.com> <1435356878-10304-1-git-send-email-miguel.bernal.marin@linux.intel.com> Subject: [dpdk-dev] [PATCH v2 1/4] kni: fix igb_ndo_bridge_getlink to build with 4.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2015 22:14:51 -0000 ndo_bridge_getlink has changed in kernel release 4.1. It adds new parameter which brakes compilation. This patch add the properly checks to fix it. Fixes: 46c264daaaa5 ("bridge/nl: remove wrong use of NLM_F_MULTI") Signed-off-by: Miguel Bernal Marin --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 10 ++++++++++ lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c index fa24d16..47198bb 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2250,8 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev, } #ifdef HAVE_BRIDGE_FILTER +#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, + struct net_device *dev, u32 filter_mask, + int nlflags) +#else static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, u32 filter_mask) +#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */ #else static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev) @@ -2269,7 +2275,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, mode = BRIDGE_MODE_VEPA; #ifdef HAVE_NDO_FDB_ADD_VID +#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); +#else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); +#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */ #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode); #endif /* HAVE_NDO_FDB_ADD_VID */ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index 44b9ebf..96d68a2 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3891,4 +3891,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #define vlan_tx_tag_present skb_vlan_tag_present #define HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS #endif /* 4.0.0 */ + +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) ) +/* ndo_bridge_getlink adds new nlflags parameter */ +#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#endif /* >= 4.1.0 */ #endif /* _KCOMPAT_H_ */ -- 2.4.4