Skip to content

Commit 3b9dfbf

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: set .splice_read
This patch sets .splice_read interface of mptcp struct proto_ops as tcp_splice_read. And invoke .read_sock in __tcp_splice_read(). v2: - use INDIRECT_CALL_INET_1. Signed-off-by: Geliang Tang <[email protected]>
1 parent 42c09c0 commit 3b9dfbf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

net/ipv4/tcp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,13 +774,15 @@ static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
774774

775775
static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
776776
{
777+
const struct proto_ops *ops = READ_ONCE(sk->sk_socket->ops);
777778
/* Store TCP splice context information in read_descriptor_t. */
778779
read_descriptor_t rd_desc = {
779780
.arg.data = tss,
780781
.count = tss->len,
781782
};
782783

783-
return tcp_read_sock(sk, &rd_desc, tcp_splice_data_recv);
784+
return INDIRECT_CALL_INET_1(ops->read_sock, tcp_read_sock,
785+
sk, &rd_desc, tcp_splice_data_recv);
784786
}
785787

786788
/**

net/mptcp/protocol.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4039,6 +4039,7 @@ static const struct proto_ops mptcp_stream_ops = {
40394039
.mmap = sock_no_mmap,
40404040
.set_rcvlowat = mptcp_set_rcvlowat,
40414041
.read_sock = mptcp_read_sock,
4042+
.splice_read = tcp_splice_read,
40424043
};
40434044

40444045
static struct inet_protosw mptcp_protosw = {
@@ -4144,6 +4145,7 @@ static const struct proto_ops mptcp_v6_stream_ops = {
41444145
#endif
41454146
.set_rcvlowat = mptcp_set_rcvlowat,
41464147
.read_sock = mptcp_read_sock,
4148+
.splice_read = tcp_splice_read,
41474149
};
41484150

41494151
static struct proto mptcp_v6_prot;

0 commit comments

Comments
 (0)