mptcp: pm: split netlink and in-kernel init
Subsystems (2)
Matthieu Baerts (NGI0)
maintainerPATCH 1/1 mptcp: pm: split netlink and in-kernel init
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.
--- 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(-)
net/mptcp/pm.c +1 -0
@@ -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 (); }
net/mptcp/pm_kernel.c +1 -4
@@ -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" ); }
net/mptcp/pm_netlink.c +6 -0
@@ -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" ); +}
net/mptcp/protocol.h +1 -0
@@ -1152,6 +1152,7 @@ static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subfloreturn 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,
Signature · 1 line
Matthieu Baerts (NGI0) <[email protected]>
Hi Matthieu,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/13633693015
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/c3fb924097a5
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=939640
If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normalFor more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
Quoted 6 lines · On Mon, 3 Mar 2025, Matthieu Baerts (NGI0) wrote:
The registration of
mptcp_genl_familyis useful for both the in-kernel and the userspace PM. It should then be done inpm_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.
Quoted 7 lines
Signed-off-by Matthieu Baerts (NGI0) <[email protected]>---
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:
Quoted 66 lines
net/mptcp/pm.c +1
-0@@ -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 (); }net/mptcp/pm_kernel.c +1
-4@@ -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" ); }net/mptcp/pm_netlink.c +6
-0@@ -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" ); +}net/mptcp/protocol.h +1
-1@@ -1152,6 +1152,7 @@ static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subfloreturn 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-a9ec7d8d9756Best regards,
Signature · 1 line
Matthieu Baerts (NGI0) <[email protected]>
Matthieu Baerts
maintainerHi Mat,
Quoted 16 lines · Mat Martineau
Quoted 6 lines · On Mon, 3 Mar 2025, Matthieu Baerts (NGI0) wrote:
The registration of
mptcp_genl_familyis useful for both the in-kernel and the userspace PM. It should then be done inpm_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.Quoted 7 lines
Signed-off-by Matthieu Baerts (NGI0) <[email protected]>---
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(-)
Quoted 5 lines
Hi Matthieu -
Looks good to me:
Reviewed-by Mat Martineau <[email protected]>
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:
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.