]> git.baikalelectronics.ru Git - kernel.git/commit
tunnels: Remove encapsulation offloads on decap.
authorJesse Gross <jesse@kernel.org>
Sat, 19 Mar 2016 16:32:02 +0000 (09:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 Mar 2016 20:33:40 +0000 (16:33 -0400)
commitb274a12813080477a4ff101d53040888911cb40a
treea00832901f84e7d6eeb773061e8d0746da323bd8
parenteae0f07c1676d55dca0f57f3dde5191e1c7d1af5
tunnels: Remove encapsulation offloads on decap.

If a packet is either locally encapsulated or processed through GRO
it is marked with the offloads that it requires. However, when it is
decapsulated these tunnel offload indications are not removed. This
means that if we receive an encapsulated TCP packet, aggregate it with
GRO, decapsulate, and retransmit the resulting frame on a NIC that does
not support encapsulation, we won't be able to take advantage of hardware
offloads even though it is just a simple TCP packet at this point.

This fixes the problem by stripping off encapsulation offload indications
when packets are decapsulated.

The performance impacts of this bug are significant. In a test where a
Geneve encapsulated TCP stream is sent to a hypervisor, GRO'ed, decapsulated,
and bridged to a VM performance is improved by 60% (5Gbps->8Gbps) as a
result of avoiding unnecessary segmentation at the VM tap interface.

Reported-by: Ramu Ramamurthy <sramamur@linux.vnet.ibm.com>
Fixes: 92b51845 ("v4 GRE: Add TCP segmentation offload for GRE")
Signed-off-by: Jesse Gross <jesse@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_tunnels.h
net/ipv4/fou.c
net/ipv4/ip_tunnel_core.c
net/ipv6/sit.c