diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-12-15 02:24:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-15 11:46:04 -0500 |
commit | 8a0033a947403569caeca45fa5e6f7ba60d51974 (patch) | |
tree | e3bbe120e1f16abf6c532dcd5ba33529a118f0c2 | |
parent | fd223068fc3467e10ecbba52e1bdb10aad3988b3 (diff) |
gre: fix the inner mac header in nbma tunnel xmit path
The NBMA GRE tunnels temporarily push GRE header that contain the
per-packet NBMA destination on the skb via header ops early in xmit
path. It is the later pulled before the real GRE header is constructed.
The inner mac was thus set differently in nbma case: the GRE header
has been pushed by neighbor layer, and mac header points to beginning
of the temporary gre header (set by dev_queue_xmit).
Now that the offloads expect mac header to point to the gre payload,
fix the xmit patch to:
- pull first the temporary gre header away
- and reset mac header to point to gre payload
This fixes tso to work again with nbma tunnels.
Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length")
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Cc: Tom Herbert <therbert@google.com>
Cc: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/ip_gre.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index ac8491245e5b..4f4bf5b99686 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -252,10 +252,6 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb, | |||
252 | struct ip_tunnel *tunnel = netdev_priv(dev); | 252 | struct ip_tunnel *tunnel = netdev_priv(dev); |
253 | const struct iphdr *tnl_params; | 253 | const struct iphdr *tnl_params; |
254 | 254 | ||
255 | skb = gre_handle_offloads(skb, !!(tunnel->parms.o_flags&TUNNEL_CSUM)); | ||
256 | if (IS_ERR(skb)) | ||
257 | goto out; | ||
258 | |||
259 | if (dev->header_ops) { | 255 | if (dev->header_ops) { |
260 | /* Need space for new headers */ | 256 | /* Need space for new headers */ |
261 | if (skb_cow_head(skb, dev->needed_headroom - | 257 | if (skb_cow_head(skb, dev->needed_headroom - |
@@ -268,6 +264,7 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb, | |||
268 | * to gre header. | 264 | * to gre header. |
269 | */ | 265 | */ |
270 | skb_pull(skb, tunnel->hlen + sizeof(struct iphdr)); | 266 | skb_pull(skb, tunnel->hlen + sizeof(struct iphdr)); |
267 | skb_reset_mac_header(skb); | ||
271 | } else { | 268 | } else { |
272 | if (skb_cow_head(skb, dev->needed_headroom)) | 269 | if (skb_cow_head(skb, dev->needed_headroom)) |
273 | goto free_skb; | 270 | goto free_skb; |
@@ -275,6 +272,10 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb, | |||
275 | tnl_params = &tunnel->parms.iph; | 272 | tnl_params = &tunnel->parms.iph; |
276 | } | 273 | } |
277 | 274 | ||
275 | skb = gre_handle_offloads(skb, !!(tunnel->parms.o_flags&TUNNEL_CSUM)); | ||
276 | if (IS_ERR(skb)) | ||
277 | goto out; | ||
278 | |||
278 | __gre_xmit(skb, dev, tnl_params, skb->protocol); | 279 | __gre_xmit(skb, dev, tnl_params, skb->protocol); |
279 | 280 | ||
280 | return NETDEV_TX_OK; | 281 | return NETDEV_TX_OK; |