[dpdk-dev] [PATCH] kni: fix build with kernel 4.8

Ferruh Yigit ferruh.yigit at intel.com
Thu Sep 8 19:54:56 CEST 2016


Linux kernel v4.8 removes macro DEFINE_PCI_DEVICE_TABLE

Linux: 7e9321599011 ("treewide: remove references to the now unnecessary
DEFINE_PCI_DEVICE_TABLE")

Added the macro to compatibility headers of the kni ethtool drivers.

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h   | 7 +++++++
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index bdd0806..9560aae 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3915,4 +3915,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 /* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
 #define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
 #endif /* >= 4.2.0 */
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) )
+#ifndef DEFINE_PCI_DEVICE_TABLE
+#define DEFINE_PCI_DEVICE_TABLE(_table) const struct pci_device_id _table[]
+#endif /* DEFINE_PCI_DEVICE_TABLE */
+#endif /* >= 4.8.0 */
+
 #endif /* _KCOMPAT_H_ */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
index 39ae42c..f5ef857 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
@@ -3140,4 +3140,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(4,8,0) )
+#ifndef DEFINE_PCI_DEVICE_TABLE
+#define DEFINE_PCI_DEVICE_TABLE(_table) const struct pci_device_id _table[]
+#endif /* DEFINE_PCI_DEVICE_TABLE */
+#endif /* >= 4.8.0 */
+
 #endif /* _KCOMPAT_H_ */
-- 
2.7.4



More information about the dev mailing list