Merge tag 'hwmon-for-v6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / net / ipv6 / exthdrs_offload.c
blob4c00398f4dca7ee57cc2394ead2122280d05841b
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * IPV6 GSO/GRO offload support
4 * Linux INET6 implementation
6 * IPV6 Extension Header GSO/GRO support
7 */
8 #include <net/protocol.h>
9 #include "ip6_offload.h"
11 static const struct net_offload rthdr_offload = {
12 .flags = INET6_PROTO_GSO_EXTHDR,
15 static const struct net_offload dstopt_offload = {
16 .flags = INET6_PROTO_GSO_EXTHDR,
19 static const struct net_offload hbh_offload = {
20 .flags = INET6_PROTO_GSO_EXTHDR,
23 int __init ipv6_exthdrs_offload_init(void)
25 int ret;
27 ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING);
28 if (ret)
29 goto out;
31 ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS);
32 if (ret)
33 goto out_rt;
35 ret = inet6_add_offload(&hbh_offload, IPPROTO_HOPOPTS);
36 if (ret)
37 goto out_dstopts;
39 out:
40 return ret;
42 out_dstopts:
43 inet6_del_offload(&dstopt_offload, IPPROTO_DSTOPTS);
45 out_rt:
46 inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING);
47 goto out;