From patchwork Tue Jan 22 15:44:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 50000 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 299CF2BDB; Tue, 22 Jan 2019 16:44:35 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 1609F25B3 for ; Tue, 22 Jan 2019 16:44:33 +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:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,506,1539673200"; d="scan'208";a="268986479" 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:32 -0800 From: Ferruh Yigit To: dev@dpdk.org Date: Tue, 22 Jan 2019 15:44:28 +0000 Message-Id: <20190122154429.41882-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/2] kni: fix build for 5.0 for dev_open() 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Build error seen with Linux kernel 5.0 and when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled. build error: .../build/build/kernel/linux/kni/ixgbe_ethtool.c:1746:4: error: too few arguments to function ‘dev_open’ dev_open(netdev); ^~~~~~~~ In file included from .../build/kernel/linux/kni/ixgbe_ethtool.c:18: .../linux/linux/include/linux/netdevice.h:2620:5: note: declared here int dev_open(struct net_device *dev, struct netlink_ext_ack *extack); ^~~~~~~~ .../build/build/kernel/linux/kni/igb_ethtool.c:1812:4: error: too few arguments to function ‘dev_open’ dev_open(netdev); ^~~~~~~~ In file included from .../build/build/kernel/linux/kni/igb_ethtool.c:15: .../linux/linux/include/linux/netdevice.h:2620:5: note: declared here int dev_open(struct net_device *dev, struct netlink_ext_ack *extack); ^~~~~~~~ dev_open() is changed in Linux kernel version 5.0 and now requires a new parameter, 'struct netlink_ext_ack *extack'. Fixed by defining dev_open as macro when kernel version >= 5.0 Signed-off-by: Ferruh Yigit --- kernel/linux/kni/ethtool/igb/kcompat.h | 4 ++++ kernel/linux/kni/ethtool/ixgbe/kcompat.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h index 430aabafe..068cfeb52 100644 --- a/kernel/linux/kni/ethtool/igb/kcompat.h +++ b/kernel/linux/kni/ethtool/igb/kcompat.h @@ -3940,6 +3940,10 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #define HAVE_PCI_ENABLE_MSIX #endif +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) +#define dev_open(x) dev_open(x, NULL) +#endif /* >= 5.0.0 */ + #if defined(timer_setup) && defined(from_timer) #define HAVE_TIMER_SETUP #endif diff --git a/kernel/linux/kni/ethtool/ixgbe/kcompat.h b/kernel/linux/kni/ethtool/ixgbe/kcompat.h index 7c7d6c317..419fd1f13 100644 --- a/kernel/linux/kni/ethtool/ixgbe/kcompat.h +++ b/kernel/linux/kni/ethtool/ixgbe/kcompat.h @@ -3125,6 +3125,10 @@ static inline int __kc_pci_vfs_assigned(struct pci_dev *dev) #define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops)) #endif /* >= 3.16.0 */ +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ) +#define dev_open(x) dev_open(x, NULL) +#endif /* >= 5.0.0 */ + /* * vlan_tx_tag_* macros renamed to skb_vlan_tag_* (Linux commit: df8a39defad4) * For older kernels backported this commit, need to use renamed functions.