All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: mptcp@lists.linux.dev
Cc: Shardul Bankar <shardul.b@mpiricsoftware.com>
Subject: Re: [PATCH mptcp-next 02/12] mptcp: explicitly drop over memory limits
Date: Sun, 10 May 2026 22:09:05 +0200	[thread overview]
Message-ID: <95fd8dce-e72e-4e11-8246-75482d9f375c@redhat.com> (raw)
In-Reply-To: <ce7beeb758f004cc86fe194db4c91ea4b487d042.1778312843.git.pabeni@redhat.com>

On 5/9/26 9:48 AM, Paolo Abeni wrote:
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 4cc583fdc7a9..19c0bc92f04e 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -1158,8 +1158,29 @@ static bool add_addr_hmac_valid(struct mptcp_sock *msk,
>  	return hmac == mp_opt->ahmac;
>  }
>  
> -/* Return false in case of error (or subflow has been reset),
> - * else return true.
> +static bool mptcp_over_limit(struct sock *sk, struct sock *ssk,
> +			     const struct sk_buff *skb)
> +{
> +	struct mptcp_sock *msk = mptcp_sk(sk);
> +
> +	if (likely(sk_rmem_alloc_get(sk) + READ_ONCE(msk->backlog_len) <=
> +		   READ_ONCE(sk->sk_rcvbuf)))
> +		return false;
> +
> +	/* Avoid silently dropping pure acks, fin or zero win probes. */
> +	if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq ||
> +	    TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN ||
> +	    !after(TCP_SKB_CB(skb)->end_seq, tcp_sk(ssk)->rcv_nxt))
> +		return false;
> +
> +	/* Dropped due to memory constraints, schedule an ack. */
> +	inet_csk(ssk)->icsk_ack.pending |= ICSK_ACK_NOMEM | ICSK_ACK_NOW;
> +	inet_csk_schedule_ack(ssk);

Sashiko says:

---
Does returning true here cause a permanent data transfer stall?
When mptcp_over_limit() decides to drop a packet, it schedules an ACK and
returns true, which in turn makes mptcp_incoming_options() return false.
When this occurs in the TCP fast path or early in tcp_v4_rcv(), returning
false instructs the TCP stack to jump immediately to the discard label. This
bypasses the standard tcp_ack_snd_check() calls located at the end of the
receive path.
Since inet_csk_schedule_ack() only sets the ICSK_ACK_SCHED pending flag and
does not arm the delayed ACK timer, the scheduled ACK is never dispatched.
The sender will eventually timeout, retransmit the identical packet, hit
this exact same memory limit, and be dropped again without an ACK.
---
That is a bit of an allucination: mptcp subflow can't hit fastpath, and
the other referenced mptcp_incoming_options() calls happens only for
states that prevent the other end from sending more data: the mentioned
stall is not possible

/P


  reply	other threads:[~2026-05-10 20:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09  7:48 [PATCH mptcp-next 00/12] mptcp: address stall under memory pressure Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 01/12] mptcp: do not drop partial packets Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 02/12] mptcp: explicitly drop over memory limits Paolo Abeni
2026-05-10 20:09   ` Paolo Abeni [this message]
2026-05-09  7:48 ` [PATCH mptcp-next 03/12] mptcp: enforce hard limit on backlog flushing Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 04/12] mptcp: drop the mptcp_ooo_try_coalesce() helper Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 05/12] mptcp: drop the cant_coalesce CB field Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 06/12] mptcp: remove CB offset field Paolo Abeni
2026-05-10 20:38   ` Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 07/12] mptcp: sync mptcp skb cb layout with tcp one Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 08/12] tcp: expose the tcp_collapse_ofo_queue() helper to mptcp usage, too Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 09/12] mptcp: implemented OoO queue pruning Paolo Abeni
2026-05-10 20:48   ` Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 10/12] mptcp: track prune recovery status Paolo Abeni
2026-05-10 20:51   ` Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 11/12] mptcp: move the retrans loop to a separate helper Paolo Abeni
2026-05-09  7:48 ` [PATCH mptcp-next 12/12] mptcp: let the retrans scheduler do its job Paolo Abeni
2026-05-09  8:24 ` [PATCH mptcp-next 00/12] mptcp: address stall under memory pressure MPTCP CI
2026-05-09  8:59 ` MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95fd8dce-e72e-4e11-8246-75482d9f375c@redhat.com \
    --to=pabeni@redhat.com \
    --cc=mptcp@lists.linux.dev \
    --cc=shardul.b@mpiricsoftware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.