[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGxU2F5XeRs+4Fwrf_LhOjhjxaWOocpZDQanOc+mcDyPFRHCfQ@mail.gmail.com>
Date: Wed, 7 May 2025 18:18:20 +0200
From: Stefano Garzarella <sgarzare@...hat.com>
To: Konstantin Shkolnyy <kshk@...ux.ibm.com>
Cc: virtualization@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, mjrosato@...ux.ibm.com
Subject: Re: [PATCH net v2] vsock/test: Fix occasional failure in SIOCOUTQ
tests
On Wed, 7 May 2025 at 18:01, Konstantin Shkolnyy <kshk@...ux.ibm.com> wrote:
>
> On 07-May-25 10:41, Stefano Garzarella wrote:
> > On Wed, 7 May 2025 at 17:15, Konstantin Shkolnyy <kshk@...ux.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@...ux.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?
>
Okay, now that I think back on it, it's the same thing I thought of when
I did this.
I guess in v1 the sleep was just to limit the number of cycles.
LGTM:
Reviewed-by: Stefano Garzarella <sgarzare@...hat.com>
Powered by blists - more mailing lists