diff options
author | Davide Caratti <dcaratti@redhat.com> | 2018-11-07 11:28:18 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-08 07:23:30 +0100 |
commit | 7dad9937e064a6411cc3427f3f5870fa72132ad8 (patch) | |
tree | 9c5ea522104dbbaaf9bec8c0005beddd0bf99167 /net/8021q/vlan.c | |
parent | tun: compute the RFS hash only if needed. (diff) | |
download | linux-7dad9937e064a6411cc3427f3f5870fa72132ad8.tar.xz linux-7dad9937e064a6411cc3427f3f5870fa72132ad8.zip |
net: vlan: add support for tunnel offload
GSO tunneled packets are always segmented in software before they are
transmitted by a VLAN, even when the lower device can offload tunnel
encapsulation and VLAN together (i.e., some bits in NETIF_F_GSO_ENCAP_ALL
mask are set in the lower device 'vlan_features'). If we let VLANs have
the same tunnel offload capabilities as their lower device, throughput
can improve significantly when CPU is limited on the transmitter side.
- set NETIF_F_GSO_ENCAP_ALL bits in the VLAN 'hw_features', to ensure
that 'features' will have those bits zeroed only when the lower device
has no hardware support for tunnel encapsulation.
- for the same reason, copy GSO-related bits of 'hw_enc_features' from
lower device to VLAN, and ensure to update that value when the lower
device changes its features.
- set NETIF_F_HW_CSUM bit in the VLAN 'hw_enc_features' if 'real_dev'
is able to compute checksums at least for a kind of packets, like done
with commit 8403debeead8 ("vlan: Keep NETIF_F_HW_CSUM similar to other
software devices"). This avoids software segmentation due to mismatching
checksum capabilities between VLAN's 'features' and 'hw_enc_features'.
Reported-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r-- | net/8021q/vlan.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 5e9950453955..1b7a375c6616 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -330,6 +330,7 @@ static void vlan_transfer_features(struct net_device *dev, vlandev->priv_flags &= ~IFF_XMIT_DST_RELEASE; vlandev->priv_flags |= (vlan->real_dev->priv_flags & IFF_XMIT_DST_RELEASE); + vlandev->hw_enc_features = vlan_tnl_features(vlan->real_dev); netdev_update_features(vlandev); } |