Skip to content

Commit

Permalink
mptcp: move snd_una update earlier for fallback socket
Browse files Browse the repository at this point in the history
That will avoid an unneeded conditional in both the fast-path
and in the fallback case and will simplify a bit the next
patch.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
Paolo Abeni authored and matttbe committed May 31, 2023
1 parent 6f72fcb commit fac8188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,12 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
mptcp_data_lock(subflow->conn);
if (sk_stream_memory_free(sk))
__mptcp_check_push(subflow->conn, sk);

/* on fallback we just need to ignore the msk-level snd_una, as
* this is really plain TCP
*/
msk->snd_una = READ_ONCE(msk->snd_nxt);

__mptcp_data_acked(subflow->conn);
mptcp_data_unlock(subflow->conn);
return true;
Expand Down
6 changes: 0 additions & 6 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,12 +1004,6 @@ static void __mptcp_clean_una(struct sock *sk)
struct mptcp_data_frag *dtmp, *dfrag;
u64 snd_una;

/* on fallback we just need to ignore snd_una, as this is really
* plain TCP
*/
if (__mptcp_check_fallback(msk))
msk->snd_una = READ_ONCE(msk->snd_nxt);

snd_una = msk->snd_una;
list_for_each_entry_safe(dfrag, dtmp, &msk->rtx_queue, list) {
if (after64(dfrag->data_seq + dfrag->data_len, snd_una))
Expand Down

0 comments on commit fac8188

Please sign in to comment.