Vlad Yasevich | 2207afc | 2012-11-15 08:49:19 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IPV6 GSO/GRO offload support |
| 3 | * Linux INET6 implementation |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version |
| 8 | * 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * IPV6 Extension Header GSO/GRO support |
| 11 | */ |
| 12 | #include <net/protocol.h> |
| 13 | #include "ip6_offload.h" |
| 14 | |
| 15 | static const struct net_offload rthdr_offload = { |
| 16 | .flags = INET6_PROTO_GSO_EXTHDR, |
| 17 | }; |
| 18 | |
| 19 | static const struct net_offload dstopt_offload = { |
| 20 | .flags = INET6_PROTO_GSO_EXTHDR, |
| 21 | }; |
| 22 | |
| 23 | int __init ipv6_exthdrs_offload_init(void) |
| 24 | { |
| 25 | int ret; |
| 26 | |
| 27 | ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING); |
Anton Nayshtut | d2d273f | 2014-03-05 08:30:08 +0200 | [diff] [blame] | 28 | if (ret) |
Vlad Yasevich | 2207afc | 2012-11-15 08:49:19 +0000 | [diff] [blame] | 29 | goto out; |
| 30 | |
| 31 | ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS); |
Anton Nayshtut | d2d273f | 2014-03-05 08:30:08 +0200 | [diff] [blame] | 32 | if (ret) |
Vlad Yasevich | 2207afc | 2012-11-15 08:49:19 +0000 | [diff] [blame] | 33 | goto out_rt; |
| 34 | |
| 35 | out: |
| 36 | return ret; |
| 37 | |
| 38 | out_rt: |
Daniel Borkmann | e41b0be | 2015-09-03 00:29:07 +0200 | [diff] [blame] | 39 | inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING); |
Vlad Yasevich | 2207afc | 2012-11-15 08:49:19 +0000 | [diff] [blame] | 40 | goto out; |
| 41 | } |