All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: davem@davemloft.net, xiyou.wangcong@gmail.com,
	yoshfuji@linux-ipv6.org, ktkhai@virtuozzo.com,
	avagin@virtuozzo.com, edumazet@google.com, ebiederm@xmission.com,
	netdev@vger.kernel.org
Subject: [PATCH 2/3] net: Register af_inet_ops earlier
Date: Thu, 20 Sep 2018 12:12:01 +0300	[thread overview]
Message-ID: <153743469969.21312.2316847616468846087.stgit@localhost.localdomain> (raw)
In-Reply-To: <153743451940.21312.15708795592586962785.stgit@localhost.localdomain>

This function just initializes locks and defaults.
Let register it before other pernet operation,
since some of them potentially may relay on that.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/af_inet.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index f4ecbe0aaf1a..bbd3a072ffea 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1938,6 +1938,9 @@ static int __init inet_init(void)
 	for (q = inetsw_array; q < &inetsw_array[INETSW_ARRAY_LEN]; ++q)
 		inet_register_protosw(q);
 
+	if (init_inet_pernet_ops())
+		pr_crit("%s: Cannot init ipv4 inet pernet ops\n", __func__);
+
 	/*
 	 *	Set the ARP module up
 	 */
@@ -1975,9 +1978,6 @@ static int __init inet_init(void)
 	if (ip_mr_init())
 		pr_crit("%s: Cannot init ipv4 mroute\n", __func__);
 #endif
-
-	if (init_inet_pernet_ops())
-		pr_crit("%s: Cannot init ipv4 inet pernet ops\n", __func__);
 	/*
 	 *	Initialise per-cpu ipv4 mibs
 	 */

  parent reply	other threads:[~2018-09-20 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20  9:11 [PATCH net-next 0/3] Refactorings on af_inet pernet initialization Kirill Tkhai
2018-09-20  9:11 ` [PATCH 1/3] net: Remove inet_exit_net() Kirill Tkhai
2018-09-20  9:12 ` Kirill Tkhai [this message]
2018-09-20 17:03   ` [PATCH 2/3] net: Register af_inet_ops earlier Cong Wang
2018-09-20  9:12 ` [PATCH 3/3] ipv4: initialize ra_mutex in inet_init_net() Kirill Tkhai
2018-09-20 17:01   ` Cong Wang

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=153743469969.21312.2316847616468846087.stgit@localhost.localdomain \
    --to=ktkhai@virtuozzo.com \
    --cc=avagin@virtuozzo.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.