Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ip6ip6: Support for GSO/GRO

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tom Herbert and committed by
David S. Miller
815d22e5 51c052d4

+26 -3
+21 -3
net/ipv6/ip6_offload.c
··· 253 253 return pp; 254 254 } 255 255 256 - static struct sk_buff **sit_gro_receive(struct sk_buff **head, 257 - struct sk_buff *skb) 256 + static struct sk_buff **sit_ip6ip6_gro_receive(struct sk_buff **head, 257 + struct sk_buff *skb) 258 258 { 259 + /* Common GRO receive for SIT and IP6IP6 */ 260 + 259 261 if (NAPI_GRO_CB(skb)->encap_mark) { 260 262 NAPI_GRO_CB(skb)->flush = 1; 261 263 return NULL; ··· 300 298 return ipv6_gro_complete(skb, nhoff); 301 299 } 302 300 301 + static int ip6ip6_gro_complete(struct sk_buff *skb, int nhoff) 302 + { 303 + skb->encapsulation = 1; 304 + skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6; 305 + return ipv6_gro_complete(skb, nhoff); 306 + } 307 + 303 308 static struct packet_offload ipv6_packet_offload __read_mostly = { 304 309 .type = cpu_to_be16(ETH_P_IPV6), 305 310 .callbacks = { ··· 319 310 static const struct net_offload sit_offload = { 320 311 .callbacks = { 321 312 .gso_segment = ipv6_gso_segment, 322 - .gro_receive = sit_gro_receive, 313 + .gro_receive = sit_ip6ip6_gro_receive, 323 314 .gro_complete = sit_gro_complete, 315 + }, 316 + }; 317 + 318 + static const struct net_offload ip6ip6_offload = { 319 + .callbacks = { 320 + .gso_segment = ipv6_gso_segment, 321 + .gro_receive = sit_ip6ip6_gro_receive, 322 + .gro_complete = ip6ip6_gro_complete, 324 323 }, 325 324 }; 326 325 ··· 343 326 dev_add_offload(&ipv6_packet_offload); 344 327 345 328 inet_add_offload(&sit_offload, IPPROTO_IPV6); 329 + inet6_add_offload(&ip6ip6_offload, IPPROTO_IPV6); 346 330 347 331 return 0; 348 332 }
+5
net/ipv6/ip6_tunnel.c
··· 1242 1242 if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) 1243 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 1250 err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu, 1246 1251 IPPROTO_IPV6); 1247 1252 if (err != 0) {