Skip to content

Commit

Permalink
mptcp: add back mptcp_pm_subflow_closed
Browse files Browse the repository at this point in the history
The MPTCP path manager event handler mptcp_pm_subflow_closed interface
is added in the commit "mptcp: Add path manager interface", but removed
in the commit "mptcp: do not block subflows creation on errors".

This patch adds it back and changes its 2nd parameter from "u8 id" to
"struct sock *ssk". Invoke mptcp_event with the MPTCP_EVENT_SUB_CLOSED
event type in it.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Sep 9, 2024
1 parent 82f2515 commit f2582dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions net/mptcp/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ void mptcp_pm_subflow_established(struct mptcp_sock *msk)
spin_unlock_bh(&pm->lock);
}

void mptcp_pm_subflow_closed(struct mptcp_sock *msk, struct sock *ssk)
{
pr_debug("msk=%p", msk);

mptcp_event(MPTCP_EVENT_SUB_CLOSED, msk, ssk, GFP_KERNEL);
}

void mptcp_pm_subflow_check_next(struct mptcp_sock *msk,
const struct mptcp_subflow_context *subflow)
{
Expand Down
2 changes: 1 addition & 1 deletion net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2515,7 +2515,7 @@ void mptcp_close_ssk(struct sock *sk, struct sock *ssk,
subflow->close_event_done = true;

if (sk->sk_state == TCP_ESTABLISHED)
mptcp_event(MPTCP_EVENT_SUB_CLOSED, mptcp_sk(sk), ssk, GFP_KERNEL);
mptcp_pm_subflow_closed(mptcp_sk(sk), ssk);

/* subflow aborted before reaching the fully_established status
* attempt the creation of the next subflow
Expand Down
1 change: 1 addition & 0 deletions net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk);
bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk);
void mptcp_pm_connection_closed(struct mptcp_sock *msk);
void mptcp_pm_subflow_established(struct mptcp_sock *msk);
void mptcp_pm_subflow_closed(struct mptcp_sock *msk, struct sock *ssk);
bool mptcp_pm_nl_check_work_pending(struct mptcp_sock *msk);
void mptcp_pm_subflow_check_next(struct mptcp_sock *msk,
const struct mptcp_subflow_context *subflow);
Expand Down

0 comments on commit f2582dc

Please sign in to comment.