[PATCH mptcp-next v5 00/16] MPTCP sockmap support

Geliang Tang posted 16 patches 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1789294365.git.tanggeliang@kylinos.cn
include/linux/bpf.h                           |  13 ++
include/net/mptcp.h                           |  12 ++
include/net/tcp.h                             |   7 +
include/uapi/linux/bpf.h                      |  19 ++
kernel/bpf/verifier.c                         |   8 +-
net/core/filter.c                             |  60 +++++-
net/core/sock_map.c                           |  14 +-
net/ipv4/tcp.c                                |   9 +-
net/ipv4/tcp_bpf.c                            |  40 ++--
net/mptcp/bpf.c                               | 172 ++++++++++++++++++
net/mptcp/protocol.c                          | 114 ++++++++++--
net/mptcp/protocol.h                          |  20 ++
net/mptcp/sockopt.c                           |  21 ++-
.../testing/selftests/bpf/prog_tests/mptcp.c  |  27 +--
.../selftests/bpf/prog_tests/socket_helpers.h |  25 ++-
.../selftests/bpf/prog_tests/sockmap_basic.c  |  33 +++-
.../selftests/bpf/prog_tests/sockmap_listen.c | 122 ++++++++-----
.../selftests/bpf/progs/mptcp_sockmap.c       |   8 +-
.../selftests/bpf/progs/test_sockmap_listen.c |  25 +++
.../selftests/net/mptcp/mptcp_sockopt.c       |   1 +
20 files changed, 622 insertions(+), 128 deletions(-)
[PATCH mptcp-next v5 00/16] MPTCP sockmap support
Posted by Geliang Tang 1 week, 6 days ago
From: Geliang Tang <tanggeliang@kylinos.cn>

v5:
 - Patches 1-4 are from "Reduce the differences between TCP and MPTCP for
   TLS usage" set.
 - More patches for sockmap support.
 - Rename this set from "implement psock_update_sk_prot" to "MPTCP sockmap
   support"

v4:
 - Address Mat's comments: implement .read_skb to make the selftests run.
 - Move mptcp_bpf_update_proto() from protocol.c to bpf.c.
 - Include the "implement .splice_eof" patches in this series, as they
   both modify mptcp_prot, mptcp_stream_ops and mptcp_v6_stream_ops.
 - https://patchwork.kernel.org/project/mptcp/cover/cover.1787554581.git.tanggeliang@kylinos.cn/

v3:
 - Address the comments by ai review.
   - use WRITE_ONCE to set sk->sk_write_space.
   - update the selftest, set a new key for client socket.
 - Fix line length warnings.
 - https://patchwork.kernel.org/project/mptcp/cover/cover.1773826662.git.tanggeliang@kylinos.cn/

RESEND:
 - rebased.
 - to trigger ai review.

v2:
 - Include mptcp_bpf_update_proto within CONFIG_BPF_SYSCALL to fix the
compilation errors reported by the kernel test robot.
 - Add checks for IS_ENABLED(CONFIG_MPTCP_IPV6).

Implement psock_update_sk_prot, for basic MPTCP BPF SOCKMAP support.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/521

Geliang Tang (15):
  mptcp: add sendmsg_locked to proto_ops
  mptcp: track app-limited state in mptcp_sendmsg
  selftests: mptcp: sockopt: check app_limited
  bpf: drop duplicate check_app_limited in tcp_bpf_push
  mptcp: implement psock_update_sk_prot for sockmap
  mptcp: add sock_map_update BPF helper
  selftests/bpf: enable MPTCP support in sockmap tests
  mptcp: implement read_skb for sockmap stream verdict
  bpf: export and generalize tcp_bpf_ioctl
  mptcp: add TCP_REPAIR sockopt support
  selftests/bpf: add MPTCP coverage to sockmap_basic
  mptcp: add sk_is_msk() helper and use it in sockmap
  mptcp: add SO_ATTACH_REUSEPORT_EBPF support
  mptcp: add sk_select_reuseport BPF helper
  selftests/bpf: add MPTCP coverage to sockmap_listen

