mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
mptcp: optimize release_cb for the common case
The mptcp release callback checks several flags in atomic context, but only MPTCP_CLEAN_UNA can be up frequently. Reorganize the code to avoid multiple conditionals in the most common scenarios. Additional clarify a related comment. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4696ad36d7
commit
65a569b03c
1 changed files with 9 additions and 7 deletions
|
@ -3092,15 +3092,17 @@ static void mptcp_release_cb(struct sock *sk)
|
|||
spin_lock_bh(&sk->sk_lock.slock);
|
||||
}
|
||||
|
||||
if (__test_and_clear_bit(MPTCP_CLEAN_UNA, &msk->cb_flags))
|
||||
__mptcp_clean_una_wakeup(sk);
|
||||
if (unlikely(&msk->cb_flags)) {
|
||||
/* be sure to set the current sk state before tacking actions
|
||||
* depending on sk_state
|
||||
* depending on sk_state, that is processing MPTCP_ERROR_REPORT
|
||||
*/
|
||||
if (__test_and_clear_bit(MPTCP_CONNECTED, &msk->cb_flags))
|
||||
__mptcp_set_connected(sk);
|
||||
if (__test_and_clear_bit(MPTCP_CLEAN_UNA, &msk->cb_flags))
|
||||
__mptcp_clean_una_wakeup(sk);
|
||||
if (__test_and_clear_bit(MPTCP_ERROR_REPORT, &msk->cb_flags))
|
||||
__mptcp_error_report(sk);
|
||||
}
|
||||
|
||||
__mptcp_update_rmem(sk);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue