summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2013-06-25 16:04:21 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-25 19:44:56 -0400
commit2be5c76794b0e570aa87b012df5ac864ce668a74 (patch)
treece0bb01b91bad831e290626308b886e9d0d884d2 /drivers/net/macvlan.c
parentac4e4af1e59e16a018527ffa58d9d3f30bb96ca9 (diff)
macvtap: Let TUNSETOFFLOAD actually controll offload features.
When the user issues TUNSETOFFLOAD ioctl, macvtap does not do anything other then to verify arguments. This patch adds functionality to allow users to actually control offload features. NETIF_F_GSO and NETIF_F_GRO are always on, but the rest of the features can be controlled. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index d811b06e2ccd..18373b6ae37d 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -638,6 +638,14 @@ static int macvlan_ethtool_get_settings(struct net_device *dev,
638 return __ethtool_get_settings(vlan->lowerdev, cmd); 638 return __ethtool_get_settings(vlan->lowerdev, cmd);
639} 639}
640 640
641static netdev_features_t macvlan_fix_features(struct net_device *dev,
642 netdev_features_t features)
643{
644 struct macvlan_dev *vlan = netdev_priv(dev);
645
646 return features & (vlan->set_features | ~MACVLAN_FEATURES);
647}
648
641static const struct ethtool_ops macvlan_ethtool_ops = { 649static const struct ethtool_ops macvlan_ethtool_ops = {
642 .get_link = ethtool_op_get_link, 650 .get_link = ethtool_op_get_link,
643 .get_settings = macvlan_ethtool_get_settings, 651 .get_settings = macvlan_ethtool_get_settings,
@@ -651,6 +659,7 @@ static const struct net_device_ops macvlan_netdev_ops = {
651 .ndo_stop = macvlan_stop, 659 .ndo_stop = macvlan_stop,
652 .ndo_start_xmit = macvlan_start_xmit, 660 .ndo_start_xmit = macvlan_start_xmit,
653 .ndo_change_mtu = macvlan_change_mtu, 661 .ndo_change_mtu = macvlan_change_mtu,
662 .ndo_fix_features = macvlan_fix_features,
654 .ndo_change_rx_flags = macvlan_change_rx_flags, 663 .ndo_change_rx_flags = macvlan_change_rx_flags,
655 .ndo_set_mac_address = macvlan_set_mac_address, 664 .ndo_set_mac_address = macvlan_set_mac_address,
656 .ndo_set_rx_mode = macvlan_set_mac_lists, 665 .ndo_set_rx_mode = macvlan_set_mac_lists,
@@ -791,6 +800,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
791 vlan->port = port; 800 vlan->port = port;
792 vlan->receive = receive; 801 vlan->receive = receive;
793 vlan->forward = forward; 802 vlan->forward = forward;
803 vlan->set_features = MACVLAN_FEATURES;
794 804
795 vlan->mode = MACVLAN_MODE_VEPA; 805 vlan->mode = MACVLAN_MODE_VEPA;
796 if (data && data[IFLA_MACVLAN_MODE]) 806 if (data && data[IFLA_MACVLAN_MODE])