From: Geliang Tang <tanggeliang@kylinos.cn>
This series adds MSG_ZEROCOPY support for MPTCP sockets, allowing
userspace to transmit data without intermediate kernel copies, and
provides corresponding selftests to exercise the new path.
The first patch is a small cleanup that introduces a local 'tp'
variable in mptcp_sendmsg_frag() to avoid repeated tcp_sk()
dereferencing, preparing for the subsequent zero-copy changes.
The second patch implements the core MSG_ZEROCOPY support. The design
follows TCP's reference-counting model, with a single ubuf_info per
sendmsg tracked by three reference buckets: one held by sendmsg itself,
one per MPTCP dfrag in the retransmission queue, and one per subflow
skb. Completion is reported only after all bytes are acknowledged at
both MPTCP and subflow levels. The feature is silently downgraded to
regular copy in cases where zero-copy cannot be safely performed
(MSG_FASTOPEN, fallback mode, or memory pressure).
The third and fourth patches add a new 'zerocopy' I/O mode to the
mptcp_connect selftest, and a wrapper script to run it as part of the
regular test suite, ensuring the zero-copy path is exercised in CI.
Geliang Tang (4):
mptcp: use local variable tp in sendmsg_frag
mptcp: add msg zerocopy support
selftests: mptcp: connect: add zerocopy io mode
selftests: mptcp: connect: cover zerocopy mode
net/mptcp/protocol.c | 104 ++++++++++++++++--
net/mptcp/protocol.h | 1 +
tools/testing/selftests/net/mptcp/Makefile | 1 +
.../selftests/net/mptcp/mptcp_connect.c | 63 ++++++++++-
.../net/mptcp/mptcp_connect_zerocopy.sh | 5 +
5 files changed, 163 insertions(+), 11 deletions(-)
create mode 100755 tools/testing/selftests/net/mptcp/mptcp_connect_zerocopy.sh
--
2.53.0