From 6f17885b23ef3ff3c9b38de2f22b11bedf55cb1e Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Fri, 4 Nov 2011 13:31:45 -0700 Subject: [PATCH] datapath: Convert internal_dev to ndo_fix_features. 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 Acked-by: Jesse Gross Bug #7772 --- datapath/vport-internal_dev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index fdcf1754d..829bc6f74 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) @@ -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); } -- 2.20.1