* [net PATCH] net: Reset encap_level to avoid resetting features on inner IP headers
@ 2016-03-22 23:18 Alexander Duyck
2016-03-23 17:25 ` Tom Herbert
2016-03-23 18:19 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Duyck @ 2016-03-22 23:18 UTC (permalink / raw)
To: tom, kernel-team, davem, alexander.duyck, netdev
This patch corrects an oversight in which we were allowing the encap_level
value to pass from the outer headers to the inner headers. As a result we
were incorrectly identifying UDP or GRE tunnels as also making use of ipip
or sit when the second header actually represented a tunnel encapsulated in
either a UDP or GRE tunnel which already had the features masked.
Fixes: 76443456227097179c1482 ("net: Move GSO csum into SKB_GSO_CB")
Reported-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
---
net/ipv4/gre_offload.c | 1 +
net/ipv4/udp_offload.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index dea0390d65bb..43a5c76742dc 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -49,6 +49,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
/* setup inner skb. */
skb->encapsulation = 0;
+ SKB_GSO_CB(skb)->encap_level = 0;
__skb_pull(skb, tnl_hlen);
skb_reset_mac_header(skb);
skb_set_network_header(skb, skb_inner_network_offset(skb));
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 5fcb93269afb..80236a9e1769 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -56,6 +56,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
/* setup inner skb. */
skb->encapsulation = 0;
+ SKB_GSO_CB(skb)->encap_level = 0;
__skb_pull(skb, tnl_hlen);
skb_reset_mac_header(skb);
skb_set_network_header(skb, skb_inner_network_offset(skb));
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net PATCH] net: Reset encap_level to avoid resetting features on inner IP headers
2016-03-22 23:18 [net PATCH] net: Reset encap_level to avoid resetting features on inner IP headers Alexander Duyck
@ 2016-03-23 17:25 ` Tom Herbert
2016-03-23 18:19 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Tom Herbert @ 2016-03-23 17:25 UTC (permalink / raw)
To: Alexander Duyck
Cc: Kernel Team, David S. Miller, Alexander Duyck,
Linux Kernel Network Developers
On Tue, Mar 22, 2016 at 4:18 PM, Alexander Duyck <aduyck@mirantis.com> wrote:
> This patch corrects an oversight in which we were allowing the encap_level
> value to pass from the outer headers to the inner headers. As a result we
> were incorrectly identifying UDP or GRE tunnels as also making use of ipip
> or sit when the second header actually represented a tunnel encapsulated in
> either a UDP or GRE tunnel which already had the features masked.
>
> Fixes: 76443456227097179c1482 ("net: Move GSO csum into SKB_GSO_CB")
> Reported-by: Tom Herbert <tom@herbertland.com>
> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Tom Herbert <tom@herbertland.com>
I do found it strange that we need to lie about the encap_level to get
things to work. Hopefully, once the remaining encapsulation devices
move to NETIF_HW_CSUM we can get rid of enc_features entirely.
> ---
> net/ipv4/gre_offload.c | 1 +
> net/ipv4/udp_offload.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
> index dea0390d65bb..43a5c76742dc 100644
> --- a/net/ipv4/gre_offload.c
> +++ b/net/ipv4/gre_offload.c
> @@ -49,6 +49,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
>
> /* setup inner skb. */
> skb->encapsulation = 0;
> + SKB_GSO_CB(skb)->encap_level = 0;
> __skb_pull(skb, tnl_hlen);
> skb_reset_mac_header(skb);
> skb_set_network_header(skb, skb_inner_network_offset(skb));
> diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
> index 5fcb93269afb..80236a9e1769 100644
> --- a/net/ipv4/udp_offload.c
> +++ b/net/ipv4/udp_offload.c
> @@ -56,6 +56,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
>
> /* setup inner skb. */
> skb->encapsulation = 0;
> + SKB_GSO_CB(skb)->encap_level = 0;
> __skb_pull(skb, tnl_hlen);
> skb_reset_mac_header(skb);
> skb_set_network_header(skb, skb_inner_network_offset(skb));
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net PATCH] net: Reset encap_level to avoid resetting features on inner IP headers
2016-03-22 23:18 [net PATCH] net: Reset encap_level to avoid resetting features on inner IP headers Alexander Duyck
2016-03-23 17:25 ` Tom Herbert
@ 2016-03-23 18:19 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-03-23 18:19 UTC (permalink / raw)
To: aduyck; +Cc: tom, kernel-team, alexander.duyck, netdev
From: Alexander Duyck <aduyck@mirantis.com>
Date: Tue, 22 Mar 2016 16:18:07 -0700
> This patch corrects an oversight in which we were allowing the encap_level
> value to pass from the outer headers to the inner headers. As a result we
> were incorrectly identifying UDP or GRE tunnels as also making use of ipip
> or sit when the second header actually represented a tunnel encapsulated in
> either a UDP or GRE tunnel which already had the features masked.
>
> Fixes: 76443456227097179c1482 ("net: Move GSO csum into SKB_GSO_CB")
> Reported-by: Tom Herbert <tom@herbertland.com>
> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-23 18:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 23:18 [net PATCH] net: Reset encap_level to avoid resetting features on inner IP headers Alexander Duyck
2016-03-23 17:25 ` Tom Herbert
2016-03-23 18:19 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).