Skip to contentSkip to conversation

- gre: add eth_p_teb gro-handler for OVS with gre tunnels

PATCH In review Ramu Ramamurthy 3 participants 4 messages Oct 12, 2015 – Oct 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - gre: add eth_p_teb gro-handler for OVS with gre tunnels

Problem:
--------

When using OVS with GRE tunnels, and GRO is enabled on the nic, We find that GRO doesnt really take effect. As a result, TCP stream performance on a 10G nic is around 2-3Gbps.

Root Cause:
-----------

The protocol field set in GRE (by OVS) is ETH_P_TEB. The code in gre_gro_receive() (gre_offload.c) calls gro_find_receive_by_type() to determine a gro handler for the ETH_P_TEB protocol. However, no such protocol is registered at the device layer (only ETH_P_IP, ETH_P_IPV6, and mpls related protocols are registered). Hence, GRO is skipped.

Fix:
----

Add a GRO handler at the device layer for the ETH_P_TEB protocol. It is implemented as a independent module, so it can be added if needed.

Measurements:

Single TCP stream performance

Before: 2.4 Gbps

After: 7.1 Gbps

---
 net/ipv4/Makefile          |    1 +
 net/ipv4/eth_teb_offload.c |  114 
++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+), 0 deletions(-)
 create mode 100644 net/ipv4/eth_teb_offload.c
net/ipv4/Makefile +1 -0
index 89aacb6..8b2d7ee 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_NET_IPIP) += ipip.o
 gre-y := gre_demux.o
 obj-$(CONFIG_NET_FOU) += fou.o
 obj-$(CONFIG_NET_IPGRE_DEMUX) += gre.o
+obj-$(CONFIG_NET_IPGRE_DEMUX) += eth_teb_offload.o
 obj-$(CONFIG_NET_IPGRE) += ip_gre.o
 obj-$(CONFIG_NET_UDP_TUNNEL) += udp_tunnel.o
 obj-$(CONFIG_NET_IPVTI) += ip_vti.o
net/ipv4/eth_teb_offload.c new file +114 -0

114 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw
Quoted 11 lines · Ramu Ramamurthy

Problem:
--------

When using OVS with GRE tunnels, and GRO is enabled on the nic, We find that GRO doesnt really take effect. As a result, TCP stream performance on a 10G nic is around 2-3Gbps.

Root Cause:
-----------

Quoted 6 lines

The protocol field set in GRE (by OVS) is ETH_P_TEB. The code in gre_gro_receive() (gre_offload.c) calls gro_find_receive_by_type() to determine a gro handler for the ETH_P_TEB protocol. However, no such protocol is registered at the device layer (only ETH_P_IP, ETH_P_IPV6, and mpls related protocols are registered). Hence, GRO is skipped.

Why doesn't this work?

commit 9b174d88c257150562b0101fcc6cb6c3cb74275c

Author: Jesse Gross <[email protected]>
Date:   Tue Dec 30 19:10:15 2014 -0800

net: Add Transparent Ethernet Bridging GRO support.

Currently the only tunnel protocol that supports GRO with encapsulated Ethernet is VXLAN. This pulls out the Ethernet code into a proper layer so that it can be used by other tunnel protocols such as GRE and Geneve.

#2 lore raw
Quoted 35 lines · Jesse Gross
Quoted 11 lines · Ramu Ramamurthy

Problem:
--------

When using OVS with GRE tunnels, and GRO is enabled on the nic, We find that GRO doesnt really take effect. As a result, TCP stream performance on a 10G nic is around 2-3Gbps.

Root Cause:
-----------

Quoted 6 lines

The protocol field set in GRE (by OVS) is ETH_P_TEB. The code in gre_gro_receive() (gre_offload.c) calls gro_find_receive_by_type() to determine a gro handler for the ETH_P_TEB protocol. However, no such protocol is registered at the device layer (only ETH_P_IP, ETH_P_IPV6, and mpls related protocols are registered). Hence, GRO is skipped.

Why doesn't this work?

commit 9b174d88c257150562b0101fcc6cb6c3cb74275c

Author: Jesse Gross <[email protected]>
Date:   Tue Dec 30 19:10:15 2014 -0800

net: Add Transparent Ethernet Bridging GRO support.

Currently the only tunnel protocol that supports GRO with
encapsulated
Ethernet is VXLAN. This pulls out the Ethernet code into a proper
layer
so that it can be used by other tunnel protocols such as GRE and
Geneve.

Quoted 2 lines

Thanks, your commit fixes the same problem in the 4.x kernels. So the patch above is redundant.

We are using the 3.x kernels and thats why I could not see your fix in my tests.

We/distros would need to backport your fix to 3.x for us to consume it.

maintainer
#3 lore raw

From: Ramu Ramamurthy <[email protected]>
Date: Mon, 12 Oct 2015 17:49:13 -0700

Quoted 2 lines

We are using the 3.x kernels and thats why I could not see your fix in my tests.

It is inappropriate to submit patches not targetted and tested against the current sources.