aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 8433de4509c7..1831fb7cd017 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -506,6 +506,9 @@ static int macvlan_change_mtu(struct net_device *dev, int new_mtu)
506static struct lock_class_key macvlan_netdev_xmit_lock_key; 506static struct lock_class_key macvlan_netdev_xmit_lock_key;
507static struct lock_class_key macvlan_netdev_addr_lock_key; 507static struct lock_class_key macvlan_netdev_addr_lock_key;
508 508
509#define ALWAYS_ON_FEATURES \
510 (NETIF_F_SG | NETIF_F_GEN_CSUM | NETIF_F_GSO_SOFTWARE | NETIF_F_LLTX)
511
509#define MACVLAN_FEATURES \ 512#define MACVLAN_FEATURES \
510 (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ 513 (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
511 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \ 514 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \
@@ -539,7 +542,7 @@ static int macvlan_init(struct net_device *dev)
539 dev->state = (dev->state & ~MACVLAN_STATE_MASK) | 542 dev->state = (dev->state & ~MACVLAN_STATE_MASK) |
540 (lowerdev->state & MACVLAN_STATE_MASK); 543 (lowerdev->state & MACVLAN_STATE_MASK);
541 dev->features = lowerdev->features & MACVLAN_FEATURES; 544 dev->features = lowerdev->features & MACVLAN_FEATURES;
542 dev->features |= NETIF_F_LLTX; 545 dev->features |= ALWAYS_ON_FEATURES;
543 dev->gso_max_size = lowerdev->gso_max_size; 546 dev->gso_max_size = lowerdev->gso_max_size;
544 dev->iflink = lowerdev->ifindex; 547 dev->iflink = lowerdev->ifindex;
545 dev->hard_header_len = lowerdev->hard_header_len; 548 dev->hard_header_len = lowerdev->hard_header_len;
@@ -699,7 +702,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
699 features = netdev_increment_features(vlan->lowerdev->features, 702 features = netdev_increment_features(vlan->lowerdev->features,
700 features, 703 features,
701 mask); 704 mask);
702 features |= NETIF_F_LLTX; 705 features |= ALWAYS_ON_FEATURES;
703 706
704 return features; 707 return features;
705} 708}
@@ -879,14 +882,15 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
879 dev->priv_flags |= IFF_MACVLAN; 882 dev->priv_flags |= IFF_MACVLAN;
880 err = netdev_upper_dev_link(lowerdev, dev); 883 err = netdev_upper_dev_link(lowerdev, dev);
881 if (err) 884 if (err)
882 goto destroy_port; 885 goto unregister_netdev;
883
884 886
885 list_add_tail_rcu(&vlan->list, &port->vlans); 887 list_add_tail_rcu(&vlan->list, &port->vlans);
886 netif_stacked_transfer_operstate(lowerdev, dev); 888 netif_stacked_transfer_operstate(lowerdev, dev);
887 889
888 return 0; 890 return 0;
889 891
892unregister_netdev:
893 unregister_netdevice(dev);
890destroy_port: 894destroy_port:
891 port->count -= 1; 895 port->count -= 1;
892 if (!port->count) 896 if (!port->count)