[PATCH mptcp-next v5 0/4] mptcp: MSG_ERRQUEUE support on the parent socket

David Carlier posted 4 patches 1 week, 5 days ago
Failed in applying to current master (apply log)
There is a newer version of this series
net/mptcp/protocol.c                          |  66 ++++++++++-
net/mptcp/sockopt.c                           | 108 ++++++++++++++----
.../selftests/net/mptcp/mptcp_sockopt.c       |  55 +++++++++
3 files changed, 203 insertions(+), 26 deletions(-)
[PATCH mptcp-next v5 0/4] mptcp: MSG_ERRQUEUE support on the parent socket
Posted by David Carlier 1 week, 5 days ago
MPTCP already advertises IP_RECVERR/IPV6_RECVERR as supported, but the
parent socket does not currently provide usable MSG_ERRQUEUE handling.

This series wires the MPTCP socket up to the IPv4/IPv6 error queue
paths. It propagates RECVERR-related sockopts to existing and future
subflows, and lets recvmsg(MSG_ERRQUEUE) on the parent socket consume
queued TX-timestamp and MSG_ZEROCOPY completion notifications.

A prerequisite patch factors the per-flag inet_flags propagation in
sync_socket_options() into a mask-driven loop, so further inet_flags
propagated by MPTCP can be added by extending the mask rather than
touching the call site.

Patch 2 leverages mptcp_setsockopt_all_sf() for the setsockopt path
and extends MPTCP_INET_FLAGS_MASK with the four RECVERR bits, with a
single mptcp_setsockopt_recverr() helper covering both families.

Patch 3 splices subflow err skbs onto the parent at error-report
time, filtering by SO_EE_ORIGIN so user-data cmsgs (TIMESTAMPING,
ZEROCOPY, LOCAL) reach the parent socket while subflow-level ICMP
errors are dropped to avoid leaking subflow identity through the
single-path RECVERR ABI. A future MPTCP_RECERR channel is the right
home for those events along with the per-fd subflow lifecycle events
tracked by [1].

Changes in v5:
 - 1/4: replace the WRITE_ONCE() RMW with a per-bit assign_bit() loop
   so the per-bit atomicity of the original inet_assign_bit() calls
   is preserved (Sashiko).
 - 2/4: collapse the family-specific helpers into one
   mptcp_setsockopt_recverr() that snapshots optval into a local int,
   bumps msk->setsockopt_seq, and forwards via
   mptcp_setsockopt_all_sf() (Matthieu, Sashiko); skip
   family-mismatched subflows in mptcp_setsockopt_all_sf() (Sashiko).
 - 3/4: filter the splice by SO_EE_ORIGIN to forward
   TIMESTAMPING / ZEROCOPY / LOCAL only and drop ICMP / ICMPv6
   (Matthieu, Paolo); add mptcp_recv_error() to retry the splice on
   the pull side so a parent-side rmem-ENOMEM does not strand subflow
   skbs (Sashiko).
 - 4/4: unchanged.

[1] https://github.com/multipath-tcp/mptcp_net-next/issues/78

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

 net/mptcp/protocol.c                          |  66 ++++++++++-
 net/mptcp/sockopt.c                           | 108 ++++++++++++++----
 .../selftests/net/mptcp/mptcp_sockopt.c       |  55 +++++++++
 3 files changed, 203 insertions(+), 26 deletions(-)

-- 
2.53.0
Re: [PATCH mptcp-next v5 0/4] mptcp: MSG_ERRQUEUE support on the parent socket
Posted by MPTCP CI 1 week, 3 days ago
Hi David,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Unstable: 1 failed test(s): packetdrill_dss ⚠️ 
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/25313259921

Initiator: Matthieu Baerts (NGI0)
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/3e3c0e270017
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1088853


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
Re: [PATCH mptcp-next v5 0/4] mptcp: MSG_ERRQUEUE support on the parent socket
Posted by Matthieu Baerts 1 week, 3 days ago
Hi David,

On 02/05/2026 23:19, David Carlier wrote:

(...)

> Changes in v5:

Thank you for the v5. Please note that the CI was not able to apply it
[1], because your patch was based on an old version of the export (or
export-net, for-review, for-review-net) branches. I manually solved the
conflicts and sent it to our repo, for our CI to test it.

[1]
https://patchew.org/MPTCP/cover.1777756707.git.devnexen@gmail.com/logs/git/

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next v5 0/4] mptcp: MSG_ERRQUEUE support on the parent socket
Posted by David CARLIER 1 week, 3 days ago
Hi and thanks ok doing it locally too indeed so many conflicts :)
Regards.

On Mon, 4 May 2026 at 11:13, Matthieu Baerts <matttbe@kernel.org> wrote:
>
> Hi David,
>
> On 02/05/2026 23:19, David Carlier wrote:
>
> (...)
>
> > Changes in v5:
>
> Thank you for the v5. Please note that the CI was not able to apply it
> [1], because your patch was based on an old version of the export (or
> export-net, for-review, for-review-net) branches. I manually solved the
> conflicts and sent it to our repo, for our CI to test it.
>
> [1]
> https://patchew.org/MPTCP/cover.1777756707.git.devnexen@gmail.com/logs/git/
>
> Cheers,
> Matt
> --
> Sponsored by the NGI0 Core fund.
>