linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: mptcp@lists.linux.dev, Mat Martineau <martineau@kernel.org>,
	 Geliang Tang <geliang@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Jonathan Corbet <corbet@lwn.net>, Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH net-next 01/12] mptcp: pm: split netlink and in-kernel init
Date: Thu, 13 Mar 2025 11:20:50 +0100	[thread overview]
Message-ID: <20250313-net-next-mptcp-pm-ops-intro-v1-1-f4e4a88efc50@kernel.org> (raw)
In-Reply-To: <20250313-net-next-mptcp-pm-ops-intro-v1-0-f4e4a88efc50@kernel.org>

The registration of mptcp_genl_family is useful for both the in-kernel
and the userspace PM. It should then be done in pm_netlink.c.

On the other hand, the registration of the in-kernel pernet subsystem is
specific to the in-kernel PM, and should stay there in pm_kernel.c.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/pm.c         | 1 +
 net/mptcp/pm_kernel.c  | 5 +----
 net/mptcp/pm_netlink.c | 6 ++++++
 net/mptcp/protocol.h   | 1 +
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 833839d7286e717599579356af3117f70e39de0a..8e6a325a389803196c35175cd5ea7637624d0ee2 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -1022,5 +1022,6 @@ void mptcp_pm_data_init(struct mptcp_sock *msk)
 
 void __init mptcp_pm_init(void)
 {
+	mptcp_pm_kernel_register();
 	mptcp_pm_nl_init();
 }
diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index daf8f98a316439a67c12f63f2388ef497dae08dd..62ae68abb2cb0066a30a3fab88ae5f082c523413 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -1400,11 +1400,8 @@ static struct pernet_operations mptcp_pm_pernet_ops = {
 	.size = sizeof(struct pm_nl_pernet),
 };
 
-void __init mptcp_pm_nl_init(void)
+void __init mptcp_pm_kernel_register(void)
 {
 	if (register_pernet_subsys(&mptcp_pm_pernet_ops) < 0)
 		panic("Failed to register MPTCP PM pernet subsystem.\n");
-
-	if (genl_register_family(&mptcp_genl_family))
-		panic("Failed to register MPTCP PM netlink family\n");
 }
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index b2e5bbdcd5df920887ffbd9b6d652f422b32d49e..50aaf259959aeaf36e7ab954c6f7957eaf2bc390 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -625,3 +625,9 @@ struct genl_family mptcp_genl_family __ro_after_init = {
 	.mcgrps		= mptcp_pm_mcgrps,
 	.n_mcgrps	= ARRAY_SIZE(mptcp_pm_mcgrps),
 };
+
+void __init mptcp_pm_nl_init(void)
+{
+	if (genl_register_family(&mptcp_genl_family))
+		panic("Failed to register MPTCP PM netlink family\n");
+}
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index c51b6a22d5e099c4486cc76fc4abc9a91c574c4a..ffb70fe08181815c23629354f78e3bdbe599e703 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1147,6 +1147,7 @@ static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflo
 	return local_id;
 }
 
+void __init mptcp_pm_kernel_register(void);
 void __init mptcp_pm_nl_init(void);
 void mptcp_pm_worker(struct mptcp_sock *msk);
 void __mptcp_pm_kernel_worker(struct mptcp_sock *msk);

-- 
2.48.1


  reply	other threads:[~2025-03-13 10:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13 10:20 [PATCH net-next 00/12] mptcp: pm: prep work for new ops and sysctl knobs Matthieu Baerts (NGI0)
2025-03-13 10:20 ` Matthieu Baerts (NGI0) [this message]
2025-03-18 17:20   ` [PATCH net-next 01/12] mptcp: pm: split netlink and in-kernel init Simon Horman
2025-03-13 10:20 ` [PATCH net-next 02/12] mptcp: pm: in-kernel: use kmemdup helper Matthieu Baerts (NGI0)
2025-03-18 17:20   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 03/12] mptcp: pm: use pm variable instead of msk->pm Matthieu Baerts (NGI0)
2025-03-18 17:20   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 04/12] mptcp: pm: only fill id_avail_bitmap for in-kernel pm Matthieu Baerts (NGI0)
2025-03-18 17:22   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 05/12] mptcp: pm: add struct_group in mptcp_pm_data Matthieu Baerts (NGI0)
2025-03-18 17:23   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 06/12] mptcp: pm: define struct mptcp_pm_ops Matthieu Baerts (NGI0)
2025-03-18 17:23   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 07/12] mptcp: pm: register in-kernel and userspace PM Matthieu Baerts (NGI0)
2025-03-18 17:23   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 08/12] mptcp: sysctl: set path manager by name Matthieu Baerts (NGI0)
2025-03-18 17:24   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 09/12] mptcp: sysctl: map path_manager to pm_type Matthieu Baerts (NGI0)
2025-03-18 17:24   ` Simon Horman
2025-03-13 10:20 ` [PATCH net-next 10/12] mptcp: sysctl: map pm_type to path_manager Matthieu Baerts (NGI0)
2025-03-18 17:24   ` Simon Horman
2025-03-13 10:21 ` [PATCH net-next 11/12] mptcp: sysctl: add available_path_managers Matthieu Baerts (NGI0)
2025-03-18 17:24   ` Simon Horman
2025-03-13 10:21 ` [PATCH net-next 12/12] selftests: mptcp: add pm sysctl mapping tests Matthieu Baerts (NGI0)
2025-03-18 17:25   ` Simon Horman
2025-03-20  9:30 ` [PATCH net-next 00/12] mptcp: pm: prep work for new ops and sysctl knobs patchwork-bot+netdevbpf

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=20250313-net-next-mptcp-pm-ops-intro-v1-1-f4e4a88efc50@kernel.org \
    --to=matttbe@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@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).