summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevich@gmail.com>2017-05-11 11:09:52 -0400
committerDavid S. Miller <davem@davemloft.net>2017-05-15 14:18:11 -0400
commit70957eaecc2e43308e403c80293bec3d59632412 (patch)
tree5b7757daa9682653e4907ecfc939beacdd8c85c5 /drivers/net/macvlan.c
parent66c25f6e31766a9ec19c2bdc7f5f69f9c59bafd7 (diff)
macvlan: Fix performance issues with vlan tagged packets
Macvlan always turns on offload features that have sofware fallback (NETIF_GSO_SOFTWARE). This allows much higher guest-guest communications over macvtap. However, macvtap does not turn on these features for vlan tagged traffic. As a result, depending on the HW that mactap is configured on, the performance of guest-guest communication over a vlan is very inconsistent. If the HW supports TSO/UFO over vlans, then the performance will be fine. If not, the the performance will suffer greatly since the VM may continue using TSO/UFO, and will force the host segment the traffic and possibly overlow the macvtap queue. This patch adds the always on offloads to vlan_features. This makes sure that any vlan tagged traffic between 2 guest will not be segmented needlessly. Signed-off-by: Vladislav 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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index b34eaaae03fd..346ad2ff3998 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -789,10 +789,12 @@ static int macvlan_change_mtu(struct net_device *dev, int new_mtu)
789 */ 789 */
790static struct lock_class_key macvlan_netdev_addr_lock_key; 790static struct lock_class_key macvlan_netdev_addr_lock_key;
791 791
792#define ALWAYS_ON_FEATURES \ 792#define ALWAYS_ON_OFFLOADS \
793 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | NETIF_F_LLTX | \ 793 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \
794 NETIF_F_GSO_ROBUST) 794 NETIF_F_GSO_ROBUST)
795 795
796#define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX)
797
796#define MACVLAN_FEATURES \ 798#define MACVLAN_FEATURES \
797 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ 799 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
798 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_LRO | \ 800 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_LRO | \
@@ -827,6 +829,7 @@ static int macvlan_init(struct net_device *dev)
827 dev->features |= ALWAYS_ON_FEATURES; 829 dev->features |= ALWAYS_ON_FEATURES;
828 dev->hw_features |= NETIF_F_LRO; 830 dev->hw_features |= NETIF_F_LRO;
829 dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES; 831 dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES;
832 dev->vlan_features |= ALWAYS_ON_OFFLOADS;
830 dev->gso_max_size = lowerdev->gso_max_size; 833 dev->gso_max_size = lowerdev->gso_max_size;
831 dev->gso_max_segs = lowerdev->gso_max_segs; 834 dev->gso_max_segs = lowerdev->gso_max_segs;
832 dev->hard_header_len = lowerdev->hard_header_len; 835 dev->hard_header_len = lowerdev->hard_header_len;