18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *	IPV6 GSO/GRO offload support
48c2ecf20Sopenharmony_ci *	Linux INET6 implementation
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *      IPV6 Extension Header GSO/GRO support
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci#include <net/protocol.h>
98c2ecf20Sopenharmony_ci#include "ip6_offload.h"
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_cistatic const struct net_offload rthdr_offload = {
128c2ecf20Sopenharmony_ci	.flags		=	INET6_PROTO_GSO_EXTHDR,
138c2ecf20Sopenharmony_ci};
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistatic const struct net_offload dstopt_offload = {
168c2ecf20Sopenharmony_ci	.flags		=	INET6_PROTO_GSO_EXTHDR,
178c2ecf20Sopenharmony_ci};
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciint __init ipv6_exthdrs_offload_init(void)
208c2ecf20Sopenharmony_ci{
218c2ecf20Sopenharmony_ci	int ret;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING);
248c2ecf20Sopenharmony_ci	if (ret)
258c2ecf20Sopenharmony_ci		goto out;
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci	ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS);
288c2ecf20Sopenharmony_ci	if (ret)
298c2ecf20Sopenharmony_ci		goto out_rt;
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciout:
328c2ecf20Sopenharmony_ci	return ret;
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciout_rt:
358c2ecf20Sopenharmony_ci	inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING);
368c2ecf20Sopenharmony_ci	goto out;
378c2ecf20Sopenharmony_ci}
38