From nobody Tue Feb 10 04:13:11 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83E8F32471A; Thu, 29 Jan 2026 19:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769714642; cv=none; b=bJvNc2/2IupGH2yNI+wDmWgIsZa4pxjr57/bD+dz9dJgzye+B6nBdxBJN2lSMTGzMdIKubnYFBKphRxTfMwuEp50yvIWab8Q3rwaAY0iXw1g8sLC/6+F++YLuqKd/lksm+i5aFyzoeEHxpHm9CVj4xcZYV0x3RuCuSK7bvrJ3Ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769714642; c=relaxed/simple; bh=5pXsZ1+bdcl0+5ekJkKvICgBbW8Fn1J1qfigEm+sIpQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GtISvvJaQGUS3176ahixpcXJDKwgPmZWIZ2ztyEQlso1WmlM4hzfQCxoe5BwuIKYB5r2PtTanLnqNYLcyKEM8cjKbtmUVvmgnh+NmB81he3sm5bfUN9nxn/aX/FxDbx+tQN+kjdR83C1V6CWmDOr5XE4/DOqGFPZSRUIPk8pJQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eyCDgmFs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eyCDgmFs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7B91C2BC86; Thu, 29 Jan 2026 19:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769714640; bh=5pXsZ1+bdcl0+5ekJkKvICgBbW8Fn1J1qfigEm+sIpQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eyCDgmFskEs8TLZcnVdkB0SWuu7iFTRnF/KeXF6dfEdicQAFGOQEHFsWKNELAEuEJ yT0rft9c92//i7t/yOugLElCbTxu2bbBQjKUg1M3FWZ2vcgAVMb8LvGEOeMXk4Srxb 9DvCyc+EW/Aw2LjmhATVdxZIidz588P6HP7DK7gHlwNxDbyumduEs0RCG5auGgVP78 MthL3fJagCwHZZkyXmi6LX+lZPBIE+izrGyMV2EIEuO2nnud6leAvy4Rgv0Ljd8bvN 7CsiDokfZ+8of8vYDrI131Ff9BW92MqFrKWrToN9r1GydK8dwfgEL/yTz5pqfAF5RW uPgUfUp2Or3PQ== From: "Matthieu Baerts (NGI0)" Date: Thu, 29 Jan 2026 20:23:36 +0100 Subject: [PATCH net-next 3/6] tcp: export tcp_splice_state Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260129-net-next-mptcp-splice-v1-3-994cac40daa0@kernel.org> References: <20260129-net-next-mptcp-splice-v1-0-994cac40daa0@kernel.org> In-Reply-To: <20260129-net-next-mptcp-splice-v1-0-994cac40daa0@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Neal Cardwell , Kuniyuki Iwashima , David Ahern , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2568; i=matttbe@kernel.org; h=from:subject:message-id; bh=E5O3UWqgt4CvgYo2yhYrE/jWhi6yLAzzOug/sQ4PZ3w=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKrNx9iUA1kNpL1O7B6J6e65fNpXUYqncsNJzivNHy7p LdJM+96RykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZwIZwcQrAREQcGP6HFr7e/uW+dpfB3wop b2+b1PlLvs4/NmvLt5T2J3PuTv7qxPA/bsWbSa0z1Yy+3bp1lY370peNE5wWLZGtSeZfJpSgu/I XIwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Geliang Tang Export struct tcp_splice_state and tcp_splice_data_recv() in net/tcp.h so that they can be used by MPTCP in the next patch. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Acked-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- include/net/tcp.h | 11 +++++++++++ net/ipv4/tcp.c | 13 ++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index f1cf9e6730c8..cecec1a92d5e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -347,6 +347,15 @@ extern struct proto tcp_prot; #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics= , field) #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_stati= stics, field, val) =20 +/* + * TCP splice context + */ +struct tcp_splice_state { + struct pipe_inode_info *pipe; + size_t len; + unsigned int flags; +}; + void tcp_tsq_work_init(void); =20 int tcp_v4_err(struct sk_buff *skb, u32); @@ -378,6 +387,8 @@ void tcp_rcv_space_adjust(struct sock *sk); int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); void tcp_twsk_destructor(struct sock *sk); void tcp_twsk_purge(struct list_head *net_exit_list); +int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, + unsigned int offset, size_t len); ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags); diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index e4009158b908..6e94c5859f4b 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -318,15 +318,6 @@ EXPORT_SYMBOL(tcp_have_smc); struct percpu_counter tcp_sockets_allocated ____cacheline_aligned_in_smp; EXPORT_IPV6_MOD(tcp_sockets_allocated); =20 -/* - * TCP splice context - */ -struct tcp_splice_state { - struct pipe_inode_info *pipe; - size_t len; - unsigned int flags; -}; - /* * Pressure flag: try to collapse. * Technical note: it is used by multiple contexts non atomically. @@ -791,8 +782,8 @@ void tcp_push(struct sock *sk, int flags, int mss_now, __tcp_push_pending_frames(sk, mss_now, nonagle); } =20 -static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff= *skb, - unsigned int offset, size_t len) +int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, + unsigned int offset, size_t len) { struct tcp_splice_state *tss =3D rd_desc->arg.data; int ret; --=20 2.51.0