From: Geliang Tang <geliang@kernel.org>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: [PATCH mptcp-net] mptcp: fix EAGAIN errors in MPTCP BPF tests
Date: Thu, 2 May 2024 20:57:54 +0800 [thread overview]
Message-ID: <4538e7bca21fdb7f997c026d74f886aedb547d39.1714654631.git.tanggeliang@kylinos.cn> (raw)
From: Geliang Tang <tanggeliang@kylinos.cn>
BPF tests fail sometimes with "bytes != total_bytes" errors:
test_default:PASS:sched_init:default 0 nsec
send_data:PASS:pthread_create 0 nsec
send_data:FAIL:recv 936000 != 10485760 nr_recv:-1 errno:11
default: 3041 ms
server:FAIL:send 7579500 != 10485760 nr_sent:-1 errno:11
send_data:FAIL:pthread_join thread_ret:-11 test_default:PASS: \
has_bytes_sent addr_1 0 nsec
test_default:PASS:has_bytes_sent addr_2 0 nsec
close_netns:PASS:setns 0 nsec
In this case mptcp_recvmsg gets EAGAIN errors. This issue introduces
by commit dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale").
This patch fixes it by adding sk_is_mptcp() check defore update
scaling_ratio in tcp_measure_rcv_mss(). Do not update scaling_ratio if
this is a MPTCP socket.
Fixes: dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/487
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/ipv4/tcp_input.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index ad8fa129fcfe..39237d6713ee 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -235,8 +235,10 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)
/* Note: divides are still a bit expensive.
* For the moment, only adjust scaling_ratio
* when we update icsk_ack.rcv_mss.
+ *
+ * This breaks MPTCP BPF tests, skip it.
*/
- if (unlikely(len != icsk->icsk_ack.rcv_mss)) {
+ if (unlikely(len != icsk->icsk_ack.rcv_mss && !sk_is_mptcp(sk))) {
u64 val = (u64)skb->len << TCP_RMEM_TO_WIN_SCALE;
do_div(val, skb->truesize);
--
2.43.0
next reply other threads:[~2024-05-02 12:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 12:57 Geliang Tang [this message]
2024-05-02 13:53 ` [PATCH mptcp-net] mptcp: fix EAGAIN errors in MPTCP BPF tests MPTCP CI
2024-05-07 1:02 ` Mat Martineau
2024-05-07 3:52 ` Geliang Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4538e7bca21fdb7f997c026d74f886aedb547d39.1714654631.git.tanggeliang@kylinos.cn \
--to=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=tanggeliang@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).