Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6b641a4 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller
Browse files

ipv6: Pull IPv6 GSO registration out of the module



Sing GSO support is now separate, pull it out of the module
and make it its own init call.
Remove the cleanup functions as they are no longer called.

Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 808a8f88
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#define _PROTOCOL_H

#include <linux/in6.h>
#include <linux/skbuff.h>
#if IS_ENABLED(CONFIG_IPV6)
#include <linux/ipv6.h>
#endif
@@ -59,8 +60,6 @@ struct inet6_protocol {

#define INET6_PROTO_NOPOLICY	0x1
#define INET6_PROTO_FINAL	0x2
/* This should be set for any extension header which is compatible with GSO. */
#define INET6_PROTO_GSO_EXTHDR	0x4
#endif

struct net_offload {
@@ -72,6 +71,8 @@ struct net_offload {
	int			(*gro_complete)(struct sk_buff *skb);
	unsigned int		flags;	/* Flags used by IPv6 for now */
};
/* This should be set for any extension header which is compatible with GSO. */
#define INET6_PROTO_GSO_EXTHDR	0x1

/* This is used to register socket interfaces for IP protocols.  */
struct inet_protosw {
@@ -93,10 +94,10 @@ struct inet_protosw {

extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS];
extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS];

#if IS_ENABLED(CONFIG_IPV6)
extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS];
#endif

extern int	inet_add_protocol(const struct net_protocol *prot, unsigned char num);
@@ -109,10 +110,10 @@ extern void inet_unregister_protosw(struct inet_protosw *p);
#if IS_ENABLED(CONFIG_IPV6)
extern int	inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
extern int	inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
extern int	inet6_add_offload(const struct net_offload *prot, unsigned char num);
extern int	inet6_del_offload(const struct net_offload *prot, unsigned char num);
extern int	inet6_register_protosw(struct inet_protosw *p);
extern void	inet6_unregister_protosw(struct inet_protosw *p);
#endif
extern int	inet6_add_offload(const struct net_offload *prot, unsigned char num);
extern int	inet6_del_offload(const struct net_offload *prot, unsigned char num);

#endif	/* _PROTOCOL_H */
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ obj-$(CONFIG_IPV6) += ipv6.o
ipv6-objs :=	af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o \
		addrlabel.o \
		route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o udplite.o \
		raw.o protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \
		raw.o icmp.o mcast.o reassembly.o tcp_ipv6.o \
		exthdrs.o datagram.o ip6_flowlabel.o inet6_connection_sock.o

ipv6-offload :=	ip6_offload.o tcpv6_offload.o udp_offload.o exthdrs_offload.o
@@ -23,7 +23,6 @@ ipv6-$(CONFIG_PROC_FS) += proc.o
ipv6-$(CONFIG_SYN_COOKIES) += syncookies.o

ipv6-objs += $(ipv6-y)
ipv6-objs += $(ipv6-offload)

obj-$(CONFIG_INET6_AH) += ah6.o
obj-$(CONFIG_INET6_ESP) += esp6.o
@@ -41,6 +40,7 @@ obj-$(CONFIG_IPV6_SIT) += sit.o
obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o
obj-$(CONFIG_IPV6_GRE) += ip6_gre.o

obj-y += addrconf_core.o exthdrs_core.o output_core.o
obj-y += addrconf_core.o exthdrs_core.o output_core.o protocol.o
obj-y += $(ipv6-offload)

obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o
+0 −3
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@

#include <asm/uaccess.h>
#include <linux/mroute6.h>
#include "ip6_offload.h"

MODULE_AUTHOR("Cast of dozens");
MODULE_DESCRIPTION("IPv6 protocol stack for Linux");
@@ -707,14 +706,12 @@ static struct packet_type ipv6_packet_type __read_mostly = {

static int __init ipv6_packet_init(void)
{
	ipv6_offload_init();
	dev_add_pack(&ipv6_packet_type);
	return 0;
}

static void ipv6_packet_cleanup(void)
{
	ipv6_offload_cleanup();
	dev_remove_pack(&ipv6_packet_type);
}

+1 −9
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
#endif

#include <asm/uaccess.h>
#include "ip6_offload.h"

/*
 *	Parsing tlv encoded headers.
@@ -502,13 +501,9 @@ int __init ipv6_exthdrs_init(void)
{
	int ret;

	ret = ipv6_exthdrs_offload_init();
	if (ret)
		goto out;

	ret = inet6_add_protocol(&rthdr_protocol, IPPROTO_ROUTING);
	if (ret)
		goto out_offload;
		goto out;

	ret = inet6_add_protocol(&destopt_protocol, IPPROTO_DSTOPTS);
	if (ret)
@@ -524,14 +519,11 @@ out_destopt:
	inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS);
out_rthdr:
	inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING);
out_offload:
	ipv6_exthdrs_offload_exit();
	goto out;
};

void ipv6_exthdrs_exit(void)
{
	ipv6_exthdrs_offload_exit();
	inet6_del_protocol(&nodata_protocol, IPPROTO_NONE);
	inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS);
	inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING);
+0 −6
Original line number Diff line number Diff line
@@ -39,9 +39,3 @@ out_rt:
	inet_del_offload(&rthdr_offload, IPPROTO_ROUTING);
	goto out;
}

void ipv6_exthdrs_offload_exit(void)
{
	inet_del_offload(&rthdr_offload, IPPROTO_ROUTING);
	inet_del_offload(&rthdr_offload, IPPROTO_DSTOPTS);
}
Loading