public inbox for mptcp@lists.linux.dev
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Geliang Tang <tanggeliang@kylinos.cn>,
	Gang Yan <yangang@kylinos.cn>,
	mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v2 2/3] mptcp: allow overridden write_space to be invoked
Date: Wed, 4 Feb 2026 12:56:52 +0100	[thread overview]
Message-ID: <85d8137d-77a5-4bda-90e3-29b399431c8d@kernel.org> (raw)
In-Reply-To: <2efc3455052c3a33cad0c8744b171dfc6e7a6d8a.1767504329.git.tanggeliang@kylinos.cn>

Hi Geliang, Paolo,

On 04/01/2026 06:29, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> psock may override its own sk_write_space functions. This patch ensures
> that the overridden sk_write_space can be invoked by MPTCP.
> 
> Note: This patch was initially included in the NVME MPTCP set.
> 
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> Co-developed-by: Gang Yan <yangang@kylinos.cn>
> Signed-off-by: Gang Yan <yangang@kylinos.cn>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  net/mptcp/protocol.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index cd5266099993..f5d4d7d030f2 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -1014,7 +1014,7 @@ static inline void mptcp_write_space(struct sock *sk)
>  	/* pairs with memory barrier in mptcp_poll */
>  	smp_mb();
>  	if (mptcp_stream_memory_free(sk, 1))
> -		sk_stream_write_space(sk);
> +		INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);

As I mentioned on the netdev ML when sending this patch upstream, there
is something fishy here: sk->sk_write_space is never set to
sk_stream_write_space here with the MPTCP sockets, but to
sock_def_write_space. (Subflow sockets use sk_stream_write_space.)

In other words, this patch changes the behaviour, which was not supposed
to be the case, now calling sock_def_write_space() instead of
sk_stream_write_space().

So either sk->sk_write_space should be set to sk_stream_write_space for
the MPTCP sockets (I guess, I don't think sk->sk_write_space() is ever
called with an MPTCP socket for the moment), or sock_def_write_space()
should have been called before (then a fix is needed).

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  parent reply	other threads:[~2026-02-04 11:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-04  5:29 [PATCH mptcp-next v2 0/3] implement psock_update_sk_prot Geliang Tang
2026-01-04  5:29 ` [PATCH mptcp-next v2 1/3] mptcp: " Geliang Tang
2026-01-04  5:29 ` [PATCH mptcp-next v2 2/3] mptcp: allow overridden write_space to be invoked Geliang Tang
2026-02-03  6:54   ` Geliang Tang
2026-02-03  9:42     ` Matthieu Baerts
2026-02-03 10:31       ` Geliang Tang
2026-02-03 10:56         ` Matthieu Baerts
2026-02-03 11:13           ` Matthieu Baerts
2026-02-03 11:14             ` Matthieu Baerts
2026-02-04 11:56   ` Matthieu Baerts [this message]
2026-02-05  9:46     ` Geliang Tang
2026-01-04  5:29 ` [PATCH mptcp-next v2 3/3] selftests/bpf: Update sockmap tests for MPTCP Geliang Tang
2026-01-04  6:38 ` [PATCH mptcp-next v2 0/3] implement psock_update_sk_prot 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=85d8137d-77a5-4bda-90e3-29b399431c8d@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=tanggeliang@kylinos.cn \
    --cc=yangang@kylinos.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox