From: Konstantin Shkolnyy <kshk@linux.ibm.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: virtualization@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, mjrosato@linux.ibm.com
Subject: Re: [PATCH net v2] vsock/test: Fix occasional failure in SIOCOUTQ tests
Date: Wed, 7 May 2025 11:01:34 -0500 [thread overview]
Message-ID: <689ab62a-7800-497d-a9a6-3a81e256f98d@linux.ibm.com> (raw)
In-Reply-To: <CAGxU2F6ssoadHjCH9qi6HdaproC3rH=d-CdYh2mvK+_X4-C4nw@mail.gmail.com>
On 07-May-25 10:41, Stefano Garzarella wrote:
> On Wed, 7 May 2025 at 17:15, Konstantin Shkolnyy <kshk@linux.ibm.com> wrote:
>>
>> These tests:
>> "SOCK_STREAM ioctl(SIOCOUTQ) 0 unsent bytes"
>> "SOCK_SEQPACKET ioctl(SIOCOUTQ) 0 unsent bytes"
>> output: "Unexpected 'SIOCOUTQ' value, expected 0, got 64 (CLIENT)".
>>
>> They test that the SIOCOUTQ ioctl reports 0 unsent bytes after the data
>> have been received by the other side. However, sometimes there is a delay
>> in updating this "unsent bytes" counter, and the test fails even though
>> the counter properly goes to 0 several milliseconds later.
>>
>> The delay occurs in the kernel because the used buffer notification
>> callback virtio_vsock_tx_done(), called upon receipt of the data by the
>> other side, doesn't update the counter itself. It delegates that to
>> a kernel thread (via vsock->tx_work). Sometimes that thread is delayed
>> more than the test expects.
>>
>> Change the test to poll SIOCOUTQ until it returns 0 or a timeout occurs.
>>
>> Signed-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
>> ---
>> Changes in v2:
>> - Use timeout_check() to end polling, instead of counting iterations.
>
> Why removing the sleep?
I just imagined that whoever uses SIOCOUTQ might want to repeat it
without a delay, so why not do it, it's a test. Is there a reason to
insert a sleep?
next prev parent reply other threads:[~2025-05-07 16:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 15:14 Konstantin Shkolnyy
2025-05-07 15:41 ` Stefano Garzarella
2025-05-07 16:01 ` Konstantin Shkolnyy [this message]
2025-05-07 16:18 ` Stefano Garzarella
2025-05-13 8:46 ` Paolo Abeni
2025-05-13 13:44 ` Stefano Garzarella
2025-05-13 22:10 ` patchwork-bot+netdevbpf
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=689ab62a-7800-497d-a9a6-3a81e256f98d@linux.ibm.com \
--to=kshk@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=sgarzare@redhat.com \
--cc=virtualization@lists.linux.dev \
/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
all inboxes | Powered by JetHome®