datapath: Convert internal_dev to ndo_fix_features.
authorPravin B Shelar <pshelar@nicira.com>
Fri, 4 Nov 2011 20:31:45 +0000 (13:31 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Fri, 4 Nov 2011 20:31:45 +0000 (13:31 -0700)
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 B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #7772

datapath/vport-internal_dev.c

index fdcf175..829bc6f 100644 (file)
@@ -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)
@@ -184,6 +186,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 & ~NETIF_F_LLTX;
+#endif
        vport_gen_rand_ether_addr(netdev->dev_addr);
 }