Paolo Abeni (1):
  mptcp: defer read_sock cleanup to mptcp_worker

 include/linux/bpf.h                           |  13 ++
 include/net/mptcp.h                           |  12 ++
 include/net/tcp.h                             |   7 +
 include/uapi/linux/bpf.h                      |  19 ++
 kernel/bpf/verifier.c                         |   8 +-
 net/core/filter.c                             |  60 +++++-
 net/core/sock_map.c                           |  14 +-
 net/ipv4/tcp.c                                |   9 +-
 net/ipv4/tcp_bpf.c                            |  40 ++--
 net/mptcp/bpf.c                               | 172 ++++++++++++++++++
 net/mptcp/protocol.c                          | 114 ++++++++++--
 net/mptcp/protocol.h                          |  20 ++
 net/mptcp/sockopt.c                           |  21 ++-
 .../testing/selftests/bpf/prog_tests/mptcp.c  |  27 +--
 .../selftests/bpf/prog_tests/socket_helpers.h |  25 ++-
 .../selftests/bpf/prog_tests/sockmap_basic.c  |  33 +++-
 .../selftests/bpf/prog_tests/sockmap_listen.c | 122 ++++++++-----
 .../selftests/bpf/progs/mptcp_sockmap.c       |   8 +-
 .../selftests/bpf/progs/test_sockmap_listen.c |  25 +++
 .../selftests/net/mptcp/mptcp_sockopt.c       |   1 +
 20 files changed, 622 insertions(+), 128 deletions(-)

-- 
2.53.0
Re: [PATCH mptcp-next v5 00/16] MPTCP sockmap support
Posted by Geliang Tang 1 week, 5 days ago
Hi Matt,

On Sun, 2026-09-13 at 18:14 +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v5:
>  - Patches 1-4 are from "Reduce the differences between TCP and MPTCP
> for TLS usage" set.

