Netdev List
 help / color / mirror / Atom feed
From: Jarno Rajahalme <jarno@ovn.org>
To: netdev@vger.kernel.org
Cc: jesse@kernel.org, jarno@ovn.org
Subject: [PATCH net 2/3] udp_offload: Set encapsulation before inner completes.
Date: Fri, 29 Apr 2016 15:28:07 -0700	[thread overview]
Message-ID: <1461968887-4993-2-git-send-email-jarno@ovn.org> (raw)
In-Reply-To: <1461968887-4993-1-git-send-email-jarno@ovn.org>

UDP tunnel segmentation code relies on the inner offsets being set for
an UDP tunnel GSO packet.  The inner *_complete() functions will set
the inner offsets only if the encapsulation is set before calling
them, but udp_gro_complete() set it only after the inner *_complete()
functions were done.

Also, remove the setting of the inner_mac_header in udp_gro_complete()
as it was wrongly set to the beginning of the UDP tunnel header rather
than the inner MAC header.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
---
 net/ipv4/udp_offload.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 0ed2daf..e330c0e 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -399,6 +399,11 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff)
 
 	uh->len = newlen;
 
+	/* Set encapsulation before calling into inner gro_complete() functions
+	 * to make them set up the inner offsets.
+	 */
+	skb->encapsulation = 1;
+
 	rcu_read_lock();
 
 	uo_priv = rcu_dereference(udp_offload_base);
@@ -421,9 +426,6 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff)
 	if (skb->remcsum_offload)
 		skb_shinfo(skb)->gso_type |= SKB_GSO_TUNNEL_REMCSUM;
 
-	skb->encapsulation = 1;
-	skb_set_inner_mac_header(skb, nhoff + sizeof(struct udphdr));
-
 	return err;
 }
 
-- 
2.7.4

  reply	other threads:[~2016-04-30  1:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 22:28 [PATCH net 1/3] udp_tunnel: Remove redundant udp_tunnel_gro_complete() Jarno Rajahalme
2016-04-29 22:28 ` Jarno Rajahalme [this message]
2016-04-30  1:42   ` [PATCH net 2/3] udp_offload: Set encapsulation before inner completes Tom Herbert
2016-05-02 21:00     ` Jarno Rajahalme
2016-04-30  3:46   ` Alexander Duyck
2016-05-02 21:21     ` Jarno Rajahalme
2016-05-02 22:54       ` Alexander Duyck
2016-05-02 23:18         ` Tom Herbert
2016-05-03  1:22           ` Alexander Duyck
2016-04-29 22:33 ` [PATCH net 1/3] udp_tunnel: Remove redundant udp_tunnel_gro_complete() Jarno Rajahalme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461968887-4993-2-git-send-email-jarno@ovn.org \
    --to=jarno@ovn.org \
    --cc=jesse@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox