From: Vlad Yasevich <vyasevic@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, eric.dumazet@gmail.com
Subject: [PATCH V2 12/14] ipv4: Pull GSO registration out of inet_init()
Date: Thu, 15 Nov 2012 13:49:21 -0500 [thread overview]
Message-ID: <1353005363-6974-13-git-send-email-vyasevic@redhat.com> (raw)
In-Reply-To: <1353005363-6974-1-git-send-email-vyasevic@redhat.com>
Since GSO/GRO support is now separated, make IPv4 GSO a
stand-alone init call and not part of inet_init().
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
net/ipv4/af_inet.c | 35 +++++++++++++++++++++--------------
1 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 66f63ce..9f2e7fd 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1665,11 +1665,6 @@ static int ipv4_proc_init(void);
* IP protocol layer initialiser
*/
-static struct packet_type ip_packet_type __read_mostly = {
- .type = cpu_to_be16(ETH_P_IP),
- .func = ip_rcv,
-};
-
static struct packet_offload ip_packet_offload __read_mostly = {
.type = cpu_to_be16(ETH_P_IP),
.gso_send_check = inet_gso_send_check,
@@ -1678,6 +1673,27 @@ static struct packet_offload ip_packet_offload __read_mostly = {
.gro_complete = inet_gro_complete,
};
+static int __init ipv4_offload_init(void)
+{
+ /*
+ * Add offloads
+ */
+ if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0)
+ pr_crit("%s: Cannot add UDP protocol offload\n", __func__);
+ if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0)
+ pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__);
+
+ dev_add_offload(&ip_packet_offload);
+ return 0;
+}
+
+fs_initcall(ipv4_offload_init);
+
+static struct packet_type ip_packet_type __read_mostly = {
+ .type = cpu_to_be16(ETH_P_IP),
+ .func = ip_rcv,
+};
+
static int __init inet_init(void)
{
struct sk_buff *dummy_skb;
@@ -1720,14 +1736,6 @@ static int __init inet_init(void)
tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem;
/*
- * Add offloads
- */
- if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0)
- pr_crit("%s: Cannot add UDP protocol offload\n", __func__);
- if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0)
- pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__);
-
- /*
* Add all the base protocols.
*/
@@ -1799,7 +1807,6 @@ static int __init inet_init(void)
ipfrag_init();
- dev_add_offload(&ip_packet_offload);
dev_add_pack(&ip_packet_type);
rc = 0;
--
1.7.7.6
next prev parent reply other threads:[~2012-11-15 18:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 18:49 [PATCH V2 00/14] Always build GSO/GRO functionality into the kernel Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 01/14] net: Add generic packet offload infrastructure Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 02/14] net: Switch to using the new packet offload infrustructure Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 03/14] net: Add net protocol offload registration infrustructure Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 04/14] ipv6: Add new offload registration infrastructure Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 05/14] ipv4: Switch to using the new offload infrastructure Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 06/14] ipv6: Switch to using " Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 07/14] ipv6: Separate ipv6 offload support Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 08/14] ipv6: Separate tcp offload functionality Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 09/14] ipv6: Separate out UDP " Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 10/14] ipv6: Move exthdr offload support into separate file Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 11/14] ipv6: Update ipv6 static library with newly needed functions Vlad Yasevich
2012-11-15 18:49 ` Vlad Yasevich [this message]
2012-11-15 18:49 ` [PATCH V2 13/14] ipv6: Pull IPv6 GSO registration out of the module Vlad Yasevich
2012-11-15 18:49 ` [PATCH V2 14/14] net: Remove code duplication between offload structures Vlad Yasevich
2012-11-15 22:42 ` [PATCH V2 00/14] Always build GSO/GRO functionality into the kernel David Miller
2012-11-15 22:48 ` Vlad Yasevich
2012-11-15 22:53 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353005363-6974-13-git-send-email-vyasevic@redhat.com \
--to=vyasevic@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).