From e0b7ca0c0383411a5cb22af6ccae41d24ace55ae Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Tue, 17 Jun 2014 17:32:03 +0300 Subject: [PATCH] kni: fix build with kernel 3.16 SET_ETHTOOL_OPS is gone in 3.16, so modify drivers accordingly. Signed-off-by: Aaro Koskinen Acked-by: Thomas Monjalon --- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 1 + lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h | 5 +++++ lib/librte_eal/linuxapp/kni/kni_ethtool.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index bd627590fe..521a35d9b4 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3859,6 +3859,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #endif /* < 3.14.0 */ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) ) +#define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops)) #define HAVE_VF_MIN_MAX_TXRATE 1 #endif /* >= 3.16.0 */ diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h index b539315eba..e327d65929 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h @@ -3135,4 +3135,9 @@ static inline int __kc_pci_vfs_assigned(struct pci_dev *dev) #define pci_vfs_assigned(dev) __kc_pci_vfs_assigned(dev) #endif + +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) ) +#define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops)) +#endif /* >= 3.16.0 */ + #endif /* _KCOMPAT_H_ */ diff --git a/lib/librte_eal/linuxapp/kni/kni_ethtool.c b/lib/librte_eal/linuxapp/kni/kni_ethtool.c index d0673e5787..06b6d46362 100644 --- a/lib/librte_eal/linuxapp/kni/kni_ethtool.c +++ b/lib/librte_eal/linuxapp/kni/kni_ethtool.c @@ -213,5 +213,5 @@ struct ethtool_ops kni_ethtool_ops = { void kni_set_ethtool_ops(struct net_device *netdev) { - SET_ETHTOOL_OPS(netdev, &kni_ethtool_ops); + netdev->ethtool_ops = &kni_ethtool_ops; } -- 2.20.1