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 v2 net-next 05/12] inet: frags: refactor lowpan_net_frag_init()
Date: Fri, 30 Mar 2018 13:42:29 -0700	[thread overview]
Message-ID: <20180330204236.43675-6-edumazet@google.com> (raw)
In-Reply-To: <20180330204236.43675-1-edumazet@google.com>

We want to call lowpan_net_frag_init() earlier.
Similar to commit "inet: frags: refactor ipv6_frag_init()"

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

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ieee802154/6lowpan/reassembly.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c
index 6badc055555b7baedac2051a1aaea15f9e9b180c..ddada12a044de293f904a1dc7a5ff398d089d101 100644
--- a/net/ieee802154/6lowpan/reassembly.c
+++ b/net/ieee802154/6lowpan/reassembly.c
@@ -615,14 +615,6 @@ int __init lowpan_net_frag_init(void)
 {
 	int ret;
 
-	ret = lowpan_frags_sysctl_register();
-	if (ret)
-		return ret;
-
-	ret = register_pernet_subsys(&lowpan_frags_ops);
-	if (ret)
-		goto err_pernet;
-
 	lowpan_frags.hashfn = lowpan_hashfn;
 	lowpan_frags.constructor = lowpan_frag_init;
 	lowpan_frags.destructor = NULL;
@@ -631,12 +623,22 @@ int __init lowpan_net_frag_init(void)
 	lowpan_frags.frag_expire = lowpan_frag_expire;
 	lowpan_frags.frags_cache_name = lowpan_frags_cache_name;
 	ret = inet_frags_init(&lowpan_frags);
+	if (ret)
+		goto out;
+
+	ret = lowpan_frags_sysctl_register();
+	if (ret)
+		goto err_sysctl;
+
+	ret = register_pernet_subsys(&lowpan_frags_ops);
 	if (ret)
 		goto err_pernet;
-
+out:
 	return ret;
 err_pernet:
 	lowpan_frags_sysctl_unregister();
+err_sysctl:
+	inet_frags_fini(&lowpan_frags);
 	return ret;
 }
 
-- 
2.17.0.rc1.321.gba9d0f2565-goog

  parent reply	other threads:[~2018-03-30 20:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 20:42 [PATCH v2 net-next 00/12] inet: frags: bring rhashtables to IP defrag Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 01/12] ipv6: frag: remove unused field Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 02/12] inet: frags: change inet_frags_init_net() return value Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 03/12] inet: frags: add a pointer to struct netns_frags Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 04/12] inet: frags: refactor ipv6_frag_init() Eric Dumazet
2018-03-30 20:42 ` Eric Dumazet [this message]
2018-03-30 20:42 ` [PATCH v2 net-next 06/12] inet: frags: refactor ipfrag_init() Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 07/12] rhashtable: add schedule points Eric Dumazet
2018-03-31  4:19   ` Herbert Xu
2018-03-30 20:42 ` [PATCH v2 net-next 08/12] inet: frags: use rhashtables for reassembly units Eric Dumazet
2018-03-30 22:43   ` Eric Dumazet
2018-03-30 22:44   ` Kirill Tkhai
2018-03-30 22:54     ` Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 09/12] inet: frags: remove some helpers Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 10/12] inet: frags: get rif of inet_frag_evicting() Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 net-next 11/12] inet: frags: remove inet_frag_maybe_warn_overflow() Eric Dumazet
2018-03-30 20:42 ` [PATCH v2 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=20180330204236.43675-6-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).