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 BB0C62C39 for ; Tue, 22 Jan 2019 16:44:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2019 07:44:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,506,1539673200"; d="scan'208";a="268986497" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.212]) by orsmga004.jf.intel.com with ESMTP; 22 Jan 2019 07:44:34 -0800 From: Ferruh Yigit To: dev@dpdk.org Date: Tue, 22 Jan 2019 15:44:29 +0000 Message-Id: <20190122154429.41882-2-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190122154429.41882-1-ferruh.yigit@intel.com> References: <20190122154429.41882-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] kni: fix build for 5.0 for igb_ndo_bridge_setlink() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 15:44:36 -0000 Build error seen with Linux kernel 5.0 and when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled. build error: .../build/build/kernel/linux/kni/igb_main.c:2348:24: error: initialization of ‘int (*)(struct net_device *, struct nlmsghdr *, u16, struct netlink_ext_ack *)’ {aka ‘int (*)(struct net_device *, struct nlmsghdr *, short unsigned int, struct netlink_ext_ack *)’} from incompatible pointer type ‘int (*)(struct net_device *, struct nlmsghdr *, u16)’ {aka ‘int (*)(struct net_device *, struct nlmsghdr *, short unsigned int)’} [-Werror=incompatible-pointer-types] .ndo_bridge_setlink = igb_ndo_bridge_setlink, ^~~~~~~~~~~~~~~~~~~~~~ .../build/build/kernel/linux/kni/igb_main.c:2348:24: note: (near initialization for ‘igb_netdev_ops.ndo_bridge_setlink’) igb_ndo_bridge_setlink() is changed in Linux kernel version 5.0 and now requires a new parameter, 'struct netlink_ext_ack *extack'. Fixed by adding a new parameter with a kernel version check. Signed-off-by: Ferruh Yigit --- kernel/linux/kni/ethtool/igb/igb_main.c | 5 +++++ kernel/linux/kni/ethtool/igb/kcompat.h | 1 + 2 files changed, 6 insertions(+) diff --git a/kernel/linux/kni/ethtool/igb/igb_main.c b/kernel/linux/kni/ethtool/igb/igb_main.c index af378d2f2..0b4faeae5 100644 --- a/kernel/linux/kni/ethtool/igb/igb_main.c +++ b/kernel/linux/kni/ethtool/igb/igb_main.c @@ -2207,7 +2207,12 @@ static int igb_ndo_fdb_dump(struct sk_buff *skb, #ifdef HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS static int igb_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh, +#ifdef HAVE_NDO_BRIDGE_SETLINK_EXTACK + u16 flags, struct netlink_ext_ack *extack) +#else u16 flags) +#endif + #else static int igb_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh) diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h index 068cfeb52..11b15f3a9 100644 --- a/kernel/linux/kni/ethtool/igb/kcompat.h +++ b/kernel/linux/kni/ethtool/igb/kcompat.h @@ -3942,6 +3942,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) #define dev_open(x) dev_open(x, NULL) +#define HAVE_NDO_BRIDGE_SETLINK_EXTACK #endif /* >= 5.0.0 */ #if defined(timer_setup) && defined(from_timer) -- 2.17.2