summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2019-01-22 15:44:28 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-23 22:33:48 +0100
commitd01c18ff821b81baa3b99329ebf051c6a1bfd4ee (patch)
tree881e7bb2e02f0451dcfd84c7e39aa66566d2e0be /kernel
parent26e28801ee7d3a18221cc07c3e3e1aa4aad6e1a2 (diff)
downloaddpdk-draft-windows-d01c18ff821b81baa3b99329ebf051c6a1bfd4ee.zip
dpdk-draft-windows-d01c18ff821b81baa3b99329ebf051c6a1bfd4ee.tar.gz
dpdk-draft-windows-d01c18ff821b81baa3b99329ebf051c6a1bfd4ee.tar.xz
kni: fix build for dev_open in Linux 5.0
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 <ferruh.yigit@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/linux/kni/ethtool/igb/kcompat.h4
-rw-r--r--kernel/linux/kni/ethtool/ixgbe/kcompat.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index 430aaba..068cfeb 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 7c7d6c3..419fd1f 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.