[ovs-dev] [PATCH] datapath: Convert internal_dev to ndo_fix_features.

Pravin B Shelar pshelar at nicira.com
Thu Nov 3 00:27:36 UTC 2011


>From 2.6.39 kernel netdev features are set using set_features and
fix_features APIs. Since internal-dev does not need any special
checks on setting feature, there is no need to define set_features
or fix_features. Only hw_features needs to be set to features that
are supported by internal-dev.

Following patch does same and drops discrete offload setting ops for
newer kernel.

Signed-off-by: Pravin Shelar <pshelar at nicira.com>
---
 datapath/vport-internal_dev.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index a468ac8..30cc96e 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -110,12 +110,14 @@ static void internal_dev_getinfo(struct net_device *netdev,
 static const struct ethtool_ops internal_dev_ethtool_ops = {
 	.get_drvinfo	= internal_dev_getinfo,
 	.get_link	= ethtool_op_get_link,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
 	.get_sg		= ethtool_op_get_sg,
 	.set_sg		= ethtool_op_set_sg,
 	.get_tx_csum	= ethtool_op_get_tx_csum,
 	.set_tx_csum	= ethtool_op_set_tx_hw_csum,
 	.get_tso	= ethtool_op_get_tso,
 	.set_tso	= ethtool_op_set_tso,
+#endif
 };
 
 static int internal_dev_change_mtu(struct net_device *netdev, int new_mtu)
@@ -185,6 +187,9 @@ static void do_setup(struct net_device *netdev)
 	netdev->features |= NETIF_F_HW_VLAN_TX;
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
+	netdev->hw_features = netdev->features;
+#endif
 	vport_gen_rand_ether_addr(netdev->dev_addr);
 }
 
-- 
1.7.1




More information about the dev mailing list