aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r--net/8021q/vlan_dev.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 7865a4ce5250..a1b8171cfa7b 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -836,12 +836,32 @@ static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, st
836 return stats; 836 return stats;
837} 837}
838 838
839static int vlan_ethtool_set_tso(struct net_device *dev, u32 data)
840{
841 if (data) {
842 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
843
844 /* Underlying device must support TSO for VLAN-tagged packets
845 * and must have TSO enabled now.
846 */
847 if (!(real_dev->vlan_features & NETIF_F_TSO))
848 return -EOPNOTSUPP;
849 if (!(real_dev->features & NETIF_F_TSO))
850 return -EINVAL;
851 dev->features |= NETIF_F_TSO;
852 } else {
853 dev->features &= ~NETIF_F_TSO;
854 }
855 return 0;
856}
857
839static const struct ethtool_ops vlan_ethtool_ops = { 858static const struct ethtool_ops vlan_ethtool_ops = {
840 .get_settings = vlan_ethtool_get_settings, 859 .get_settings = vlan_ethtool_get_settings,
841 .get_drvinfo = vlan_ethtool_get_drvinfo, 860 .get_drvinfo = vlan_ethtool_get_drvinfo,
842 .get_link = ethtool_op_get_link, 861 .get_link = ethtool_op_get_link,
843 .get_rx_csum = vlan_ethtool_get_rx_csum, 862 .get_rx_csum = vlan_ethtool_get_rx_csum,
844 .get_flags = vlan_ethtool_get_flags, 863 .get_flags = vlan_ethtool_get_flags,
864 .set_tso = vlan_ethtool_set_tso,
845}; 865};
846 866
847static const struct net_device_ops vlan_netdev_ops = { 867static const struct net_device_ops vlan_netdev_ops = {