From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5D54E58D8 for ; Thu, 27 Aug 2015 13:12:03 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 27 Aug 2015 04:12:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,422,1437462000"; d="scan'208";a="776665892" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 27 Aug 2015 04:12:01 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t7RBC038011209; Thu, 27 Aug 2015 12:12:00 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t7RBC056017775; Thu, 27 Aug 2015 12:12:00 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t7RBC0Ob017771; Thu, 27 Aug 2015 12:12:00 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Thu, 27 Aug 2015 12:11:59 +0100 Message-Id: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] kni: fix igb build with kernel 4.2 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: Thu, 27 Aug 2015 11:12:04 -0000 Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink, which breaks DPDK compilation. Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink") This patch adds the necessary checks to fix it. Signed-off-by: Pablo de Lara --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++---- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) 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 eed8df6..b330b20 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev, } #ifdef HAVE_BRIDGE_FILTER -#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS 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 */ +#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ #else static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev) @@ -2275,11 +2275,16 @@ 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 +#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS +#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, + nlflags, filter_mask, NULL); +#else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); +#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */ #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); -#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */ +#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ #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 852f80f..5f45b8b 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) ) /* ndo_bridge_getlink adds new nlflags parameter */ -#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS #endif /* >= 4.1.0 */ + +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) +/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */ +#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL +#endif /* >= 4.2.0 */ #endif /* _KCOMPAT_H_ */ -- 2.1.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 53FAB8E89 for ; Mon, 12 Oct 2015 14:47:11 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 12 Oct 2015 05:47:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,672,1437462000"; d="scan'208";a="578938263" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-174.ir.intel.com) ([10.237.214.36]) by FMSMGA003.fm.intel.com with ESMTP; 12 Oct 2015 05:47:10 -0700 From: Pablo de Lara To: pablo.de.lara.guarch@intel.com, dev@dpdk.org Date: Mon, 12 Oct 2015 13:46:57 +0100 Message-Id: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444654017-18819-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1444654017-18819-1-git-send-email-pablo.de.lara.guarch@intel.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Patchwork-Id: 6800 Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] kni: fix igb build with kernel 4.2 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: Mon, 12 Oct 2015 12:47:11 -0000 Message-ID: <20151012124657.eCqDSp47OEtlGxBpna6vb1mqeuv9_Ln_FUpTw6aZYko@z> From: "De Lara Guarch, Pablo" Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink, which breaks DPDK compilation. Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink") This patch adds the necessary checks to fix it. Signed-off-by: Pablo de Lara --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++---- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) 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 eed8df6..b330b20 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev, } #ifdef HAVE_BRIDGE_FILTER -#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS 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 */ +#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ #else static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev) @@ -2275,11 +2275,16 @@ 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 +#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS +#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, + nlflags, filter_mask, NULL); +#else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); +#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */ #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); -#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */ +#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ #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 852f80f..5f45b8b 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) ) /* ndo_bridge_getlink adds new nlflags parameter */ -#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS #endif /* >= 4.1.0 */ + +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) +/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */ +#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL +#endif /* >= 4.2.0 */ #endif /* _KCOMPAT_H_ */ 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 83CF48E78 for ; Mon, 12 Oct 2015 14:49:41 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 12 Oct 2015 05:49:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,672,1437462000"; d="scan'208";a="809005800" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-174.ir.intel.com) ([10.237.214.36]) by fmsmga001.fm.intel.com with ESMTP; 12 Oct 2015 05:49:39 -0700 From: Pablo de Lara To: pablo.de.lara.guarch@intel.com, dev@dpdk.org Date: Mon, 12 Oct 2015 13:49:30 +0100 Message-Id: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444654170-19048-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1444654170-19048-1-git-send-email-pablo.de.lara.guarch@intel.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Patchwork-Id: 6800 Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] kni: fix igb build with kernel 4.2 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: Mon, 12 Oct 2015 12:49:42 -0000 Message-ID: <20151012124930.710aV3pcqHGnjefdhMqUt1FqQULDqmamOl63h115P_4@z> From: "De Lara Guarch, Pablo" Kernel 4.2 has introduced two new parameters in ndo_bridge_getlink, which breaks DPDK compilation. Linux: 7d4f8d87 ("switchdev: ad VLAN support for ports bridge-getlink") This patch adds the necessary checks to fix it. Signed-off-by: Pablo de Lara --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 13 +++++++++---- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) 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 eed8df6..b330b20 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2250,14 +2250,14 @@ static int igb_ndo_bridge_setlink(struct net_device *dev, } #ifdef HAVE_BRIDGE_FILTER -#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS 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 */ +#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ #else static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev) @@ -2275,11 +2275,16 @@ 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 +#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS +#ifdef HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, + nlflags, filter_mask, NULL); +#else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); +#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL */ #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); -#endif /* HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK */ +#endif /* HAVE_NDO_BRIDGE_GETLINK_NLFLAGS */ #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 852f80f..5f45b8b 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3899,6 +3899,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) ) /* ndo_bridge_getlink adds new nlflags parameter */ -#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK +#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS #endif /* >= 4.1.0 */ + +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) +/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */ +#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL +#endif /* >= 4.2.0 */ #endif /* _KCOMPAT_H_ */