blob: 06750d65d48005369dbd74954f64e6dc5c13b2fb [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Vlad Yasevich2207afc2012-11-15 08:49:19 +00002/*
3 * IPV6 GSO/GRO offload support
4 * Linux INET6 implementation
5 *
Vlad Yasevich2207afc2012-11-15 08:49:19 +00006 * IPV6 Extension Header GSO/GRO support
7 */
8#include <net/protocol.h>
9#include "ip6_offload.h"
10
11static const struct net_offload rthdr_offload = {
12 .flags = INET6_PROTO_GSO_EXTHDR,
13};
14
15static const struct net_offload dstopt_offload = {
16 .flags = INET6_PROTO_GSO_EXTHDR,
17};
18
19int __init ipv6_exthdrs_offload_init(void)
20{
21 int ret;
22
23 ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING);
Anton Nayshtutd2d273f2014-03-05 08:30:08 +020024 if (ret)
Vlad Yasevich2207afc2012-11-15 08:49:19 +000025 goto out;
26
27 ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS);
Anton Nayshtutd2d273f2014-03-05 08:30:08 +020028 if (ret)
Vlad Yasevich2207afc2012-11-15 08:49:19 +000029 goto out_rt;
30
31out:
32 return ret;
33
34out_rt:
Daniel Borkmanne41b0be2015-09-03 00:29:07 +020035 inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING);
Vlad Yasevich2207afc2012-11-15 08:49:19 +000036 goto out;
37}