diff options
author | Tom Herbert <tom@herbertland.com> | 2016-05-18 12:06:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-20 18:03:17 -0400 |
commit | 815d22e55b0eba3bfb8f0ba532ce9ae364fee556 (patch) | |
tree | ca22cbfb6a5cc83129b0a0e8a19c3e42e0824bc7 | |
parent | 51c052d4f5871554377278762065450b4e64f6d1 (diff) |
ip6ip6: Support for GSO/GRO
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/ip6_offload.c | 24 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 5 |
2 files changed, 26 insertions, 3 deletions
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index 787e55f4796c..332d6a03f182 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c | |||
@@ -253,9 +253,11 @@ out: | |||
253 | return pp; | 253 | return pp; |
254 | } | 254 | } |
255 | 255 | ||
256 | static struct sk_buff **sit_gro_receive(struct sk_buff **head, | 256 | static struct sk_buff **sit_ip6ip6_gro_receive(struct sk_buff **head, |
257 | struct sk_buff *skb) | 257 | struct sk_buff *skb) |
258 | { | 258 | { |
259 | /* Common GRO receive for SIT and IP6IP6 */ | ||
260 | |||
259 | if (NAPI_GRO_CB(skb)->encap_mark) { | 261 | if (NAPI_GRO_CB(skb)->encap_mark) { |
260 | NAPI_GRO_CB(skb)->flush = 1; | 262 | NAPI_GRO_CB(skb)->flush = 1; |
261 | return NULL; | 263 | return NULL; |
@@ -298,6 +300,13 @@ static int sit_gro_complete(struct sk_buff *skb, int nhoff) | |||
298 | return ipv6_gro_complete(skb, nhoff); | 300 | return ipv6_gro_complete(skb, nhoff); |
299 | } | 301 | } |
300 | 302 | ||
303 | static int ip6ip6_gro_complete(struct sk_buff *skb, int nhoff) | ||
304 | { | ||
305 | skb->encapsulation = 1; | ||
306 | skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6; | ||
307 | return ipv6_gro_complete(skb, nhoff); | ||
308 | } | ||
309 | |||
301 | static struct packet_offload ipv6_packet_offload __read_mostly = { | 310 | static struct packet_offload ipv6_packet_offload __read_mostly = { |
302 | .type = cpu_to_be16(ETH_P_IPV6), | 311 | .type = cpu_to_be16(ETH_P_IPV6), |
303 | .callbacks = { | 312 | .callbacks = { |
@@ -310,11 +319,19 @@ static struct packet_offload ipv6_packet_offload __read_mostly = { | |||
310 | static const struct net_offload sit_offload = { | 319 | static const struct net_offload sit_offload = { |
311 | .callbacks = { | 320 | .callbacks = { |
312 | .gso_segment = ipv6_gso_segment, | 321 | .gso_segment = ipv6_gso_segment, |
313 | .gro_receive = sit_gro_receive, | 322 | .gro_receive = sit_ip6ip6_gro_receive, |
314 | .gro_complete = sit_gro_complete, | 323 | .gro_complete = sit_gro_complete, |
315 | }, | 324 | }, |
316 | }; | 325 | }; |
317 | 326 | ||
327 | static const struct net_offload ip6ip6_offload = { | ||
328 | .callbacks = { | ||
329 | .gso_segment = ipv6_gso_segment, | ||
330 | .gro_receive = sit_ip6ip6_gro_receive, | ||
331 | .gro_complete = ip6ip6_gro_complete, | ||
332 | }, | ||
333 | }; | ||
334 | |||
318 | static int __init ipv6_offload_init(void) | 335 | static int __init ipv6_offload_init(void) |
319 | { | 336 | { |
320 | 337 | ||
@@ -326,6 +343,7 @@ static int __init ipv6_offload_init(void) | |||
326 | dev_add_offload(&ipv6_packet_offload); | 343 | dev_add_offload(&ipv6_packet_offload); |
327 | 344 | ||
328 | inet_add_offload(&sit_offload, IPPROTO_IPV6); | 345 | inet_add_offload(&sit_offload, IPPROTO_IPV6); |
346 | inet6_add_offload(&ip6ip6_offload, IPPROTO_IPV6); | ||
329 | 347 | ||
330 | return 0; | 348 | return 0; |
331 | } | 349 | } |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index cabf492a56dc..d26d2269abec 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1242,6 +1242,11 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1242 | if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) | 1242 | if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) |
1243 | fl6.flowi6_mark = skb->mark; | 1243 | fl6.flowi6_mark = skb->mark; |
1244 | 1244 | ||
1245 | if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) | ||
1246 | return -1; | ||
1247 | |||
1248 | skb_set_inner_ipproto(skb, IPPROTO_IPV6); | ||
1249 | |||
1245 | err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu, | 1250 | err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu, |
1246 | IPPROTO_IPV6); | 1251 | IPPROTO_IPV6); |
1247 | if (err != 0) { | 1252 | if (err != 0) { |