From patchwork Mon Oct 12 12:52:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 7519 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id B69728E99; Mon, 12 Oct 2015 14:53:15 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 10AC78E88 for ; Mon, 12 Oct 2015 14:53:12 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 12 Oct 2015 05:53:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,672,1437462000"; d="scan'208";a="824915448" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-174.ir.intel.com) ([10.237.214.36]) by fmsmga002.fm.intel.com with ESMTP; 12 Oct 2015 05:53:11 -0700 From: Pablo de Lara To: dev@dpdk.org Date: Mon, 12 Oct 2015 13:52:58 +0100 Message-Id: <1444654378-19212-3-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444654378-19212-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1440673919-17740-1-git-send-email-pablo.de.lara.guarch@intel.com> <1444654378-19212-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 | 5 +++++ lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 5 +++++ 2 files changed, 10 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 0494780..b330b20 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2276,7 +2276,12 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, #ifdef HAVE_NDO_FDB_ADD_VID #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_NLFLAGS */ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index e4fad18..5f45b8b 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3901,4 +3901,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) /* ndo_bridge_getlink adds new nlflags parameter */ #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_ */