diff mbox series

[mptcp-next,v1,5/9] mptcp: pm: in-kernel: subflow_closed interface

Message ID bc557b86200f66d9541d0b6ba61f756c7d1c8766.1740047738.git.tanggeliang@kylinos.cn (mailing list archive)
State New
Delegated to: Matthieu Baerts
Headers show
Series BPF path manager, part 5 | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
matttbe/shellcheck success MPTCP selftests files have not been modified
matttbe/build success Build and static analysis OK
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug success Success! ✅
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ success Success! ✅
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ success Success! ✅

Commit Message

Geliang Tang Feb. 20, 2025, 10:36 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

Update the 2nd parameter of mptcp_pm_nl_subflow_closed(), and define it
as the subflow_closed() interface of the in-kernel netlink PM.

This interface is invoked under holding the msk socket lock.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/pm_netlink.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 9795f08a33a6..a6344945874a 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1540,8 +1540,9 @@  static int mptcp_pm_nl_address_removed(struct mptcp_sock *msk,
 }
 
 static int mptcp_pm_nl_subflow_closed(struct mptcp_sock *msk,
-				      const struct mptcp_pm_addr_entry *local)
+				      struct mptcp_pm_param *param)
 {
+	struct mptcp_pm_addr_entry *local = &param->entry;
 	struct mptcp_rm_list list = { .nr = 1 };
 	bool remove_subflow;
 
@@ -1586,7 +1587,9 @@  static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
 		msk->pm.ops && msk->pm.ops->address_removed ?
 			msk->pm.ops->address_removed(msk, &param) :
 			mptcp_pm_nl_address_removed(msk, &param);
-		mptcp_pm_nl_subflow_closed(msk, entry);
+		msk->pm.ops && msk->pm.ops->subflow_closed ?
+			msk->pm.ops->subflow_closed(msk, &param) :
+			mptcp_pm_nl_subflow_closed(msk, &param);
 		release_sock(sk);
 
 next:
@@ -2423,6 +2426,7 @@  static struct mptcp_pm_ops mptcp_netlink_pm = {
 	.address_announced	= mptcp_pm_nl_address_announced,
 	.address_removed	= mptcp_pm_nl_address_removed,
 	.subflow_established	= mptcp_pm_nl_subflow_established,
+	.subflow_closed		= mptcp_pm_nl_subflow_closed,
 	.get_local_id		= mptcp_pm_nl_get_local_id,
 	.get_priority		= mptcp_pm_nl_get_priority,
 	.type			= MPTCP_PM_TYPE_KERNEL,