[dpdk-dev] [PATCH] net: get rid of SET_ETHTOOL_OPS

Flavio Leitner fbl at redhat.com
Tue Jul 1 20:19:40 CEST 2014


The SET_ETHTOOL_OPS has been removed from upstream, so it
breaks the dpdk build with recent kernels.

Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c     | 4 ++--
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h         | 1 -
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c | 2 +-
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c    | 2 +-
 lib/librte_eal/linuxapp/kni/kni_ethtool.c                 | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c
index f3c48b2..9a1a177 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c
@@ -2844,14 +2844,14 @@ static const struct ethtool_ops_ext igb_ethtool_ops_ext = {
 
 void igb_set_ethtool_ops(struct net_device *netdev)
 {
-	SET_ETHTOOL_OPS(netdev, &igb_ethtool_ops);
+	netdev->ethtool_ops = &igb_ethtool_ops;
 	set_ethtool_ops_ext(netdev, &igb_ethtool_ops_ext);
 }
 #else
 void igb_set_ethtool_ops(struct net_device *netdev)
 {
 	/* have to "undeclare" const on this struct to remove warnings */
-	SET_ETHTOOL_OPS(netdev, (struct ethtool_ops *)&igb_ethtool_ops);
+	netdev->ethtool_ops = (struct ethtool_ops *)&igb_ethtool_ops;
 }
 #endif /* HAVE_RHEL6_ETHTOOL_OPS_EXT_STRUCT */
 #endif	/* SIOCETHTOOL */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h
index 222c2c7..23e2899 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h
@@ -818,7 +818,6 @@ extern u8 ixgbe_dcb_txq_to_tc(struct ixgbe_adapter *adapter, u8 index);
 /* needed by ixgbe_main.c */
 extern int ixgbe_validate_mac_addr(u8 *mc_addr);
 extern void ixgbe_check_options(struct ixgbe_adapter *adapter);
-extern void ixgbe_assign_netdev_ops(struct net_device *netdev);
 
 /* needed by ixgbe_ethtool.c */
 extern char ixgbe_driver_name[];
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c
index 11472bd..e0802c1 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c
@@ -2896,6 +2896,6 @@ struct ethtool_ops ixgbe_ethtool_ops = {
 
 void ixgbe_set_ethtool_ops(struct net_device *netdev)
 {
-	SET_ETHTOOL_OPS(netdev, &ixgbe_ethtool_ops);
+	netdev->ethtool_ops = &ixgbe_ethtool_ops;
 }
 #endif /* SIOCETHTOOL */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
index cb56906..ba2aedb 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
@@ -2454,7 +2454,7 @@ int ixgbe_kni_probe(struct pci_dev *pdev,
 		err = -EIO;
 		goto err_ioremap;
 	}
-	//ixgbe_assign_netdev_ops(netdev);
+
 	ixgbe_set_ethtool_ops(netdev);
 
 	strlcpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
diff --git a/lib/librte_eal/linuxapp/kni/kni_ethtool.c b/lib/librte_eal/linuxapp/kni/kni_ethtool.c
index d0673e5..06b6d46 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.0.0



More information about the dev mailing list