From: Matthieu Baerts <matttbe@kernel.org>
To: Mat Martineau <martineau@kernel.org>, Geliang Tang <geliang@kernel.org>
Cc: mptcp@lists.linux.dev, Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v3 0/3] send() fails with EAGAIN in blocking IO mode #487
Date: Sun, 15 Jun 2025 23:29:47 +0200 [thread overview]
Message-ID: <23fd5569-f383-441e-9be4-48a8430954d9@kernel.org> (raw)
In-Reply-To: <a5c20f9f-3038-ed11-b78c-522ef40f9031@kernel.org>
Hi Mat, Geliang,
On 14/06/2025 01:11, Mat Martineau wrote:
> On Thu, 29 May 2025, Geliang Tang wrote:
>
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> Good news! I finally solved the unstable issue of MPTCP BPF sched
>> selftests
>> I reported a year ago, #487 "send() fails with EAGAIN in blocking IO
>> mode".
>>
>> The fix is simple, it can be solved by explicitly setting SO_SNDBUF
>> sockopt, but be sure not to set SO_RCVBUF at the same time
>> (see sk->sk_userlocks & SOCK_RCVBUF_LOCK in mptcp_rcv_space_adjust()).
>>
>> With this fix, BPF sched selftests are now very stable, I run loop
>> testing
>> using mptcp-upstream-virtme-docker (run_loop run_bpftest_all), and can
>> run
>> it normally for hundreds of times without error:
>>
>
> Hi Geliang -
>
> I can see how changing SO_SNDBUF on the sending socket side would shift
> timing behavior in a way that affect the test outcome, but it doesn't
> address the root issue with bug #487:
>
> It is either OK to get an EAGAIN from a blocking send(), or it's not OK.
>
>
> If it's not ok to ever return EAGAIN from a blocking send, the existing
> test code is a reproducer for a bug, and changing the test is hiding
> that bug.
>
> If EAGAIN is ok, then we should change the code in send_recv_server() to
> allow it.
It is now a bit hidden in the middle of #487, but if I'm not mistaken,
it is OK to get EAGAIN with a blocking send() **if** SO_SNDTIMEO is
used, and in case of timeout.
See:
https://github.com/multipath-tcp/mptcp_net-next/issues/487#issuecomment-2485577676
So I think the question should be: is it normal to block for longer than
the timeout period (which is a "long" period, no?)? If yes, then
limiting the send buffer might be a solution, but as Mat said, it looks
better to understand the root cause than hiding a bug :)
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2025-06-15 21:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 4:09 [PATCH mptcp-next v3 0/3] send() fails with EAGAIN in blocking IO mode #487 Geliang Tang
2025-05-29 4:09 ` [PATCH mptcp-next v3 1/3] selftests/bpf: Add sndbuf for send_recv_data Geliang Tang
2025-05-29 4:09 ` [PATCH mptcp-next v3 2/3] Squash to "selftests/bpf: Add bpf scheduler test" Geliang Tang
2025-05-29 4:09 ` [PATCH mptcp-next v3 3/3] DO-NOT-MERGE: selftests/bpf: Increase total_bytes of bpf sched tests Geliang Tang
2025-05-29 5:27 ` [PATCH mptcp-next v3 0/3] send() fails with EAGAIN in blocking IO mode #487 MPTCP CI
2025-06-13 23:11 ` Mat Martineau
2025-06-15 21:29 ` Matthieu Baerts [this message]
2025-06-16 6:34 ` Geliang Tang
2025-06-29 9:27 ` Geliang Tang
2025-07-16 1:43 ` Mat Martineau
2025-06-16 6:38 ` 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=23fd5569-f383-441e-9be4-48a8430954d9@kernel.org \
--to=matttbe@kernel.org \
--cc=geliang@kernel.org \
--cc=martineau@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.