I put the four patches from the "Reduce the differences between TCP and
MPTCP for TLS usage" series here because this "MPTCP sockmap support"
series depends on them. Actually, it doesn't just depend on these four
patches - it also appears to depend on "mptcp: remove CB offset field"
(see sashiko's comments on patch 9) and "mptcp: implement peek_len for
proto_ops" (see sashiko's comments on patch 13).

So this series depends on the entire "Reduce the differences between
TCP and MPTCP for TLS usage" series. I could use "Based-on: <...>" to
trigger CI based on the dependency, but Sashiko doesn't recognize
"Based-on", so it won't be able to apply successfully.

Is there some Sashiko feature that can handle this kind of chained
dependency between patchsets? Or do I need to include all ten patches
of the "Reduce the differences between TCP and MPTCP for TLS usage"
series in the next version? I'd appreciate your thoughts on this.

Alternatively, let's first do the review of the "Reduce the differences
between TCP and MPTCP for TLS usage" series - it's already ready for
review - so that both the subsequent "MPTCP KTLS support" series and
this "MPTCP sockmap support" series can move forward more easily.

Thanks,
-Geliang

>  - More patches for sockmap support.
>  - Rename this set from "implement psock_update_sk_prot" to "MPTCP
> sockmap
>    support"
> 
> v4:
>  - Address Mat's comments: implement .read_skb to make the selftests
> run.
>  - Move mptcp_bpf_update_proto() from protocol.c to bpf.c.
>  - Include the "implement .splice_eof" patches in this series, as
> they
>    both modify mptcp_prot, mptcp_stream_ops and mptcp_v6_stream_ops.
>  -
> https://patchwork.kernel.org/project/mptcp/cover/cover.1787554581.git.tanggeliang@kylinos.cn/
> 
> v3:
>  - Address the comments by ai review.
>    - use WRITE_ONCE to set sk->sk_write_space.
>    - update the selftest, set a new key for client socket.
>  - Fix line length warnings.
>  -
> https://patchwork.kernel.org/project/mptcp/cover/cover.1773826662.git.tanggeliang@kylinos.cn/
> 
> RESEND:
>  - rebased.
>  - to trigger ai review.
> 
> v2:
>  - Include mptcp_bpf_update_proto within CONFIG_BPF_SYSCALL to fix
> the
> compilation errors reported by the kernel test robot.
>  - Add checks for IS_ENABLED(CONFIG_MPTCP_IPV6).
> 
> Implement psock_update_sk_prot, for basic MPTCP BPF SOCKMAP support.
> 
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/521
> 
> Geliang Tang (15):
>   mptcp: add sendmsg_locked to proto_ops
>   mptcp: track app-limited state in mptcp_sendmsg
>   selftests: mptcp: sockopt: check app_limited
>   bpf: drop duplicate check_app_limited in tcp_bpf_push
>   mptcp: implement psock_update_sk_prot for sockmap
>   mptcp: add sock_map_update BPF helper
>   selftests/bpf: enable MPTCP support in sockmap tests
>   mptcp: implement read_skb for sockmap stream verdict
>   bpf: export and generalize tcp_bpf_ioctl
>   mptcp: add TCP_REPAIR sockopt support
>   selftests/bpf: add MPTCP coverage to sockmap_basic
>   mptcp: add sk_is_msk() helper and use it in sockmap
>   mptcp: add SO_ATTACH_REUSEPORT_EBPF support
>   mptcp: add sk_select_reuseport BPF helper
>   selftests/bpf: add MPTCP coverage to sockmap_listen
> 
> Paolo Abeni (1):
>   mptcp: defer read_sock cleanup to mptcp_worker
> 
>  include/linux/bpf.h                           |  13 ++
>  include/net/mptcp.h                           |  12 ++
>  include/net/tcp.h                             |   7 +
>  include/uapi/linux/bpf.h                      |  19 ++
>  kernel/bpf/verifier.c                         |   8 +-
>  net/core/filter.c                             |  60 +++++-
>  net/core/sock_map.c                           |  14 +-
>  net/ipv4/tcp.c                                |   9 +-
>  net/ipv4/tcp_bpf.c                            |  40 ++--
>  net/mptcp/bpf.c                               | 172
> ++++++++++++++++++
>  net/mptcp/protocol.c                          | 114 ++++++++++--
>  net/mptcp/protocol.h                          |  20 ++
>  net/mptcp/sockopt.c                           |  21 ++-
>  .../testing/selftests/bpf/prog_tests/mptcp.c  |  27 +--
>  .../selftests/bpf/prog_tests/socket_helpers.h |  25 ++-
>  .../selftests/bpf/prog_tests/sockmap_basic.c  |  33 +++-
>  .../selftests/bpf/prog_tests/sockmap_listen.c | 122 ++++++++-----
>  .../selftests/bpf/progs/mptcp_sockmap.c       |   8 +-
>  .../selftests/bpf/progs/test_sockmap_listen.c |  25 +++
>  .../selftests/net/mptcp/mptcp_sockopt.c       |   1 +
>  20 files changed, 622 insertions(+), 128 deletions(-)
Re: [PATCH mptcp-next v5 00/16] MPTCP sockmap support
Posted by Matthieu Baerts 1 week, 5 days ago

On 14/09/2026 11:48, Geliang Tang wrote:
> Hi Matt,
> 
> On Sun, 2026-09-13 at 18:14 +0800, Geliang Tang wrote:
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> v5:
>>  - Patches 1-4 are from "Reduce the differences between TCP and MPTCP
>> for TLS usage" set.
> 
> I put the four patches from the "Reduce the differences between TCP and
> MPTCP for TLS usage" series here because this "MPTCP sockmap support"
> series depends on them. Actually, it doesn't just depend on these four
> patches - it also appears to depend on "mptcp: remove CB offset field"
> (see sashiko's comments on patch 9) and "mptcp: implement peek_len for
> proto_ops" (see sashiko's comments on patch 13).
> 
> So this series depends on the entire "Reduce the differences between
> TCP and MPTCP for TLS usage" series. I could use "Based-on: <...>" to
> trigger CI based on the dependency, but Sashiko doesn't recognize
> "Based-on", so it won't be able to apply successfully.
> 
> Is there some Sashiko feature that can handle this kind of chained
> dependency between patchsets?

Not yet, apparently:

  https://github.com/sashiko-dev/sashiko/issues/49

> Or do I need to include all ten patches
> of the "Reduce the differences between TCP and MPTCP for TLS usage"
> series in the next version? I'd appreciate your thoughts on this.
> 
> Alternatively, let's first do the review of the "Reduce the differences
> between TCP and MPTCP for TLS usage" series - it's already ready for
> review - so that both the subsequent "MPTCP KTLS support" series and
> this "MPTCP sockmap support" series can move forward more easily.
Probably best to do that. I admit that with all the different series and
revisions, I'm sorry, but I'm a bit lost regarding the priorities. What
should be reviewed first?

These series?

 - Reduce the differences between TCP and MPTCP for TLS usage
 - mptcp: remove CB offset field
 - mptcp: implement peek_len for proto_ops

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

Re: [PATCH mptcp-next v5 00/16] MPTCP sockmap support
Posted by Geliang Tang 1 week, 5 days ago
On Mon, 2026-09-14 at 12:58 +0200, Matthieu Baerts wrote:
> 
> 
> On 14/09/2026 11:48, Geliang Tang wrote:
> > Hi Matt,
> > 
> > On Sun, 2026-09-13 at 18:14 +0800, Geliang Tang wrote:
> > > From: Geliang Tang <tanggeliang@kylinos.cn>
> > > 
> > > v5:
> > >  - Patches 1-4 are from "Reduce the differences between TCP and
> > > MPTCP
> > > for TLS usage" set.
> > 
> > I put the four patches from the "Reduce the differences between TCP
> > and
> > MPTCP for TLS usage" series here because this "MPTCP sockmap
> > support"
> > series depends on them. Actually, it doesn't just depend on these
> > four
> > patches - it also appears to depend on "mptcp: remove CB offset
> > field"
> > (see sashiko's comments on patch 9) and "mptcp: implement peek_len
> > for
> > proto_ops" (see sashiko's comments on patch 13).
> > 
> > So this series depends on the entire "Reduce the differences
> > between
> > TCP and MPTCP for TLS usage" series. I could use "Based-on: <...>"
> > to
> > trigger CI based on the dependency, but Sashiko doesn't recognize
> > "Based-on", so it won't be able to apply successfully.
> > 
> > Is there some Sashiko feature that can handle this kind of chained
> > dependency between patchsets?
> 
> Not yet, apparently:
> 
>   https://github.com/sashiko-dev/sashiko/issues/49
> 
> > Or do I need to include all ten patches
> > of the "Reduce the differences between TCP and MPTCP for TLS usage"
> > series in the next version? I'd appreciate your thoughts on this.
> > 
> > Alternatively, let's first do the review of the "Reduce the
> > differences
> > between TCP and MPTCP for TLS usage" series - it's already ready
> > for
> > review - so that both the subsequent "MPTCP KTLS support" series
> > and
> > this "MPTCP sockmap support" series can move forward more easily.
> Probably best to do that. I admit that with all the different series
> and
> revisions, I'm sorry, but I'm a bit lost regarding the priorities.
> What
> should be reviewed first?
> 
> These series?
> 
>  - Reduce the differences between TCP and MPTCP for TLS usage
>  - mptcp: remove CB offset field
>  - mptcp: implement peek_len for proto_ops

Sorry for not being clear. The "Reduce the differences between TCP and
MPTCP for TLS usage" v13 [1] series needs to be reviewed - it includes
patch 3 "mptcp: remove CB offset field" and patch 7 "mptcp: implement
peek_len for proto_ops".

Thanks,
-Geliang

[1]
https://patchwork.kernel.org/project/mptcp/cover/cover.1788245079.git.tanggeliang@kylinos.cn/

> 
> Cheers,
> Matt
Re: [PATCH mptcp-next v5 00/16] MPTCP sockmap support
Posted by MPTCP CI 1 week, 6 days ago
Hi Geliang,

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): Unstable: 3 failed test(s): packetdrill_mp_join packetdrill_sockopts selftest_simult_flows ⚠️ 
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Perf: Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/34752281734

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/30f4301b3392
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1163753


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 00/16] MPTCP sockmap support
Posted by MPTCP CI 1 week, 6 days ago
Hi Geliang,

Thank you for your modifications, that's great!

But sadly, our CI spotted some issues with it when trying to build it.

You can find more details there:

  https://github.com/multipath-tcp/mptcp_net-next/actions/runs/34752281733

Status: failure
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/30f4301b3392
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1163753

Feel free to reply to this email if you cannot access logs, if you need
some support to fix the error, if this doesn't seem to be caused by your
modifications or if the error is a false positive one.

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)