prepare interfaces for kTLS and sockmap support
Subsystems (3)
Geliang Tang
reviewerv11 cover prepare interfaces for kTLS and sockmap support
v11:
- patch 1, clear app_limited on sendmsg exit and in the wait_for_memory path instead of in __subflow_push_pending, so all subflows pushed within one sendmsg are marked; read MPTCP_RETRANSMIT under mptcp_data_lock; move app_limited to a separate u8 bitfield.
- patch 2, guard the app_limited assertion with tcpi_delivery_rate instead of asserting tcpi_delivery_rate > 0.
v10:
- patch 1, clear app_limited flag in __subflow_push_pending.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v9:
- Move SIOCINQ patches out of this set.
- patch 1, add app_limited flag in struct mptcp_sock, call tcp_rate_check_app_limited in __subflow_push_pending instead of mptcp_sendmsg.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v8:
- patch 1: change mptcp_inq_hint() to maintain TCP semantics by adding 1
to hint_val when RCV_SHUTDOWN is set or sk_state is TCP_CLOSE, matching TCP behavior where FIN consumes a sequence number.
- patch 2: update the test.
- patches 3-7: no changes.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v7:
- patch 1: add 1 to hint_val when RCV_SHUTDOWN is set to include the FIN
byte, matching the previous ack_seq - map_seq behavior. Simplify the
EOF condition accordingly.
- patch 2: replace poll()-based check with a wait_for_remote_key() helper
that polls MPTCP_INFO until MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED is set, ensuring the third ACK has been processed before checking SIOCINQ. Add SOL_MPTCP fallback definition and handle ENOPROTOOPT/EOPNOTSUPP for
TCP or fallback sockets.
- patches 3-7: no changes.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v6:
- patch 2: add Fixes tag, and use '-net' prefix.
- patch 3: remove poll() call, check SIOCINQ directly after accept().
- patch 6: add READ_ONCE() for msk->flags and msk->cb_flags reads in mptcp_rate_check_app_limited() to annotate intentionally racy accesses.
- update commit logs.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v5:
- patch 2: new patch - rewrite mptcp_inq_hint() to use mptcp_data_avail() instead of ack_seq - map_seq, completely avoiding TFO overflow issues.
- patch 3: new patch - add TFO SIOCINQ overflow detection in
mptcp_connect test to catch INT_MAX returns on TFO connections.
- patch 4: mptcp_inq() now returns INT_MAX instead of 0 when avail >=
INT_MAX. Removed mptcp_inq_hint() changes (moved to patch 2).
- patch 6: replace mptcp_rtx_head() check with MPTCP_WORK_RTX and MPTCP_RETRANSMIT flag checks in mptcp_rate_check_app_limited() to
properly detect pending retransmissions without data race issues.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v4:
- patch 2: fix mptcp_inq_hint() to return 0 instead of INT_MAX on
passive TFO overflow (ack_seq - map_seq >= INT_MAX).
- patch 4: add mptcp_rtx_head(sk) to the early-return check in mptcp_rate_check_app_limited() so pending retransmissions also
prevent false app-limited marking.
- patch 5: update comment message.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v3:
- patch 2: drop DATA_FIN subtraction in mptcp_inq(), remove the
intermediate 'answ' variable and return (unsigned int)avail
directly. Update commit message accordingly.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v2:
- drop the patch "prevent dummy DATA_FIN on RST in fallback mode".
- keep mptcp_inq_hint in mptcp_ioctl unchanged.
- use mptcp_data_avail in mptcp_inq.
- add msk_owned_by_me check in mptcp_sendmsg_locked.
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
v1:
- https://patchwork.kernel.org/project/mptcp/cover/[email protected]/
This series was previously posted as part of "Reduce the differences between TCP and MPTCP for TLS usage" v15. It creates the mptcp_inq() and mptcp_sendmsg_locked() interfaces that are required for the upcoming MPTCP kTLS and MPTCP sockmap implementations.
The series has been rebased and no longer depends on Paolo's CB layout refactoring patches (mptcp: drop the mptcp_ooo_try_coalesce() helper,
mptcp: drop the cant_coalesce CB field, mptcp: remove CB offset field,
mptcp: sync mptcp skb cb layout with tcp one, mptcp: defer read_sock cleanup to mptcp_worker). Those patches are more complex and will be sent in a separate series.
Gang Yan (1):
mptcp: update mptcp_check_readable
Geliang Tang (3):
mptcp: track app-limited state in mptcp_sendmsg
selftests: mptcp: sockopt: check app_limited
mptcp: add sendmsg_locked to proto_ops
net/mptcp/protocol.c | 54 ++++++++++++++++--- net/mptcp/protocol.h | 1 + .../selftests/net/mptcp/mptcp_sockopt.c | 5 ++ 3 files changed, 53 insertions(+), 7 deletions(-)
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v11 1/4 mptcp: track app-limited state in mptcp_sendmsg
From: Geliang Tang <[email protected]>
Add mptcp_rate_check_app_limited() that evaluates MPTCP-level conditions (write_seq == snd_nxt, no pending dfrags, no pending retransmission) and stores the result in msk->app_limited. Called from mptcp_sendmsg() before the data copy loop. In __subflow_push_pending(), if msk->app_limited is set, call tcp_rate_check_app_limited() on the scheduled subflow. The flag is cleared in the wait_for_memory path and on sendmsg exit, so it is evaluated once per sendmsg and later pushes do not re-mark subflows while unsent dfrags are still queued, which would let BBR treat non-app-limited samples as application-limited.
--- net/mptcp/protocol.c | 25 +++++++++++++++++++++++++ net/mptcp/protocol.h | 1 + 2 files changed, 26 insertions(+)
net/mptcp/protocol.c +25 -0
@@ -1815,6 +1815,9 @@ static int __subflow_push_pending(struct sock *sk, struct sock *ssk,struct mptcp_data_frag *dfrag;int len, copied =0 , err =0 ; +if (msk->app_limited) +tcp_rate_check_app_limited (ssk); +while ((dfrag =mptcp_send_head (sk))) { info->sent = dfrag->already_sent; info->limit = dfrag->data_len;
@@ -2112,6 +2115,23 @@ static void mptcp_rps_record_subflows(const struct mptcp_sock *msk) } } +static void mptcp_rate_check_app_limited (struct sock *sk) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +unsigned long flags; +bool retransmit; + + flags =READ_ONCE (msk->flags); +mptcp_data_lock (sk); + retransmit =test_bit (MPTCP_RETRANSMIT , &msk->cb_flags); +mptcp_data_unlock (sk); + + msk->app_limited = msk->write_seq == msk->snd_nxt && + !mptcp_send_head (sk) && + !test_bit (MPTCP_WORK_RTX , &flags) && + !retransmit; +} +static int mptcp_sendmsg (struct sock *sk,struct msghdr *msg,size_t len) {struct mptcp_sock *msk =mptcp_sk (sk);
@@ -2142,6 +2162,9 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) timeo =sock_sndtimeo (sk, msg->msg_flags &MSG_DONTWAIT ); +/* is sending application-limited? */ +mptcp_rate_check_app_limited (sk); +if ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED |TCPF_CLOSE_WAIT )) { ret =sk_stream_wait_connect (sk, &timeo);if (ret)
@@ -2224,6 +2247,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) wait_for_memory:sk_set_nospace (sk);__mptcp_push_pending (sk, msg->msg_flags); + msk->app_limited =0 ; ret =sk_stream_wait_memory (sk, &timeo);if (ret) goto do_error;
@@ -2241,6 +2265,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) } out: + msk->app_limited =0 ;release_sock (sk);return copied;
net/mptcp/protocol.h +1 -0
@@ -350,6 +350,7 @@ struct mptcp_sock { free_first:1, rcvspace_init:1, fastclosing:1; + u8 app_limited:1;u32 notsent_lowat;int keepalive_cnt;int keepalive_idle;
Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH mptcp-next v11 1/4] mptcp: track app-limited state in mptcp_sendmsg
Thank you for your contribution! Sashiko AI review found 6 potential issues to consider: - [Medium] mptcp: __mptcp_push_pending() re-marks subflows as app-limited across bursts - [Medium] mptcp…
Thank you for your contribution! Sashiko AI review found 6 potential issues to consider:
- [Medium] mptcp: __mptcp_push_pending() re-marks subflows as app-limited across bursts
- [Medium] mptcp: msk->app_limited held across sk_stream_wait_connect() lock release
- [Medium] mptcp: unconditional mptcp_data_lock() in mptcp_rate_check_app_limited()
- [Medium] mptcp: wait_for_memory clears app_limited without checking subflows
- [Low] mptcp: mptcp_sendmsg() races with mptcp_sk_clone_init() on TCP_LISTEN
- [Low] mptcp: placing app_limited before notsent_lowat grows struct mptcp_sock
--
commit c4ee47e05973bf0226120dac06abfeee7a11ebbb
Author: Geliang Tang <[email protected]>
mptcp: track app-limited state in mptcp_sendmsg
This commit adds mptcp_rate_check_app_limited() to evaluate MPTCP-level application-limited state in mptcp_sendmsg() and store it in msk->app_limited, calling tcp_rate_check_app_limited() on scheduled subflows in __subflow_push_pending().
Quoted 5 lines
net/mptcp/protocol.c +0
-0
net/mptcp/protocol.c static int __subflow_push_pending(struct sock *sk, struct sock *ssk, · line 1823
Quoted 9 lines
net/mptcp/protocol.c +3
-0@@ -1815,6 +1815,9 @@ static int __subflow_push_pending(struct sock *sk, struct sock *ssk,struct mptcp_data_frag *dfrag;int len, copied =0 , err =0 ; +if (msk->app_limited) +tcp_rate_check_app_limited (ssk); +while ((dfrag =mptcp_send_head (sk))) { info->sent = dfrag->already_sent; info->limit = dfrag->data_len;
[Severity: Medium]
Can __mptcp_push_pending() call tcp_rate_check_app_limited() repeatedly on the same subflow across multiple bursts within a single mptcp_sendmsg()?
Because msk->app_limited stays set until __mptcp_push_pending() returns, a multi-subflow connection sending more than two bursts (~128 KB) in one sendmsg() visits ssk1 in round 1, switches to ssk2 in round 2 (which calls mptcp_push_release(ssk1, &info) -> tcp_push(ssk1, ...), advancing tp->snd_nxt to tp->write_seq), and then returns to ssk1 in round 3 while unsent dfrags are still queued.
Once round 1's packets leave the host TX queue (such as on fast NICs, veth, or loopback), the second tcp_rate_check_app_limited(ssk1) call overwrites tp->app_limited to tp->delivered + tcp_packets_in_flight(tp). This marks non-app-limited bulk bursts as application-limited, impairing BBR Startup exit and bandwidth sampling.
Quoted 14 lines
net/mptcp/protocol.c +10
-0@@ -2112,6 +2115,23 @@ static void mptcp_rps_record_subflows(const struct mptcp_sock *msk) } } +static void mptcp_rate_check_app_limited (struct sock *sk) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +unsigned long flags; +bool retransmit; + + flags =READ_ONCE (msk->flags); +mptcp_data_lock (sk); + retransmit =test_bit (MPTCP_RETRANSMIT , &msk->cb_flags); +mptcp_data_unlock (sk);
net/mptcp/protocol.c static void mptcp_rps_record_subflows(const struct mptcp_sock *msk) · line 2137
Quoted 10 lines
net/mptcp/protocol.c +7
-0+ + msk->app_limited = msk->write_seq == msk->snd_nxt && + !mptcp_send_head (sk) && + !test_bit (MPTCP_WORK_RTX , &flags) && + !retransmit; +} +static int mptcp_sendmsg (struct sock *sk,struct msghdr *msg,size_t len) {struct mptcp_sock *msk =mptcp_sk (sk);
[Severity: Medium]
Why does mptcp_rate_check_app_limited() take mptcp_data_lock(sk) unconditionally before checking the cheap socket-lock-protected fields?
mptcp_data_lock(sk) acquires spin_lock_bh(&sk->sk_lock.slock), which adds a third slock acquisition and BH disable/enable pair to every mptcp_sendmsg() call and contends with softirq RX/ACK processing such as mptcp_update_data_ack(). Short-circuiting on write_seq == snd_nxt, !mptcp_send_head(sk), and !test_bit(MPTCP_WORK_RTX, &flags) first avoids taking the spinlock whenever the socket is already non-app-limited.
net/mptcp/protocol.c static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) · line 2170
Quoted 10 lines
net/mptcp/protocol.c +3
-0@@ -2142,6 +2162,9 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) timeo =sock_sndtimeo (sk, msg->msg_flags &MSG_DONTWAIT ); +/* is sending application-limited? */ +mptcp_rate_check_app_limited (sk); +if ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED |TCPF_CLOSE_WAIT )) { ret =sk_stream_wait_connect (sk, &timeo);if (ret)
[Severity: Medium]
Is it safe to leave msk->app_limited set across sk_stream_wait_connect()?
When sk is still connecting, sk_stream_wait_connect() sleeps in sk_wait_event() and releases lock_sock(sk) while msk->app_limited is 1:
CPU0 CPU1mptcp_sendmsg()
lock_sock(sk)
mptcp_rate_check_app_limited()
msk->app_limited = 1
sk_stream_wait_connect()
sk_wait_event()
release_sock(sk) <-- msk->app_limited leaked as 1
mptcp_sendmsg(MSG_DONTWAIT)
lock_sock(sk)
sk_stream_wait_connect() -> -EAGAIN
out: msk->app_limited = 0
release_sock(sk) lock_sock(sk) <-- resumes with clobbered/stale flag
While CPU0 sleeps, mptcp_release_cb() or an asynchronous push/retransmit path can observe the leaked msk->app_limited = 1, and any concurrent mptcp_sendmsg() clears it at out:. When CPU0 wakes up, it enters the copy loop without re-evaluating mptcp_rate_check_app_limited(). Moving the call after sk_stream_wait_connect() and the sk_err/SEND_SHUTDOWN check avoids holding this transient state across lock release.
net/mptcp/protocol.c static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) · line 2253
Quoted 8 lines
net/mptcp/protocol.c +1
-0@@ -2224,6 +2247,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) wait_for_memory:sk_set_nospace (sk);__mptcp_push_pending (sk, msg->msg_flags); + msk->app_limited =0 ; ret =sk_stream_wait_memory (sk, &timeo);if (ret) goto do_error;
[Severity: Medium]
Does clearing msk->app_limited here discard the app-limited check on SO_SNDBUF-limited connections?
When sk->sk_wmem_queued >= sk->sk_sndbuf on the first iteration of the sendmsg loop, mptcp_send_limit() returns 0 and jumps to wait_for_memory with mptcp_send_head(sk) == NULL. __mptcp_push_pending() then returns immediately without calling __subflow_push_pending() or tcp_rate_check_app_limited(ssk), and clearing msk->app_limited = 0 before sleeping ensures no subflow is ever marked after wakeup either.
Unlike plain TCP, which calls tcp_rate_check_app_limited() before entering the wait_for_space loop, BBR will treat SO_SNDBUF-limited delivery rate samples as non-app-limited network-bottleneck samples.
net/mptcp/protocol.c static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) · line 2271
Quoted 8 lines
net/mptcp/protocol.c +1
-0@@ -2241,6 +2265,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) } out: + msk->app_limited =0 ;release_sock (sk);return copied;
[Severity: Low]
Can mptcp_sendmsg() on a TCP_LISTEN socket race with mptcp_sk_clone_init() when writing msk->app_limited?
CPU0 <softirq>mptcp_sendmsg() on TCP_LISTEN
lock_sock(sk)
mptcp_rate_check_app_limited()
msk->app_limited = 1
sk_stream_wait_connect()
-> -EPIPE subflow_syn_recv_sock() out: mptcp_sk_clone_init()
msk->app_limited = 0 sk_clone_lock()
sock_copy(newsk, sk) <-- data race
subflow_syn_recv_sock() calls mptcp_sk_clone_init() -> sk_clone_lock() -> sock_copy() without lock_sock(sk), so writing msk->app_limited on a listening socket creates a KCSAN data race, and neither __mptcp_init_sock() nor mptcp_sk_clone_init() resets app_limited on the cloned child. Note that even moving mptcp_rate_check_app_limited() after sk_stream_wait_connect() still leaves the unconditional write at out:
mutating a TCP_LISTEN socket unless guarded or kept local to sendmsg.
net/mptcp/protocol.h struct mptcp_sock { · line 356
Quoted 12 lines
net/mptcp/protocol.h +1
-0@@ -350,6 +350,7 @@ struct mptcp_sock { free_first:1, rcvspace_init:1, fastclosing:1; + u8 app_limited:1;u32 notsent_lowat;int keepalive_cnt;int keepalive_idle;
[Severity: Low]
Placing app_limited here adds 3 bytes of padding before notsent_lowat and 4 bytes after maxseg before struct work_struct work, growing struct mptcp_sock (and struct mptcp6_sock) by 8 bytes on 64-bit builds. There is an existing 2-byte alignment hole after scaling_ratio and allow_subflows before subflow_id that could hold it without growing the struct.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Geliang Tang
reviewerPATCH v11 2/4 selftests: mptcp: sockopt: check app_limited
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
After a small data exchange, assert tcpi_delivery_rate_app_limited == 1 when expect_all_features() is enabled and tcpi_delivery_rate is non-zero.
rate_app_limited starts at 1 (tcp_init_sock) and is cleared only by non-app-limited rate samples. The preceding commit evaluates MPTCP-level conditions in mptcp_rate_check_app_limited(), stores the result in msk->app_limited, and calls tcp_rate_check_app_limited() on each scheduled subflow during push. This marks outgoing skbs as app-limited so rate samples don't clear rate_app_limited.
The tcpi_delivery_rate guard skips the assertion when no rate sample was measured yet, where rate_app_limited would trivially still be 1.
--- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_sockopt.c +5 -0
@@ -635,6 +635,11 @@ static void connect_one_server(int fd, int pipefd)do_getsockopts (&s, fd, total, total);assert (s.mptcpi_rcv_delta == (uint64_t )total); + +/* app-limited accounting only checked under EXPECT_ALL_FEATURES */ +if (expect_all_features () && s.tcp_info.tcpi_delivery_rate) +assert (s.tcp_info.tcpi_delivery_rate_app_limited ==1 ); +close (fd); }
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v11 3/4 mptcp: add sendmsg_locked to proto_ops
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
MPTCP currently provides a standard sendmsg() implementation which acquires and releases the socket lock internally. However, certain upper layers need to call the sendmsg method while the socket lock is already held.
Split the existing mptcp_sendmsg() into mptcp_sendmsg_locked() which assumes the caller holds the socket lock, and a tiny wrapper mptcp_sendmsg() that acquires the lock and calls the locked version. Add msk_owned_by_me() assertion to enforce the locking requirement. Expose .sendmsg_locked in both mptcp_stream_ops and mptcp_v6_stream_ops.
Unlike tcp_sendmsg_locked(), mptcp_sendmsg_locked() drops the MSG_SPLICE_PAGES flag from the mask. Future kTLS and sockmap support will require additional changes to call through proto_ops->sendmsg_locked instead of tcp_sendmsg_locked() directly.
--- net/mptcp/protocol.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
net/mptcp/protocol.c +16 -4
@@ -2132,7 +2132,7 @@ static void mptcp_rate_check_app_limited(struct sock *sk) !retransmit; } -static int mptcp_sendmsg (struct sock *sk,struct msghdr *msg,size_t len) +static int mptcp_sendmsg_locked (struct sock *sk,struct msghdr *msg,size_t len) {struct mptcp_sock *msk =mptcp_sk (sk);struct page_frag *pfrag;
@@ -2140,12 +2140,12 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)int ret =0 ;long timeo; +msk_owned_by_me (msk); +/* silently ignore everything else */ msg->msg_flags &=MSG_MORE |MSG_DONTWAIT |MSG_NOSIGNAL |MSG_FASTOPEN |MSG_EOR ; -lock_sock (sk); -mptcp_rps_record_subflows (msk); if (unlikely(inet_test_bit(DEFER_CONNECT, sk) ||
@@ -2266,7 +2266,6 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) out: msk->app_limited =0 ; -release_sock (sk);return copied; do_error:
@@ -2279,6 +2278,17 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) goto out; } +static int mptcp_sendmsg (struct sock *sk,struct msghdr *msg,size_t len) +{ +int ret; + +lock_sock (sk); + ret =mptcp_sendmsg_locked (sk, msg, len); +release_sock (sk); + +return ret; +} +static void mptcp_rcv_space_adjust (struct mptcp_sock *msk,int copied);static void mptcp_eat_recv_skb (struct sock *sk,struct sk_buff *skb)
@@ -5097,6 +5107,7 @@ static const struct proto_ops mptcp_stream_ops = { .set_rcvlowat = mptcp_set_rcvlowat, .read_sock = mptcp_read_sock, .splice_read = mptcp_splice_read, + .sendmsg_locked = mptcp_sendmsg_locked, };static struct inet_protosw mptcp_protosw = {
@@ -5216,6 +5227,7 @@ static const struct proto_ops mptcp_v6_stream_ops = { .set_rcvlowat = mptcp_set_rcvlowat, .read_sock = mptcp_read_sock, .splice_read = mptcp_splice_read, + .sendmsg_locked = mptcp_sendmsg_locked, };static struct proto mptcp_v6_prot;
Signature · 1 line
2.55.0
Geliang Tang
reviewerPATCH v11 4/4 mptcp: update mptcp_check_readable
In reply to Geliang TangFrom: Gang Yan <[email protected]>
This patch makes mptcp_check_readable() aligned with TCP, and renames it to mptcp_stream_is_readable(). It will be used in the case of KTLS, because 'prot' will be modified, tls_sw_sock_is_readable() is expected to be called from prot->sock_is_readable().
--- net/mptcp/protocol.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/mptcp/protocol.c +6 -3
@@ -3741,9 +3741,11 @@ void __mptcp_unaccepted_force_close(struct sock *sk)__mptcp_destroy_sock (sk); } -static __poll_t mptcp_check_readable (struct sock *sk) +static bool mptcp_stream_is_readable (struct sock *sk) { -return mptcp_epollin_ready (sk) ?EPOLLIN |EPOLLRDNORM :0 ; +if (mptcp_epollin_ready (sk)) +return true; +return sk_is_readable (sk); }static void mptcp_check_listen_stop (struct sock *sk)
@@ -4871,7 +4873,8 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock, mask |=EPOLLIN |EPOLLRDNORM |EPOLLRDHUP ;if (state !=TCP_SYN_SENT && state !=TCP_SYN_RECV ) { - mask |=mptcp_check_readable (sk); +if (mptcp_stream_is_readable (sk)) + mask |=EPOLLIN |EPOLLRDNORM ;if (shutdown &SEND_SHUTDOWN ) mask |=EPOLLOUT |EPOLLWRNORM ;else
Signature · 1 line
2.55.0