From: Stefan Hajnoczi <stefanha@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
hreitz@redhat.com,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
gmaglione@redhat.com
Subject: Re: [PATCH v2 2/3] libvhost-user: look for available vq buffers upon SET_VRING_KICK
Date: Thu, 4 Jun 2026 15:47:43 -0400 [thread overview]
Message-ID: <20260604194743.GA149856@fedora> (raw)
In-Reply-To: <ah_rtghBvzQgN8fy@sgarzare-redhat>
[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]
On Wed, Jun 03, 2026 at 11:03:18AM +0200, Stefano Garzarella wrote:
> On Tue, May 19, 2026 at 03:15:47PM -0400, Stefan Hajnoczi wrote:
> > When a vring is started the back-end must look for available vq buffers
> > and process them. This scenario can happen if the back-end is stopped
> > with unprocessed available buffers and then started again.
> >
> > The inflight I/O tracking code already did this, but it should also be
> > done when inflight I/O tracking is not enabled. Move the code.
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > subprojects/libvhost-user/libvhost-user.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
> > index 9c630c2170..2e286ea6d9 100644
> > --- a/subprojects/libvhost-user/libvhost-user.c
> > +++ b/subprojects/libvhost-user/libvhost-user.c
> > @@ -1390,11 +1390,6 @@ vu_check_queue_inflights(VuDev *dev, VuVirtq *vq)
> > vq->counter = vq->resubmit_list[0].counter + 1;
> > }
> >
> > - /* in case of I/O hang after reconnecting */
> > - if (eventfd_write(vq->kick_fd, 1)) {
> > - return -1;
> > - }
> > -
> > return 0;
> > }
> >
> > @@ -1436,6 +1431,11 @@ vu_set_vring_kick_exec(VuDev *dev, VhostUserMsg *vmsg)
> > vu_panic(dev, "Failed to check inflights for vq: %d\n", index);
> > }
> >
> > + /* Inject a kick to look for available vq buffers */
> > + if (eventfd_write(dev->vq[index].kick_fd, 1)) {
>
> Should we check if kick_fd is not -1 like we already do in other places in
> this function? (mainly when `nofd` is true)
>
> > + return -1;
>
> This function returns boolean, -1 is `true` and IIUC means that we ask for a
> reply which is not the case here. We should fix it.
Thanks for catch these things. I'm going to redo this patch. Not sure
what I was thinking :).
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-06-04 19:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 19:15 [PATCH v2 0/3] vhost-user.rst: clarify when rings are started Stefan Hajnoczi
2026-05-19 19:15 ` [PATCH v2 1/3] " Stefan Hajnoczi
2026-06-03 9:04 ` Stefano Garzarella
2026-06-04 19:49 ` Stefan Hajnoczi
2026-05-19 19:15 ` [PATCH v2 2/3] libvhost-user: look for available vq buffers upon SET_VRING_KICK Stefan Hajnoczi
2026-06-03 9:03 ` Stefano Garzarella
2026-06-04 19:47 ` Stefan Hajnoczi [this message]
2026-05-19 19:15 ` [PATCH v2 3/3] vhost-user: inject kick after SET_VRING_KICK Stefan Hajnoczi
2026-06-03 9:13 ` Stefano Garzarella
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=20260604194743.GA149856@fedora \
--to=stefanha@redhat.com \
--cc=gmaglione@redhat.com \
--cc=hreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
/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.