Skip to content

Commit 438e38f

Browse files
Eric Dumazetdavem330
authored andcommitted
gre_offload: statically build GRE offloading support
GRO/GSO layers can be enabled on a node, even if said node is only forwarding packets. This patch permits GSO (and upcoming GRO) support for GRE encapsulated packets, even if the host has no GRE tunnel setup. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: H.K. Jerry Chu <hkchu@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0e59593 commit 438e38f

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

include/net/gre.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ struct gre_cisco_protocol {
3333
int gre_cisco_register(struct gre_cisco_protocol *proto);
3434
int gre_cisco_unregister(struct gre_cisco_protocol *proto);
3535

36-
int gre_offload_init(void);
37-
void gre_offload_exit(void);
38-
3936
void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
4037
int hdr_len);
4138

net/ipv4/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ obj-y := route.o inetpeer.o protocol.o \
1111
tcp_offload.o datagram.o raw.o udp.o udplite.o \
1212
udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \
1313
fib_frontend.o fib_semantics.o fib_trie.o \
14-
inet_fragment.o ping.o ip_tunnel_core.o
14+
inet_fragment.o ping.o ip_tunnel_core.o gre_offload.o
1515

1616
obj-$(CONFIG_NET_IP_TUNNEL) += ip_tunnel.o
1717
obj-$(CONFIG_SYSCTL) += sysctl_net_ipv4.o
1818
obj-$(CONFIG_PROC_FS) += proc.o
1919
obj-$(CONFIG_IP_MULTIPLE_TABLES) += fib_rules.o
2020
obj-$(CONFIG_IP_MROUTE) += ipmr.o
2121
obj-$(CONFIG_NET_IPIP) += ipip.o
22-
gre-y := gre_demux.o gre_offload.o
22+
gre-y := gre_demux.o
2323
obj-$(CONFIG_NET_IPGRE_DEMUX) += gre.o
2424
obj-$(CONFIG_NET_IPGRE) += ip_gre.o
2525
obj-$(CONFIG_NET_IPVTI) += ip_vti.o

net/ipv4/gre_demux.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,7 @@ static int __init gre_init(void)
355355
goto err_gre;
356356
}
357357

358-
if (gre_offload_init()) {
359-
pr_err("can't add protocol offload\n");
360-
goto err_gso;
361-
}
362-
363358
return 0;
364-
err_gso:
365-
gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO);
366359
err_gre:
367360
inet_del_protocol(&net_gre_protocol, IPPROTO_GRE);
368361
err:
@@ -371,8 +364,6 @@ static int __init gre_init(void)
371364

372365
static void __exit gre_exit(void)
373366
{
374-
gre_offload_exit();
375-
376367
gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO);
377368
inet_del_protocol(&net_gre_protocol, IPPROTO_GRE);
378369
}

net/ipv4/gre_offload.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,15 @@ static const struct net_offload gre_offload = {
123123
},
124124
};
125125

126-
int __init gre_offload_init(void)
126+
static int __init gre_offload_init(void)
127127
{
128128
return inet_add_offload(&gre_offload, IPPROTO_GRE);
129129
}
130130

131-
void __exit gre_offload_exit(void)
131+
static void __exit gre_offload_exit(void)
132132
{
133133
inet_del_offload(&gre_offload, IPPROTO_GRE);
134134
}
135+
136+
module_init(gre_offload_init);
137+
module_exit(gre_offload_exit);

0 commit comments

Comments
 (0)