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(-)
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.
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 9bdfd915d62f52feb8e3f29f6f429dfa837f5f2b..bb9504e0510a1630d6903201d4fc8dcf7e47808e 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1152,6 +1152,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);
---
base-commit: b084c48057bbf45fbedc06d7a9d4ec417992fb1e
change-id: 20250303-mptcp-pm-split-init-nl-kernel-a9ec7d8d9756
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
On Mon, 3 Mar 2025, Matthieu Baerts (NGI0) wrote:
> 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.
>
> 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(-)
Hi Matthieu -
Looks good to me:
Reviewed-by: Mat Martineau <martineau@kernel.org>
>
> 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 9bdfd915d62f52feb8e3f29f6f429dfa837f5f2b..bb9504e0510a1630d6903201d4fc8dcf7e47808e 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -1152,6 +1152,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);
>
> ---
> base-commit: b084c48057bbf45fbedc06d7a9d4ec417992fb1e
> change-id: 20250303-mptcp-pm-split-init-nl-kernel-a9ec7d8d9756
>
> Best regards,
> --
> Matthieu Baerts (NGI0) <matttbe@kernel.org>
>
>
>
Hi Mat, On 04/03/2025 02:43, Mat Martineau wrote: > On Mon, 3 Mar 2025, Matthieu Baerts (NGI0) wrote: > >> 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. >> >> 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(-) > > Hi Matthieu - > > Looks good to me: > > Reviewed-by: Mat Martineau <martineau@kernel.org> Thank you for the review! Now in our tree (feat. for net-next)! New patches for t/upstream: - 282f18434518: mptcp: pm: split netlink and in-kernel init - Results: 117a4dd30ea9..c6a94c37f925 (export) Tests are now in progress: - export: https://github.com/multipath-tcp/mptcp_net-next/commit/d08d42b0b5ba6d8ed06655f2ef1e5a5270841167/checks Cheers, Matt -- Sponsored by the NGI0 Core fund.
© 2016 - 2026 Red Hat, Inc.