aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-01-06 17:03:07 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-06 20:28:34 -0500
commit438e38fadca2f6e57eeecc08326c8a95758594d4 (patch)
tree8c71bf332c0827545b2ece7471c09a4489cba5dc /net/ipv4
parent0e5959346cb859851e99ed87bd07f76ed5bb3a37 (diff)
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/Makefile4
-rw-r--r--net/ipv4/gre_demux.c9
-rw-r--r--net/ipv4/gre_offload.c7
3 files changed, 7 insertions, 13 deletions
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
index 4b81e91c80fe..f8c49ce5b283 100644
--- a/net/ipv4/Makefile
+++ b/net/ipv4/Makefile
@@ -11,7 +11,7 @@ obj-y := route.o inetpeer.o protocol.o \
11 tcp_offload.o datagram.o raw.o udp.o udplite.o \ 11 tcp_offload.o datagram.o raw.o udp.o udplite.o \
12 udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \ 12 udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \
13 fib_frontend.o fib_semantics.o fib_trie.o \ 13 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
15 15
16obj-$(CONFIG_NET_IP_TUNNEL) += ip_tunnel.o 16obj-$(CONFIG_NET_IP_TUNNEL) += ip_tunnel.o
17obj-$(CONFIG_SYSCTL) += sysctl_net_ipv4.o 17obj-$(CONFIG_SYSCTL) += sysctl_net_ipv4.o
@@ -19,7 +19,7 @@ obj-$(CONFIG_PROC_FS) += proc.o
19obj-$(CONFIG_IP_MULTIPLE_TABLES) += fib_rules.o 19obj-$(CONFIG_IP_MULTIPLE_TABLES) += fib_rules.o
20obj-$(CONFIG_IP_MROUTE) += ipmr.o 20obj-$(CONFIG_IP_MROUTE) += ipmr.o
21obj-$(CONFIG_NET_IPIP) += ipip.o 21obj-$(CONFIG_NET_IPIP) += ipip.o
22gre-y := gre_demux.o gre_offload.o 22gre-y := gre_demux.o
23obj-$(CONFIG_NET_IPGRE_DEMUX) += gre.o 23obj-$(CONFIG_NET_IPGRE_DEMUX) += gre.o
24obj-$(CONFIG_NET_IPGRE) += ip_gre.o 24obj-$(CONFIG_NET_IPGRE) += ip_gre.o
25obj-$(CONFIG_NET_IPVTI) += ip_vti.o 25obj-$(CONFIG_NET_IPVTI) += ip_vti.o
diff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c
index 5893e99e8299..1863422fb7d5 100644
--- a/net/ipv4/gre_demux.c
+++ b/net/ipv4/gre_demux.c
@@ -355,14 +355,7 @@ static int __init gre_init(void)
355 goto err_gre; 355 goto err_gre;
356 } 356 }
357 357
358 if (gre_offload_init()) {
359 pr_err("can't add protocol offload\n");
360 goto err_gso;
361 }
362
363 return 0; 358 return 0;
364err_gso:
365 gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO);
366err_gre: 359err_gre:
367 inet_del_protocol(&net_gre_protocol, IPPROTO_GRE); 360 inet_del_protocol(&net_gre_protocol, IPPROTO_GRE);
368err: 361err:
@@ -371,8 +364,6 @@ err:
371 364
372static void __exit gre_exit(void) 365static void __exit gre_exit(void)
373{ 366{
374 gre_offload_exit();
375
376 gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO); 367 gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO);
377 inet_del_protocol(&net_gre_protocol, IPPROTO_GRE); 368 inet_del_protocol(&net_gre_protocol, IPPROTO_GRE);
378} 369}
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index 2cd02f32f99f..9138cfb10140 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -123,12 +123,15 @@ static const struct net_offload gre_offload = {
123 }, 123 },
124}; 124};
125 125
126int __init gre_offload_init(void) 126static int __init gre_offload_init(void)
127{ 127{
128 return inet_add_offload(&gre_offload, IPPROTO_GRE); 128 return inet_add_offload(&gre_offload, IPPROTO_GRE);
129} 129}
130 130
131void __exit gre_offload_exit(void) 131static void __exit gre_offload_exit(void)
132{ 132{
133 inet_del_offload(&gre_offload, IPPROTO_GRE); 133 inet_del_offload(&gre_offload, IPPROTO_GRE);
134} 134}
135
136module_init(gre_offload_init);
137module_exit(gre_offload_exit);