Commit b97d6b68 authored by Matthieu Baerts (NGI0)'s avatar Matthieu Baerts (NGI0) Committed by Paolo Abeni
Browse files

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.

Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250313-net-next-mptcp-pm-ops-intro-v1-1-f4e4a88efc50@kernel.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 27b91800
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
}
+1 −4
Original line number Diff line number Diff line
@@ -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");
}
+6 −0
Original line number Diff line number Diff line
@@ -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");
}
+1 −0
Original line number Diff line number Diff line
@@ -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);