mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: David Carlier <devnexen@gmail.com>
To: mptcp@lists.linux.dev
Cc: matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org,
	pabeni@redhat.com, David Carlier <devnexen@gmail.com>
Subject: [PATCH mptcp-next v12 0/4] mptcp: MSG_ERRQUEUE support on the parent socket
Date: Thu, 30 Jul 2026 08:12:40 +0100	[thread overview]
Message-ID: <20260730071244.69473-1-devnexen@gmail.com> (raw)

This series lets MPTCP applications use poll(EPOLLERR) and
recvmsg(MSG_ERRQUEUE) on the parent socket to drain TX timestamps
through the standard inet ABI, the same way they would on a plain TCP
socket. ICMP-derived errors stay on the subflow queue: the legacy
RECVERR ABI cannot convey their per-subflow peer identity, and they
are intended for a future MPTCP_RECERR channel.

Patch 1 splices subflow err-skbs onto the parent's sk_error_queue at
error-report time. All forwarded events go through sock_queue_err_skb(),
which re-homes skb->sk onto the parent and charges sk_rmem_alloc, so the
parent's error queue stays bounded by sk_rcvbuf and is dropped under rmem
pressure, matching tcp's tx-timestamp path and ip_icmp_error() /
ipv6_icmp_error(). mptcp_recvmsg(MSG_ERRQUEUE) forwards directly to
inet_recv_error(), and mptcp_poll() advertises EPOLLERR purely on the
parent's sk_err / sk_error_queue, matching tcp_poll().

Patch 2 factors the existing inet_flags subflow-propagation hard-coded
list into a mask, so the next patch can extend it without churn.

Patch 3 makes IP_RECVERR / IPV6_RECVERR (and the RFC4884 variants)
propagate to the subflows. The parent stores the bit so MPTCP-aware
helpers can branch on it.

Patch 4 is a selftest covering the propagation path.

Changes in v12 (addresses Paolo's v11 review):
 - reordered the series so the core MSG_ERRQUEUE infrastructure lands
   first, before the sockopt plumbing that exposes it to user space.
   The former patch 3/4 is now 1/4.
 - 1/4: narrow mptcp_errqueue_skb_forwardable() to
   SO_EE_ORIGIN_TIMESTAMPING. SO_EE_ORIGIN_ZEROCOPY and
   SO_EE_ORIGIN_LOCAL events cannot be generated on an MPTCP parent
   today, so the helper only needs extending if and when they can be.
 - 1/4: trim the block comment above sock_queue_err_skb() and the
   matching changelog paragraphs, now redundant with the narrower
   filter.
 - 2/4: reverse christmas tree declaration ordering in
   sync_socket_options().
 - dropped the Suggested-by: Paolo Abeni tags from patches 1-3.
 - rebased on current export.

v11: https://lore.kernel.org/mptcp/20260531145955.322337-1-devnexen@gmail.com/
v10: https://lore.kernel.org/mptcp/20260529174524.260199-1-devnexen@gmail.com/

David Carlier (4):
  mptcp: support MSG_ERRQUEUE on the parent socket
  mptcp: sockopt: factor inet_flags propagation into a mask
  mptcp: propagate RECVERR sockopts to subflows
  selftests: mptcp: cover IP_RECVERR sockopt propagation

 net/mptcp/protocol.c                          |  54 +++++--
 net/mptcp/sockopt.c                           | 153 +++++++++++++++---
 .../selftests/net/mptcp/mptcp_sockopt.c       |  55 +++++++
 3 files changed, 228 insertions(+), 34 deletions(-)


base-commit: 6201be839b36e8dd22a23b9b367388ed900a257f
-- 
2.53.0


             reply	other threads:[~2026-07-30  7:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  7:12 David Carlier [this message]
2026-07-30  7:12 ` [PATCH mptcp-next v12 1/4] mptcp: support MSG_ERRQUEUE on the parent socket David Carlier
2026-07-30  7:12 ` [PATCH mptcp-next v12 2/4] mptcp: sockopt: factor inet_flags propagation into a mask David Carlier
2026-07-30  7:12 ` [PATCH mptcp-next v12 3/4] mptcp: propagate RECVERR sockopts to subflows David Carlier
2026-07-30  7:12 ` [PATCH mptcp-next v12 4/4] selftests: mptcp: cover IP_RECVERR sockopt propagation David Carlier
2026-07-30  8:23 ` [PATCH mptcp-next v12 0/4] mptcp: MSG_ERRQUEUE support on the parent socket MPTCP CI
2026-07-31 14:56 ` Matthieu Baerts

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=20260730071244.69473-1-devnexen@gmail.com \
    --to=devnexen@gmail.com \
    --cc=geliang@kernel.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@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;
as well as URLs for NNTP newsgroup(s).