Commit f087000a authored by Alexander Duyck's avatar Alexander Duyck Committed by Sasha Levin

gro: Allow tunnel stacking in the case of FOU/GUE

[ Upstream commit c3483384 ]

This patch should fix the issues seen with a recent fix to prevent
tunnel-in-tunnel frames from being generated with GRO.  The fix itself is
correct for now as long as we do not add any devices that support
NETIF_F_GSO_GRE_CSUM.  When such a device is added it could have the
potential to mess things up due to the fact that the outer transport header
points to the outer UDP header and not the GRE header as would be expected.

Fixes: fac8e0f5 ("tunnels: Don't apply GRO to multiple layers of encapsulation.")
Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent dd4fff23
...@@ -113,6 +113,14 @@ static struct sk_buff **fou_gro_receive(struct sk_buff **head, ...@@ -113,6 +113,14 @@ static struct sk_buff **fou_gro_receive(struct sk_buff **head,
u8 proto = NAPI_GRO_CB(skb)->proto; u8 proto = NAPI_GRO_CB(skb)->proto;
const struct net_offload **offloads; const struct net_offload **offloads;
/* We can clear the encap_mark for FOU as we are essentially doing
* one of two possible things. We are either adding an L4 tunnel
* header to the outer L3 tunnel header, or we are are simply
* treating the GRE tunnel header as though it is a UDP protocol
* specific header such as VXLAN or GENEVE.
*/
NAPI_GRO_CB(skb)->encap_mark = 0;
rcu_read_lock(); rcu_read_lock();
offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
ops = rcu_dereference(offloads[proto]); ops = rcu_dereference(offloads[proto]);
...@@ -217,6 +225,14 @@ static struct sk_buff **gue_gro_receive(struct sk_buff **head, ...@@ -217,6 +225,14 @@ static struct sk_buff **gue_gro_receive(struct sk_buff **head,
skb_gro_pull(skb, guehlen); skb_gro_pull(skb, guehlen);
/* We can clear the encap_mark for GUE as we are essentially doing
* one of two possible things. We are either adding an L4 tunnel
* header to the outer L3 tunnel header, or we are are simply
* treating the GRE tunnel header as though it is a UDP protocol
* specific header such as VXLAN or GENEVE.
*/
NAPI_GRO_CB(skb)->encap_mark = 0;
/* Adjusted NAPI_GRO_CB(skb)->csum after skb_gro_pull()*/ /* Adjusted NAPI_GRO_CB(skb)->csum after skb_gro_pull()*/
skb_gro_postpull_rcsum(skb, guehdr, guehlen); skb_gro_postpull_rcsum(skb, guehdr, guehlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment