netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Florian Westphal <fw@strlen.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Thomas Graf <tgraf@suug.ch>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@osg.samsung.com>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v3 net-next 04/12] inet: frags: refactor ipv6_frag_init()
Date: Fri, 30 Mar 2018 17:53:01 -0700	[thread overview]
Message-ID: <20180331005309.179376-5-edumazet@google.com> (raw)
In-Reply-To: <20180331005309.179376-1-edumazet@google.com>

We want to call inet_frags_init() earlier.

This is a prereq to "inet: frags: use rhashtables for reassembly units"

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/reassembly.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 4855de6f673a4753526679ca29dcdaebecb5777f..f0071b113a92fcff15ac57610170c12b17cb59ba 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -742,18 +742,6 @@ int __init ipv6_frag_init(void)
 {
 	int ret;
 
-	ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
-	if (ret)
-		goto out;
-
-	ret = ip6_frags_sysctl_register();
-	if (ret)
-		goto err_sysctl;
-
-	ret = register_pernet_subsys(&ip6_frags_ops);
-	if (ret)
-		goto err_pernet;
-
 	ip6_frags.hashfn = ip6_hashfn;
 	ip6_frags.constructor = ip6_frag_init;
 	ip6_frags.destructor = NULL;
@@ -762,8 +750,21 @@ int __init ipv6_frag_init(void)
 	ip6_frags.frag_expire = ip6_frag_expire;
 	ip6_frags.frags_cache_name = ip6_frag_cache_name;
 	ret = inet_frags_init(&ip6_frags);
+	if (ret)
+		goto out;
+
+	ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
+	if (ret)
+		goto err_protocol;
+
+	ret = ip6_frags_sysctl_register();
+	if (ret)
+		goto err_sysctl;
+
+	ret = register_pernet_subsys(&ip6_frags_ops);
 	if (ret)
 		goto err_pernet;
+
 out:
 	return ret;
 
@@ -771,6 +772,8 @@ int __init ipv6_frag_init(void)
 	ip6_frags_sysctl_unregister();
 err_sysctl:
 	inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
+err_protocol:
+	inet_frags_fini(&ip6_frags);
 	goto out;
 }
 
-- 
2.17.0.rc1.321.gba9d0f2565-goog

  parent reply	other threads:[~2018-03-31  0:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31  0:52 [PATCH v3 net-next 00/12] inet: frags: bring rhashtables to IP defrag Eric Dumazet
2018-03-31  0:52 ` [PATCH v3 net-next 01/12] ipv6: frag: remove unused field Eric Dumazet
2018-03-31  0:52 ` [PATCH v3 net-next 02/12] inet: frags: change inet_frags_init_net() return value Eric Dumazet
2018-03-31  0:53 ` [PATCH v3 net-next 03/12] inet: frags: add a pointer to struct netns_frags Eric Dumazet
2018-03-31  0:53 ` Eric Dumazet [this message]
2018-03-31  0:53 ` [PATCH v3 net-next 05/12] inet: frags: refactor lowpan_net_frag_init() Eric Dumazet
2018-03-31  0:53 ` [PATCH v3 net-next 06/12] inet: frags: refactor ipfrag_init() Eric Dumazet
2018-03-31  0:53 ` [PATCH v3 net-next 07/12] rhashtable: add schedule points Eric Dumazet
2018-03-31  4:21   ` Herbert Xu
2018-03-31  0:53 ` [PATCH v3 net-next 08/12] inet: frags: use rhashtables for reassembly units Eric Dumazet
2018-03-31  7:47   ` [RFC PATCH] inet: frags: lowpan_rhash_params can be static kbuild test robot
2018-03-31 13:46     ` Eric Dumazet
2018-03-31  7:47   ` [PATCH v3 net-next 08/12] inet: frags: use rhashtables for reassembly units kbuild test robot
2018-03-31  0:53 ` [PATCH v3 net-next 09/12] inet: frags: remove some helpers Eric Dumazet
2018-03-31  0:53 ` [PATCH v3 net-next 10/12] inet: frags: get rif of inet_frag_evicting() Eric Dumazet
2018-03-31  0:53 ` [PATCH v3 net-next 11/12] inet: frags: remove inet_frag_maybe_warn_overflow() Eric Dumazet
2018-03-31  0:53 ` [PATCH v3 net-next 12/12] inet: frags: break the 2GB limit for frags storage Eric Dumazet

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=20180331005309.179376-5-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=alex.aring@gmail.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=ktkhai@virtuozzo.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefan@osg.samsung.com \
    --cc=tgraf@suug.ch \
    /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).