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 16D70106B for ; Sun, 22 Mar 2015 19:02:18 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 22 Mar 2015 11:02:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,447,1422950400"; d="scan'208";a="668936276" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 22 Mar 2015 11:02:16 -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 t2MI2GHo020403; Sun, 22 Mar 2015 18:02:16 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t2MI2GVJ007315; Sun, 22 Mar 2015 18:02:16 GMT Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t2MI2GCC007311; Sun, 22 Mar 2015 18:02:16 GMT From: Pablo de Lara To: dev@dpdk.org Date: Sun, 22 Mar 2015 18:02:16 +0000 Message-Id: <1427047336-7271-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH v2] kni: fix compilation issue on kernel 3.19 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: Sun, 22 Mar 2015 18:02:19 -0000 From: De Lara Guarch, Pablo Due to API changes in functions ndo_dflt_bridge_getlink (commit 2c3c031c) and ndo_fdb_add (commit f6f6424b) in kernel 3.19, DPDK would not build. This patch solves the problem, by checking the kernel version and adding the necessary new parameters. Mind that function igb_ndo_fdb_add does not need the extra parameter if USE_CONST_DEV_UC_CHAR is not set, since that macro is only defined when kernel is greater or equal than 3.7 changes in v2: - Added commits id of the API changes done in the kernel - Added missing blank line - Added extra details in the commit message Signed-off-by: Pablo de Lara --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++ lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++ 2 files changed, 11 insertions(+), 0 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 a802a02..24b147d 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -2103,6 +2103,9 @@ static int igb_set_features(struct net_device *netdev, static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, +#ifdef HAVE_NDO_FDB_ADD_VID + u16 vid, +#endif u16 flags) #else static int igb_ndo_fdb_add(struct ndmsg *ndm, @@ -2259,7 +2262,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, else mode = BRIDGE_MODE_VEPA; +#ifdef HAVE_NDO_FDB_ADD_VID + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); +#else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode); +#endif /* HAVE_NDO_FDB_ADD_VID */ } #endif /* HAVE_BRIDGE_ATTRIBS */ #endif /* NTF_SELF */ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index 1213cc6..2e7e714 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3881,4 +3881,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #define HAVE_VF_MIN_MAX_TXRATE 1 #endif /* >= 3.16.0 */ +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) ) +#define HAVE_NDO_FDB_ADD_VID +#endif /* >= 3.19.0 */ + #endif /* _KCOMPAT_H_ */ -- 1.7.4.1