netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv4: Introduce ipip_offload_init helper function.
@ 2017-08-02 16:34 Tonghao Zhang
  2017-08-03 16:27 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Tonghao Zhang @ 2017-08-02 16:34 UTC (permalink / raw)
  To: netdev; +Cc: Tonghao Zhang

It's convenient to init ipip offload. We will check
the return value, and print KERN_CRIT info on failure.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 net/ipv4/af_inet.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 5ce44fb..c888120 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1763,6 +1763,11 @@ static int __init init_inet_pernet_ops(void)
 	},
 };
 
+static int __init ipip_offload_init(void)
+{
+	return inet_add_offload(&ipip_offload, IPPROTO_IPIP);
+}
+
 static int __init ipv4_offload_init(void)
 {
 	/*
@@ -1772,9 +1777,10 @@ static int __init ipv4_offload_init(void)
 		pr_crit("%s: Cannot add UDP protocol offload\n", __func__);
 	if (tcpv4_offload_init() < 0)
 		pr_crit("%s: Cannot add TCP protocol offload\n", __func__);
+	if (ipip_offload_init() < 0)
+		pr_crit("%s: Cannot add IPIP protocol offload\n", __func__);
 
 	dev_add_offload(&ip_packet_offload);
-	inet_add_offload(&ipip_offload, IPPROTO_IPIP);
 	return 0;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipv4: Introduce ipip_offload_init helper function.
  2017-08-02 16:34 [PATCH] ipv4: Introduce ipip_offload_init helper function Tonghao Zhang
@ 2017-08-03 16:27 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-08-03 16:27 UTC (permalink / raw)
  To: xiangxia.m.yue; +Cc: netdev

From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Wed,  2 Aug 2017 09:34:15 -0700

> It's convenient to init ipip offload. We will check
> the return value, and print KERN_CRIT info on failure.
> 
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-03 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 16:34 [PATCH] ipv4: Introduce ipip_offload_init helper function Tonghao Zhang
2017-08-03 16:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).