MPTCP Linux Development
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>,
	David Carlier <devnexen@gmail.com>,
	mptcp@lists.linux.dev
Cc: Mat Martineau <martineau@kernel.org>, Geliang Tang <geliang@kernel.org>
Subject: Re: [PATCH mptcp-next v3 1/3] mptcp: propagate RECVERR sockopts to subflows
Date: Wed, 22 Apr 2026 10:32:33 +0200	[thread overview]
Message-ID: <88df3189-4aa0-41fa-9a58-0d17fb736c87@kernel.org> (raw)
In-Reply-To: <e5dbdb08-f666-47d6-83b6-c157c7e9036c@redhat.com>

Hi Paolo,

Thank you for the review!

On 22/04/2026 10:05, Paolo Abeni wrote:
> On 4/22/26 12:33 AM, David Carlier wrote:
>> Propagate IP_RECVERR/IP_RECVERR_RFC4884 and
>> IPV6_RECVERR/IPV6_RECVERR_RFC4884 from the MPTCP socket to
>> existing and future subflows.
>>
>> Apply the matching sockopt according to the subflow family so mixed-
>> family subflows stay aligned with the parent socket configuration,
>> including disable-time errqueue purge semantics.

(...)

>> +static int mptcp_setsockopt_v6_recverr(struct mptcp_sock *msk, int optname,
>> +				       sockptr_t optval, unsigned int optlen)
>> +{
>> +	struct mptcp_subflow_context *subflow;
>> +	struct sock *sk = (struct sock *)msk;
>> +	int ret;
>> +
>> +	ret = ipv6_setsockopt(sk, SOL_IPV6, optname, optval, optlen);
>> +	if (ret)
>> +		return ret;
>> +
>> +	lock_sock(sk);
>> +	sockopt_seq_inc(msk);
>> +	mptcp_for_each_subflow(msk, subflow) {
>> +		struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
>> +		bool rfc4884 = optname == IPV6_RECVERR_RFC4884;
>> +
>> +		ret = mptcp_subflow_set_recverr(sk, ssk, rfc4884);
> 
> The above looks a bit overcomplicated?!? It looks like you could
> leverage mptcp_setsockopt_all_sf() in  and drop the
> mptcp_subflow_set_recverr() and mptcp_recverr_enabled() helpers.
> 
> @Mattbe: it's not clear to me why mptcp_setsockopt_all_sf() does not
> call sockopt_seq_inc(msk) or sync the setsockopt_seq, possibly an
> unrelated bug?

Oh yes, good catch! And a lock of the sk (msk) before iterating the
subflows, no? Same in __mptcp_setsockopt_set_val()?

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


  reply	other threads:[~2026-04-22  8:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 22:33 [PATCH mptcp-next v3 0/3] mptcp: MSG_ERRQUEUE support on the parent socket David Carlier
2026-04-21 22:33 ` [PATCH mptcp-next v3 1/3] mptcp: propagate RECVERR sockopts to subflows David Carlier
2026-04-22  8:05   ` Paolo Abeni
2026-04-22  8:32     ` Matthieu Baerts [this message]
2026-04-22  8:35       ` Matthieu Baerts
2026-04-22  8:36         ` Matthieu Baerts
2026-04-22  8:48         ` Paolo Abeni
2026-04-22  8:50           ` Matthieu Baerts
2026-04-22 13:53             ` Paolo Abeni
2026-04-22 21:51     ` David CARLIER
2026-04-27 17:07       ` Matthieu Baerts
2026-04-21 22:33 ` [PATCH mptcp-next v3 2/3] mptcp: support MSG_ERRQUEUE on the parent socket David Carlier
2026-04-22  8:28   ` Paolo Abeni
2026-04-22 21:54     ` David CARLIER
2026-04-21 22:33 ` [PATCH mptcp-next v3 3/3] selftests: mptcp: cover IP_RECVERR sockopt propagation David Carlier
2026-04-21 23:38 ` [PATCH mptcp-next v3 0/3] mptcp: MSG_ERRQUEUE support on the parent socket MPTCP CI
2026-04-22  8:22 ` Matthieu Baerts
2026-04-22  8:56   ` David CARLIER
2026-04-27 21:10 ` [PATCH mptcp-next v4 0/4] " David Carlier
2026-04-27 21:10   ` [PATCH mptcp-next v4 1/4] mptcp: sockopt: factor inet_flags propagation into a mask David Carlier
2026-04-27 21:10   ` [PATCH mptcp-next v4 2/4] mptcp: propagate RECVERR sockopts to subflows David Carlier
2026-05-01 15:56     ` Matthieu Baerts
2026-04-27 21:10   ` [PATCH mptcp-next v4 3/4] mptcp: support MSG_ERRQUEUE on the parent socket David Carlier
2026-04-27 21:10   ` [PATCH mptcp-next v4 4/4] selftests: mptcp: cover IP_RECVERR sockopt propagation David Carlier
2026-04-28 18:48   ` [PATCH mptcp-next v4 0/4] mptcp: MSG_ERRQUEUE support on the parent socket Matthieu Baerts
2026-04-28 18:56     ` Matthieu Baerts
2026-04-28 19:15       ` David CARLIER
2026-05-01 14:49       ` Matthieu Baerts
2026-05-01 15:28         ` David CARLIER
2026-05-01 15:56           ` Matthieu Baerts
2026-04-28 19:48   ` 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=88df3189-4aa0-41fa-9a58-0d17fb736c87@kernel.org \
    --to=matttbe@kernel.org \
    --cc=devnexen@gmail.com \
    --cc=geliang@kernel.org \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox