aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2013-07-10 20:05:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-11 15:18:49 -0400
commitcdbaa0bb26d8116d00be24e6b49043777b382f3a (patch)
tree51f4ebf87605daf9637d6ef5f36e7e1f80768aa1 /net/core
parent3b8ccd447375acebed9af0a3798e1ab4e58bedf4 (diff)
gso: Update tunnel segmentation to support Tx checksum offload
This change makes it so that the GRE and VXLAN tunnels can make use of Tx checksum offload support provided by some drivers via the hw_enc_features. Without this fix enabling GSO means sacrificing Tx checksum offload and this actually leads to a performance regression as shown below: Utilization Send Throughput local GSO 10^6bits/s % S state 6276.51 8.39 enabled 7123.52 8.42 disabled To resolve this it was necessary to address two items. First netif_skb_features needed to be updated so that it would correctly handle the Trans Ether Bridging protocol without impacting the need to check for Q-in-Q tagging. To do this it was necessary to update harmonize_features so that it used skb_network_protocol instead of just using the outer protocol. Second it was necessary to update the GRE and UDP tunnel segmentation offloads so that they would reset the encapsulation bit and inner header offsets after the offload was complete. As a result of this change I have seen the following results on a interface with Tx checksum enabled for encapsulated frames: Utilization Send Throughput local GSO 10^6bits/s % S state 7123.52 8.42 disabled 8321.75 5.43 enabled v2: Instead of replacing refrence to skb->protocol with skb_network_protocol just replace the protocol reference in harmonize_features to allow for double VLAN tag checks. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 560dafd83adf..a3d8d44cb7f4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2481,10 +2481,10 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
2481} 2481}
2482 2482
2483static netdev_features_t harmonize_features(struct sk_buff *skb, 2483static netdev_features_t harmonize_features(struct sk_buff *skb,
2484 __be16 protocol, netdev_features_t features) 2484 netdev_features_t features)
2485{ 2485{
2486 if (skb->ip_summed != CHECKSUM_NONE && 2486 if (skb->ip_summed != CHECKSUM_NONE &&
2487 !can_checksum_protocol(features, protocol)) { 2487 !can_checksum_protocol(features, skb_network_protocol(skb))) {
2488 features &= ~NETIF_F_ALL_CSUM; 2488 features &= ~NETIF_F_ALL_CSUM;
2489 } else if (illegal_highdma(skb->dev, skb)) { 2489 } else if (illegal_highdma(skb->dev, skb)) {
2490 features &= ~NETIF_F_SG; 2490 features &= ~NETIF_F_SG;
@@ -2505,20 +2505,18 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
2505 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; 2505 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
2506 protocol = veh->h_vlan_encapsulated_proto; 2506 protocol = veh->h_vlan_encapsulated_proto;
2507 } else if (!vlan_tx_tag_present(skb)) { 2507 } else if (!vlan_tx_tag_present(skb)) {
2508 return harmonize_features(skb, protocol, features); 2508 return harmonize_features(skb, features);
2509 } 2509 }
2510 2510
2511 features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX | 2511 features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
2512 NETIF_F_HW_VLAN_STAG_TX); 2512 NETIF_F_HW_VLAN_STAG_TX);
2513 2513
2514 if (protocol != htons(ETH_P_8021Q) && protocol != htons(ETH_P_8021AD)) { 2514 if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD))
2515 return harmonize_features(skb, protocol, features);
2516 } else {
2517 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 2515 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
2518 NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX | 2516 NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
2519 NETIF_F_HW_VLAN_STAG_TX; 2517 NETIF_F_HW_VLAN_STAG_TX;
2520 return harmonize_features(skb, protocol, features); 2518
2521 } 2519 return harmonize_features(skb, features);
2522} 2520}
2523EXPORT_SYMBOL(netif_skb_features); 2521EXPORT_SYMBOL(netif_skb_features);
2524 2522