net: gre: move GSO functions to gre_offload
Subsystems (2)
PATCH 1/1 net: gre: move GSO functions to gre_offload
Similarly to TCP/UDP offloading, move all related GRE functions to gre_offload.c to make things more explicit and similar to the rest of the code.
---
When net is merged into net-next, this will clash with bd8a7036c06cf1577 ("gre:
fix a possible skb leak") in gre_gso_segment() as kfree_skb() is being replaced with kfree_skb_list() in one occurence. How would you like to handle this Dave? This patch is not really urgent though, but maybe we could get this still in before net-next closes.
include/net/gre.h | 4 + net/ipv4/Makefile | 1 + net/ipv4/gre.c | 514 ------------------------------------------------- net/ipv4/gre_demux.c | 414 +++++++++++++++++++++++++++++++++++++++ net/ipv4/gre_offload.c | 127 ++++++++++++ 5 files changed, 546 insertions(+), 514 deletions(-) delete mode 100644 net/ipv4/gre.c create mode 100644 net/ipv4/gre_demux.c create mode 100644 net/ipv4/gre_offload.c
include/net/gre.h +4 -0
@@ -32,6 +32,10 @@ struct gre_cisco_protocol {int gre_cisco_register (struct gre_cisco_protocol *proto);int gre_cisco_unregister (struct gre_cisco_protocol *proto); + +int gre_offload_init (void ); +void gre_offload_exit (void ); +void gre_build_header (struct sk_buff *skb,const struct tnl_ptk_info *tpi,int hdr_len);struct sk_buff *gre_handle_offloads (struct sk_buff *skb,bool gre_csum);
net/ipv4/Makefile +1 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_IP_MULTIPLE_TABLES) += fib_rules.o obj-$(CONFIG_IP_MROUTE) += ipmr.o obj-$(CONFIG_NET_IPIP) += ipip.o +gre-y := gre_demux.o gre_offload.o obj-$(CONFIG_NET_IPGRE_DEMUX) += gre.o obj-$(CONFIG_NET_IPGRE) += ip_gre.o obj-$(CONFIG_NET_IPVTI) += ip_vti.o
net/ipv4/gre.c deleted +0 -514
514 lines not on this page · raw message
net/ipv4/gre_demux.c new file +414 -0
414 lines not on this page · raw message
net/ipv4/gre_offload.c new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
1.7.11.7
David Miller
maintainerFrom: Daniel Borkmann <[email protected]>
Date: Mon, 1 Jul 2013 19:24:00 +0200
Quoted 4 lines
Similarly to TCP/UDP offloading, move all related GRE functions to
gre_offload.cto make things more explicit and similar to the rest of the code.
Quoted 8 lines
Suggested-by Eric Dumazet <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>---
When net is merged into net-next, this will clash withbd8a7036c06cf1577("gre:
fix a possible skb leak") ingre_gso_segment()askfree_skb()is being replaced withkfree_skb_list()in one occurence. How would you like to handle this Dave? This patch is not really urgent though, but maybe we could get this still in before net-next closes.
I've applied this and did the messy merge.
Actually the GRE part wasn't that bad. :-)
Thanks!