problems with MP_FAIL timer
Hello,
re-reviewing again the commit:
mptcp: reset subflow when MP_FAIL doesn't respond
There are a few issue with sk_timer handling, specifically:
- no additional mptcp_data_lock is needed to stop/reset it
- I think overlapping infinite mapping reception and close may lead to some inconsistent timer usage
More importantly I could not find the RFC reference for such timer?!? @Geliang, @Mat could you please point that out?!?
Thanks,
Paolo
Hi Paolo,
Quoted 7 lines · Paolo Abeni <[email protected]> 于2022年5月11日周三 19:28写道:
Hello,
re-reviewing again the commit:
mptcp: reset subflow when
MP_FAILdoesn't respond
Quoted 7 lines
There are a few issue with
sk_timerhandling, specifically:
- no additionalmptcp_data_lockis needed to stop/reset it
- I think overlapping infinite mapping reception and close may lead to some inconsistent timer usageMore importantly I could not find the RFC reference for such timer?!? @Geliang, @Mat could you please point that out?!?
The timer isn't mentioned in the RFC 8684. It only mentions MP_FAIL should be sent back here:
'''
3.7. Fallback
In this case, if a receiver identifies a checksum failure when there is only one path, it will send back an MP_FAIL option on the subflow-level ACK, referring to the data-level sequence number of the start of the segment on which the checksum error was detected. '''
Thanks,
-Geliang
Quoted 6 lines
Thanks,
Paolo
Quoted 11 lines · Paolo Abeni
Hello,
re-reviewing again the commit:
mptcp: reset subflow when
MP_FAILdoesn't respondThere are a few issue with
sk_timerhandling, specifically:
- no additionalmptcp_data_lockis needed to stop/reset it
- I think overlapping infinite mapping reception and close may lead to some inconsistent timer usage
I'm working on a patch for this.
The issues you describe are what I was trying to comment on in
https://lore.kernel.org/mptcp/[email protected]/, but my proposed solution (deferred events for coordinating with msk->sk_state) isn't the way to fix it.
I think checking the subflows for SOCK_DEAD before changing the timer should prevent bad interaction with msk close, since the subflows are always orphaned before the msk resets sk_timer.
Quoted 3 lines
More importantly I could not find the RFC reference for such timer?!? @Geliang, @Mat could you please point that out?!?
The RFC doesn't specify what to do if the peer ignores the MP_FAIL. Resending seemed to be hard to resolve correctly (what if it turned out to be a duplicate?), so the choice was to revert to the reset behavior after a timeout.
--
Mat Martineau
Intel
Quoted 14 lines · Mat Martineau
Quoted 11 lines · Paolo Abeni
Hello,
re-reviewing again the commit:
mptcp: reset subflow when
MP_FAILdoesn't respondThere are a few issue with
sk_timerhandling, specifically:
- no additionalmptcp_data_lockis needed to stop/reset it
- I think overlapping infinite mapping reception and close may lead to some inconsistent timer usage
Quoted 6 lines
I'm working on a patch for this.
The issues you describe are what I was trying to comment on in
https://lore.kernel.org/mptcp/[email protected]/,
but my proposed solution (deferred events for coordinating withmsk->sk_state) isn't the way to fix it.
I think there is anoter issue: in mptcp_timeout_timer(), via mptcp_check_mp_fail_response() -> mp_fail_response_expect_subflow() -> mp_fail_response_expect_subflow(), the code traverse the conn_list under the msk socket spin_lock. That is not enough: it should instead acquire the full msk socket lock.
We can use the is_not_owned || defer to release_cb schema, but I think we are simply better off reverting such patch. Any strong opinion against that?
Paolo
Quoted 1 line
Quoted 22 lines · Paolo Abeni
Quoted 14 lines · Mat Martineau
Quoted 11 lines · Paolo Abeni
Hello,
re-reviewing again the commit:
mptcp: reset subflow when
MP_FAILdoesn't respondThere are a few issue with
sk_timerhandling, specifically:
- no additionalmptcp_data_lockis needed to stop/reset it
- I think overlapping infinite mapping reception and close may lead to some inconsistent timer usageQuoted 6 lines
I'm working on a patch for this.
The issues you describe are what I was trying to comment on in
https://lore.kernel.org/mptcp/[email protected]/,
but my proposed solution (deferred events for coordinating withmsk->sk_state) isn't the way to fix it.
Quoted 5 lines
I think there is anoter issue: in
mptcp_timeout_timer(), viamptcp_check_mp_fail_response()->mp_fail_response_expect_subflow()->mp_fail_response_expect_subflow(), the code traverse theconn_listunder the msk socketspin_lock. That is not enough: it should instead acquire the full msk socket lock.
Agreed.
Quoted 3 lines
We can use the
is_not_owned|| defer torelease_cbschema, but I think we are simply better off reverting such patch. Any strong opinion against that?
I don't think we can just revert: it's important to either fall back or reset, and not leave the connection in some indefinite state after sending a MP_FAIL that's ignored (the RFC is specific that the peer must respond with MP_FAIL). So we need to use some timer to implement that behavior, or use other events (rx/tx/etc) to check for a timely MP_FAIL reply and reset if it hasn't arrived. The timer approach seems simpler.
--
Mat Martineau
Intel