]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mptcp: implement .read_sock
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 30 Jan 2026 19:24:25 +0000 (20:24 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Feb 2026 02:15:31 +0000 (18:15 -0800)
commit250d9766a984a45f05893a496df6b682c105fbbc
tree0360eb6f1983522fdc03fcea0ed0765a158fd1c5
parent436510df0cafb1bc36f12e92e0e76599be28d8f4
mptcp: implement .read_sock

Current in-kernel TCP sockets -- i.e. from nvme_tcp_try_recv() -- need
to call .read_sock interface of struct proto_ops, but it's not
implemented in MPTCP.

This patch implements it with reference to __tcp_read_sock() and
__mptcp_recvmsg_mskq().

Corresponding to tcp_recv_skb(), a new helper for MPTCP named
mptcp_recv_skb() is added to peek a skb from sk->sk_receive_queue.

Compared with __mptcp_recvmsg_mskq(), mptcp_read_sock() uses
sk->sk_rcvbuf as the max read length. The LISTEN status is checked
before the while loop, and mptcp_recv_skb() and mptcp_cleanup_rbuf()
are invoked after the loop. In the loop, all flags checks for
__mptcp_recvmsg_mskq() are removed.

Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260130-net-next-mptcp-splice-v2-2-31332ba70d7f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c