[{"id":1759423,"web_url":"http://patchwork.ozlabs.org/comment/1759423/","msgid":"<20170829175820-mutt-send-email-mst@kernel.org>","list_archive_url":null,"date":"2017-08-29T15:01:30","subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","submitter":{"id":2235,"url":"http://patchwork.ozlabs.org/api/people/2235/","name":"Michael S. Tsirkin","email":"mst@redhat.com"},"content":"On Tue, Aug 29, 2017 at 04:48:04PM +0200, Marc-André Lureau wrote:\n> This is the same workaround as commit 523b018dde3b765, which was lost\n> with libvhost-user transition in commit e10e798c85c2331.\n> \n> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> ---\n>  contrib/libvhost-user/libvhost-user.h |  5 +++++\n>  contrib/libvhost-user/libvhost-user.c | 13 +++++++++++++\n>  2 files changed, 18 insertions(+)\n> \n> diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h\n> index 53ef222c0b..aca71717c1 100644\n> --- a/contrib/libvhost-user/libvhost-user.h\n> +++ b/contrib/libvhost-user/libvhost-user.h\n> @@ -132,6 +132,7 @@ typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);\n>  typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,\n>                                    int *do_reply);\n>  typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);\n> +typedef bool (*vu_queue_resume_to_used_cb) (VuDev *dev, int qidx);\n>  \n>  typedef struct VuDevIface {\n>      /* called by VHOST_USER_GET_FEATURES to get the features bitmask */\n> @@ -148,6 +149,10 @@ typedef struct VuDevIface {\n>      vu_process_msg_cb process_msg;\n>      /* tells when queues can be processed */\n>      vu_queue_set_started_cb queue_set_started;\n> +    /* If the queue must be resumed to vring.used->idx. */\n> +    /* This can help to support resuming on unmanaged exit/crash when\n> +     * the slave/driver processes elements in order. */\n> +    vu_queue_resume_to_used_cb queue_resume_to_used;\n>  } VuDevIface;\n>  \n>  typedef void (*vu_queue_handler_cb) (VuDev *dev, int qidx);\n\nLet's consider: this is only safe if queue is processed in order.\nSo I think that would be a better name for the field.\n\n\n> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c\n> index 35fa0c5e56..36439caed6 100644\n> --- a/contrib/libvhost-user/libvhost-user.c\n> +++ b/contrib/libvhost-user/libvhost-user.c\n> @@ -521,6 +521,19 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)\n>  \n>      vq->used_idx = vq->vring.used->idx;\n>  \n> +    if (vq->last_avail_idx != vq->used_idx) {\n> +        bool resume = dev->iface->queue_resume_to_used &&\n> +            dev->iface->queue_resume_to_used(dev, index);\n> +\n> +        DPRINT(\"Last avail index != used index: %u != %u%s\\n\",\n> +               vq->last_avail_idx, vq->used_idx,\n> +               resume ? \", resuming\" : \"\");\n> +\n> +        if (resume) {\n> +            vq->shadow_avail_idx = vq->last_avail_idx = vq->used_idx;\n> +        }\n> +    }\n> +\n>      return false;\n>  }\n>  \n> -- \n> 2.14.1.146.gd35faa819","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mst@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhX0z23TCz9sR9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 01:02:10 +1000 (AEST)","from localhost ([::1]:45391 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmi1n-0003YL-KR\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 11:02:07 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38682)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dmi1N-0003Y7-Vx\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:01:48 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dmi1K-0006yV-3x\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:01:42 -0400","from mx1.redhat.com ([209.132.183.28]:46726)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mst@redhat.com>) id 1dmi1J-0006yH-Qj\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:01:38 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 73CA691FC3\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 15:01:36 +0000 (UTC)","from redhat.com (ovpn-120-128.rdu2.redhat.com [10.10.120.128])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 891741755B;\n\tTue, 29 Aug 2017 15:01:30 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 73CA691FC3","Date":"Tue, 29 Aug 2017 18:01:30 +0300","From":"\"Michael S. Tsirkin\" <mst@redhat.com>","To":"=?iso-8859-1?q?Marc-Andr=E9?= Lureau <marcandre.lureau@redhat.com>","Message-ID":"<20170829175820-mutt-send-email-mst@kernel.org>","References":"<20170829144805.28872-1-marcandre.lureau@redhat.com>\n\t<20170829144805.28872-2-marcandre.lureau@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<20170829144805.28872-2-marcandre.lureau@redhat.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tTue, 29 Aug 2017 15:01:36 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"victork@redhat.com, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759429,"web_url":"http://patchwork.ozlabs.org/comment/1759429/","msgid":"<CAJ+F1CLYGyJyfNB26iyiaRbf5Pq9HveW_h+rFp_ZFrrvkmATDA@mail.gmail.com>","list_archive_url":null,"date":"2017-08-29T15:04:34","subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","submitter":{"id":6442,"url":"http://patchwork.ozlabs.org/api/people/6442/","name":"Marc-André Lureau","email":"marcandre.lureau@gmail.com"},"content":"Hi\n\nOn Tue, Aug 29, 2017 at 5:01 PM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> On Tue, Aug 29, 2017 at 04:48:04PM +0200, Marc-André Lureau wrote:\n>> This is the same workaround as commit 523b018dde3b765, which was lost\n>> with libvhost-user transition in commit e10e798c85c2331.\n>>\n>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n>> ---\n>>  contrib/libvhost-user/libvhost-user.h |  5 +++++\n>>  contrib/libvhost-user/libvhost-user.c | 13 +++++++++++++\n>>  2 files changed, 18 insertions(+)\n>>\n>> diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h\n>> index 53ef222c0b..aca71717c1 100644\n>> --- a/contrib/libvhost-user/libvhost-user.h\n>> +++ b/contrib/libvhost-user/libvhost-user.h\n>> @@ -132,6 +132,7 @@ typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);\n>>  typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,\n>>                                    int *do_reply);\n>>  typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);\n>> +typedef bool (*vu_queue_resume_to_used_cb) (VuDev *dev, int qidx);\n>>\n>>  typedef struct VuDevIface {\n>>      /* called by VHOST_USER_GET_FEATURES to get the features bitmask */\n>> @@ -148,6 +149,10 @@ typedef struct VuDevIface {\n>>      vu_process_msg_cb process_msg;\n>>      /* tells when queues can be processed */\n>>      vu_queue_set_started_cb queue_set_started;\n>> +    /* If the queue must be resumed to vring.used->idx. */\n>> +    /* This can help to support resuming on unmanaged exit/crash when\n>> +     * the slave/driver processes elements in order. */\n>> +    vu_queue_resume_to_used_cb queue_resume_to_used;\n>>  } VuDevIface;\n>>\n>>  typedef void (*vu_queue_handler_cb) (VuDev *dev, int qidx);\n>\n> Let's consider: this is only safe if queue is processed in order.\n> So I think that would be a better name for the field.\n>\nThat's what the comment say already :)\n\nWhich name do you suggest? vu_queue_is_processed_in_order? Does that\nimply it should always resume?\n\n>\n>> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c\n>> index 35fa0c5e56..36439caed6 100644\n>> --- a/contrib/libvhost-user/libvhost-user.c\n>> +++ b/contrib/libvhost-user/libvhost-user.c\n>> @@ -521,6 +521,19 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)\n>>\n>>      vq->used_idx = vq->vring.used->idx;\n>>\n>> +    if (vq->last_avail_idx != vq->used_idx) {\n>> +        bool resume = dev->iface->queue_resume_to_used &&\n>> +            dev->iface->queue_resume_to_used(dev, index);\n>> +\n>> +        DPRINT(\"Last avail index != used index: %u != %u%s\\n\",\n>> +               vq->last_avail_idx, vq->used_idx,\n>> +               resume ? \", resuming\" : \"\");\n>> +\n>> +        if (resume) {\n>> +            vq->shadow_avail_idx = vq->last_avail_idx = vq->used_idx;\n>> +        }\n>> +    }\n>> +\n>>      return false;\n>>  }\n>>\n>> --\n>> 2.14.1.146.gd35faa819\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"LvQqCriW\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhX4l1rvnz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 01:05:27 +1000 (AEST)","from localhost ([::1]:45404 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmi4z-0005Oz-6W\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 11:05:25 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39760)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dmi4J-0005NK-Hc\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:04:44 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dmi4D-0008GD-NQ\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:04:43 -0400","from mail-ua0-x243.google.com ([2607:f8b0:400c:c08::243]:38190)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@gmail.com>)\n\tid 1dmi4D-0008FX-IQ\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:04:37 -0400","by mail-ua0-x243.google.com with SMTP id j46so1528885uag.5\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 08:04:36 -0700 (PDT)","by 10.159.51.146 with HTTP; Tue, 29 Aug 2017 08:04:34 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=0B9KMCwFr6gkdLkySrrSUSfyb1Jwphd4MW24HSu6bwA=;\n\tb=LvQqCriWqgcti15BGumKkIndVldhYsKsBojqY5qF+VJahvmi0enO1YUUeQsKuTGxyz\n\tRai2hvmG+Mi1NOzGwIQgzDMEJ6jACniKSOcxefTq1RcrhzdKAxg7bJ97wRx3WrQkIB24\n\t/DX7+QSgxAhpNuKcgY8HR2/Eaxu+f6s5JHb8DffL1lsYeR93FSu3URohk1y9terc1KZg\n\togP4an6wmcljH2TMl/ifciU6+Na2ghYGm/lt0cnh8txqg3Vn2F6LxANRnubbFYMoY+Ot\n\tgznG1ETsD3nDCeNFmXxJdyJ+oV5q95ktImsfolOuZ2HFPGpg6q5iRjoTgiZ/t8XI9Zp9\n\t8ypA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=0B9KMCwFr6gkdLkySrrSUSfyb1Jwphd4MW24HSu6bwA=;\n\tb=bd1t/psPf1s1sBs1lo1kJ/FpzqTDob8Jt7V58CsPjE2BrpxdZ7ZHJ7NVwMwDztnSel\n\tRKG1xeBK3GIVLOWNCzTw20DtQwu4vExGdnmt0yDcH57tSU6uwQswUT3ULlkfhBfDitLW\n\tDOOaFQMEBxg+MjCZ/P8fEOHzWcLW5D0DQdToPVUXPimxAU7Bxv8SeeIWYI0wSUrLsprh\n\t+9ZATSPX0CM2pb219WMZjBDr5Hsr6EiPyp/1L2AgNrvs7OeBYVW95DBTmpZW/Lu6c518\n\tyx25DNtfEesD7DVZZfe64O8YzMCfnXu/ie10npvMEjbRWB/RwsMemweffu/W4zx6ezco\n\tscCQ==","X-Gm-Message-State":"AHYfb5jKhETtVdtoU3+rnp7HCn22H6pm+PZU+lwJITXWZvOfPXCa62Nl\n\tVM+lfx8LGb6+2c0sUOQEzfsEf/xB0Q==","X-Received":"by 10.176.78.157 with SMTP id l29mr404107uah.2.1504019075567;\n\tTue, 29 Aug 2017 08:04:35 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170829175820-mutt-send-email-mst@kernel.org>","References":"<20170829144805.28872-1-marcandre.lureau@redhat.com>\n\t<20170829144805.28872-2-marcandre.lureau@redhat.com>\n\t<20170829175820-mutt-send-email-mst@kernel.org>","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>","Date":"Tue, 29 Aug 2017 17:04:34 +0200","Message-ID":"<CAJ+F1CLYGyJyfNB26iyiaRbf5Pq9HveW_h+rFp_ZFrrvkmATDA@mail.gmail.com>","To":"\"Michael S. Tsirkin\" <mst@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400c:c08::243","Subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Victor Kaplansky <victork@redhat.com>, QEMU <qemu-devel@nongnu.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759435,"web_url":"http://patchwork.ozlabs.org/comment/1759435/","msgid":"<20170829180900-mutt-send-email-mst@kernel.org>","list_archive_url":null,"date":"2017-08-29T15:09:32","subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","submitter":{"id":2235,"url":"http://patchwork.ozlabs.org/api/people/2235/","name":"Michael S. Tsirkin","email":"mst@redhat.com"},"content":"On Tue, Aug 29, 2017 at 05:04:34PM +0200, Marc-André Lureau wrote:\n> Hi\n> \n> On Tue, Aug 29, 2017 at 5:01 PM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> > On Tue, Aug 29, 2017 at 04:48:04PM +0200, Marc-André Lureau wrote:\n> >> This is the same workaround as commit 523b018dde3b765, which was lost\n> >> with libvhost-user transition in commit e10e798c85c2331.\n> >>\n> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> >> ---\n> >>  contrib/libvhost-user/libvhost-user.h |  5 +++++\n> >>  contrib/libvhost-user/libvhost-user.c | 13 +++++++++++++\n> >>  2 files changed, 18 insertions(+)\n> >>\n> >> diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h\n> >> index 53ef222c0b..aca71717c1 100644\n> >> --- a/contrib/libvhost-user/libvhost-user.h\n> >> +++ b/contrib/libvhost-user/libvhost-user.h\n> >> @@ -132,6 +132,7 @@ typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);\n> >>  typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,\n> >>                                    int *do_reply);\n> >>  typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);\n> >> +typedef bool (*vu_queue_resume_to_used_cb) (VuDev *dev, int qidx);\n> >>\n> >>  typedef struct VuDevIface {\n> >>      /* called by VHOST_USER_GET_FEATURES to get the features bitmask */\n> >> @@ -148,6 +149,10 @@ typedef struct VuDevIface {\n> >>      vu_process_msg_cb process_msg;\n> >>      /* tells when queues can be processed */\n> >>      vu_queue_set_started_cb queue_set_started;\n> >> +    /* If the queue must be resumed to vring.used->idx. */\n> >> +    /* This can help to support resuming on unmanaged exit/crash when\n> >> +     * the slave/driver processes elements in order. */\n> >> +    vu_queue_resume_to_used_cb queue_resume_to_used;\n> >>  } VuDevIface;\n> >>\n> >>  typedef void (*vu_queue_handler_cb) (VuDev *dev, int qidx);\n> >\n> > Let's consider: this is only safe if queue is processed in order.\n> > So I think that would be a better name for the field.\n> >\n> That's what the comment say already :)\n> \n> Which name do you suggest? vu_queue_is_processed_in_order?\n\nSomething like this.\n\n> Does that\n> imply it should always resume?\n\nNot sure I understand the question.\n\n> >\n> >> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c\n> >> index 35fa0c5e56..36439caed6 100644\n> >> --- a/contrib/libvhost-user/libvhost-user.c\n> >> +++ b/contrib/libvhost-user/libvhost-user.c\n> >> @@ -521,6 +521,19 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)\n> >>\n> >>      vq->used_idx = vq->vring.used->idx;\n> >>\n> >> +    if (vq->last_avail_idx != vq->used_idx) {\n> >> +        bool resume = dev->iface->queue_resume_to_used &&\n> >> +            dev->iface->queue_resume_to_used(dev, index);\n> >> +\n> >> +        DPRINT(\"Last avail index != used index: %u != %u%s\\n\",\n> >> +               vq->last_avail_idx, vq->used_idx,\n> >> +               resume ? \", resuming\" : \"\");\n> >> +\n> >> +        if (resume) {\n> >> +            vq->shadow_avail_idx = vq->last_avail_idx = vq->used_idx;\n> >> +        }\n> >> +    }\n> >> +\n> >>      return false;\n> >>  }\n> >>\n> >> --\n> >> 2.14.1.146.gd35faa819\n> >\n> \n> \n> \n> -- \n> Marc-André Lureau","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mst@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhXB90Vx0z9t2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 01:10:09 +1000 (AEST)","from localhost ([::1]:45431 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmi9W-0000Bg-VL\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 11:10:06 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41240)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dmi97-0000BP-VF\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:09:42 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dmi93-0002T1-T5\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:09:41 -0400","from mx1.redhat.com ([209.132.183.28]:46506)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mst@redhat.com>) id 1dmi93-0002SI-Jf\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:09:37 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 8E4C861D18;\n\tTue, 29 Aug 2017 15:09:36 +0000 (UTC)","from redhat.com (ovpn-120-128.rdu2.redhat.com [10.10.120.128])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 5508881EDD;\n\tTue, 29 Aug 2017 15:09:33 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 8E4C861D18","Date":"Tue, 29 Aug 2017 18:09:32 +0300","From":"\"Michael S. Tsirkin\" <mst@redhat.com>","To":"=?iso-8859-1?q?Marc-Andr=E9?= Lureau <marcandre.lureau@gmail.com>","Message-ID":"<20170829180900-mutt-send-email-mst@kernel.org>","References":"<20170829144805.28872-1-marcandre.lureau@redhat.com>\n\t<20170829144805.28872-2-marcandre.lureau@redhat.com>\n\t<20170829175820-mutt-send-email-mst@kernel.org>\n\t<CAJ+F1CLYGyJyfNB26iyiaRbf5Pq9HveW_h+rFp_ZFrrvkmATDA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<CAJ+F1CLYGyJyfNB26iyiaRbf5Pq9HveW_h+rFp_ZFrrvkmATDA@mail.gmail.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tTue, 29 Aug 2017 15:09:36 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Victor Kaplansky <victork@redhat.com>, QEMU <qemu-devel@nongnu.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759442,"web_url":"http://patchwork.ozlabs.org/comment/1759442/","msgid":"<CAJ+F1CJ5-s-wqWgiHTNQ_a6AvPkG4RyXy8xbCCQQHsSmhhXpNQ@mail.gmail.com>","list_archive_url":null,"date":"2017-08-29T15:18:11","subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","submitter":{"id":6442,"url":"http://patchwork.ozlabs.org/api/people/6442/","name":"Marc-André Lureau","email":"marcandre.lureau@gmail.com"},"content":"Hi\n\nOn Tue, Aug 29, 2017 at 5:09 PM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> On Tue, Aug 29, 2017 at 05:04:34PM +0200, Marc-André Lureau wrote:\n>> Hi\n>>\n>> On Tue, Aug 29, 2017 at 5:01 PM, Michael S. Tsirkin <mst@redhat.com> wrote:\n>> > On Tue, Aug 29, 2017 at 04:48:04PM +0200, Marc-André Lureau wrote:\n>> >> This is the same workaround as commit 523b018dde3b765, which was lost\n>> >> with libvhost-user transition in commit e10e798c85c2331.\n>> >>\n>> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n>> >> ---\n>> >>  contrib/libvhost-user/libvhost-user.h |  5 +++++\n>> >>  contrib/libvhost-user/libvhost-user.c | 13 +++++++++++++\n>> >>  2 files changed, 18 insertions(+)\n>> >>\n>> >> diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h\n>> >> index 53ef222c0b..aca71717c1 100644\n>> >> --- a/contrib/libvhost-user/libvhost-user.h\n>> >> +++ b/contrib/libvhost-user/libvhost-user.h\n>> >> @@ -132,6 +132,7 @@ typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);\n>> >>  typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,\n>> >>                                    int *do_reply);\n>> >>  typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);\n>> >> +typedef bool (*vu_queue_resume_to_used_cb) (VuDev *dev, int qidx);\n>> >>\n>> >>  typedef struct VuDevIface {\n>> >>      /* called by VHOST_USER_GET_FEATURES to get the features bitmask */\n>> >> @@ -148,6 +149,10 @@ typedef struct VuDevIface {\n>> >>      vu_process_msg_cb process_msg;\n>> >>      /* tells when queues can be processed */\n>> >>      vu_queue_set_started_cb queue_set_started;\n>> >> +    /* If the queue must be resumed to vring.used->idx. */\n>> >> +    /* This can help to support resuming on unmanaged exit/crash when\n>> >> +     * the slave/driver processes elements in order. */\n>> >> +    vu_queue_resume_to_used_cb queue_resume_to_used;\n>> >>  } VuDevIface;\n>> >>\n>> >>  typedef void (*vu_queue_handler_cb) (VuDev *dev, int qidx);\n>> >\n>> > Let's consider: this is only safe if queue is processed in order.\n>> > So I think that would be a better name for the field.\n>> >\n>> That's what the comment say already :)\n>>\n>> Which name do you suggest? vu_queue_is_processed_in_order?\n>\n> Something like this.\n>\n>> Does that\n>> imply it should always resume?\n>\n> Not sure I understand the question.\n\nIf a \"queue_is_processed_in_order\", does that imply libvhost-user\nshould always resume it based on used_idx? I think it does, but the\ncorrelation is less obvious than explicitly saying \"resume_to_used\".","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"bq22w3gg\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhXN238KKz9t38\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 01:18:39 +1000 (AEST)","from localhost ([::1]:45463 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmiHj-00030K-9Y\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 11:18:35 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43269)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dmiHO-00030D-69\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:18:15 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dmiHN-0006HZ-6Q\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:18:14 -0400","from mail-vk0-x241.google.com ([2607:f8b0:400c:c05::241]:37638)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@gmail.com>)\n\tid 1dmiHN-0006HR-0Z\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:18:13 -0400","by mail-vk0-x241.google.com with SMTP id z187so1436693vkd.4\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 08:18:12 -0700 (PDT)","by 10.159.51.146 with HTTP; Tue, 29 Aug 2017 08:18:11 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=SRMRV7YZSyxHHnl5b6TdZBGowX0YtjsyY7ipkWqi4pU=;\n\tb=bq22w3ggeinfxBXWXT7ykcsYEZ6Pzu7/G4gWAF98R1fS/Y3aap8Ta8tNYWtFe62FGr\n\tUwnpX7XwEjZs5uLjBBSls1pu5qFVjaBS0H8ZskNuU3RkYws4kjZp1OmZZKh/lgClZyEE\n\tGFyImAdebhnKTla3/Djd/q6mMyMpuqBRpbMhcXCI4P1W7qqKnOJancQTwHJEVhHfYsBL\n\t4Zpd+mBcfO4Y/FmgmWx6Tf+dQGYVP4kLPoJRdqscdKBeiUKqP9GGc+w91I/ah8PfpRPf\n\thFFmxuCE6WU5PJK3dBoRZkrQAwLAbGHiHP1Zc24xMLpCzPHkXfxPLdpmv2sNrmQ6atfY\n\trsAA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=SRMRV7YZSyxHHnl5b6TdZBGowX0YtjsyY7ipkWqi4pU=;\n\tb=DR1Wbb/AZH0AuOlsKLIA3qCCgUXIv0dw6ZaLk3wtkK4QasHt9PQadvylCrE4oKlbRF\n\tcnfW2DtS2NA41QDTx/JOmthCrNICBV+Qt9DGLjEd4lrO01P/pkizpo6LHMt1NJaU1WmC\n\td7AZuXiTFAogtkPylTBc9wbsdFLgsVoCM8uzyyB/r9m4Qogj1XxuExhcr7bwIHsrclZg\n\tK9qsYiCIEoJN/L9gU1JFg4xAfglz/4QpycbY6q8boBeJWI+O5EQZvnjZrzMVqq0OaJ1A\n\tS2D8VbXk+zZ72dZnsktxudpByc5Ytgd8FWLzP4lFcWLFAVOLg6JgXrqR2vY40PU7e9iQ\n\teCyw==","X-Gm-Message-State":"AHYfb5hghyBsl59ZR2Z34Mkeq7Fre2pu4LwoUmgiX1kp0gDgeEEOP61/\n\tTASwFzgqG9nmRtNRKDFlxu2axd4woQ==","X-Received":"by 10.31.213.131 with SMTP id m125mr456824vkg.50.1504019892362; \n\tTue, 29 Aug 2017 08:18:12 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170829180900-mutt-send-email-mst@kernel.org>","References":"<20170829144805.28872-1-marcandre.lureau@redhat.com>\n\t<20170829144805.28872-2-marcandre.lureau@redhat.com>\n\t<20170829175820-mutt-send-email-mst@kernel.org>\n\t<CAJ+F1CLYGyJyfNB26iyiaRbf5Pq9HveW_h+rFp_ZFrrvkmATDA@mail.gmail.com>\n\t<20170829180900-mutt-send-email-mst@kernel.org>","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>","Date":"Tue, 29 Aug 2017 17:18:11 +0200","Message-ID":"<CAJ+F1CJ5-s-wqWgiHTNQ_a6AvPkG4RyXy8xbCCQQHsSmhhXpNQ@mail.gmail.com>","To":"\"Michael S. Tsirkin\" <mst@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400c:c05::241","Subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Victor Kaplansky <victork@redhat.com>, QEMU <qemu-devel@nongnu.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759445,"web_url":"http://patchwork.ozlabs.org/comment/1759445/","msgid":"<20170829181921-mutt-send-email-mst@kernel.org>","list_archive_url":null,"date":"2017-08-29T15:20:05","subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","submitter":{"id":2235,"url":"http://patchwork.ozlabs.org/api/people/2235/","name":"Michael S. Tsirkin","email":"mst@redhat.com"},"content":"On Tue, Aug 29, 2017 at 05:18:11PM +0200, Marc-André Lureau wrote:\n> Hi\n> \n> On Tue, Aug 29, 2017 at 5:09 PM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> > On Tue, Aug 29, 2017 at 05:04:34PM +0200, Marc-André Lureau wrote:\n> >> Hi\n> >>\n> >> On Tue, Aug 29, 2017 at 5:01 PM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> >> > On Tue, Aug 29, 2017 at 04:48:04PM +0200, Marc-André Lureau wrote:\n> >> >> This is the same workaround as commit 523b018dde3b765, which was lost\n> >> >> with libvhost-user transition in commit e10e798c85c2331.\n> >> >>\n> >> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> >> >> ---\n> >> >>  contrib/libvhost-user/libvhost-user.h |  5 +++++\n> >> >>  contrib/libvhost-user/libvhost-user.c | 13 +++++++++++++\n> >> >>  2 files changed, 18 insertions(+)\n> >> >>\n> >> >> diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h\n> >> >> index 53ef222c0b..aca71717c1 100644\n> >> >> --- a/contrib/libvhost-user/libvhost-user.h\n> >> >> +++ b/contrib/libvhost-user/libvhost-user.h\n> >> >> @@ -132,6 +132,7 @@ typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);\n> >> >>  typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,\n> >> >>                                    int *do_reply);\n> >> >>  typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);\n> >> >> +typedef bool (*vu_queue_resume_to_used_cb) (VuDev *dev, int qidx);\n> >> >>\n> >> >>  typedef struct VuDevIface {\n> >> >>      /* called by VHOST_USER_GET_FEATURES to get the features bitmask */\n> >> >> @@ -148,6 +149,10 @@ typedef struct VuDevIface {\n> >> >>      vu_process_msg_cb process_msg;\n> >> >>      /* tells when queues can be processed */\n> >> >>      vu_queue_set_started_cb queue_set_started;\n> >> >> +    /* If the queue must be resumed to vring.used->idx. */\n> >> >> +    /* This can help to support resuming on unmanaged exit/crash when\n> >> >> +     * the slave/driver processes elements in order. */\n> >> >> +    vu_queue_resume_to_used_cb queue_resume_to_used;\n> >> >>  } VuDevIface;\n> >> >>\n> >> >>  typedef void (*vu_queue_handler_cb) (VuDev *dev, int qidx);\n> >> >\n> >> > Let's consider: this is only safe if queue is processed in order.\n> >> > So I think that would be a better name for the field.\n> >> >\n> >> That's what the comment say already :)\n> >>\n> >> Which name do you suggest? vu_queue_is_processed_in_order?\n> >\n> > Something like this.\n> >\n> >> Does that\n> >> imply it should always resume?\n> >\n> > Not sure I understand the question.\n> \n> If a \"queue_is_processed_in_order\", does that imply libvhost-user\n> should always resume it based on used_idx? I think it does, but the\n> correlation is less obvious than explicitly saying \"resume_to_used\".\n\nJust add a comment then. You do not want low level details\nlike used index in all backends.\n\n\n> \n> -- \n> Marc-André Lureau","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mst@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhXQZ1fk0z9t2x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 01:20:54 +1000 (AEST)","from localhost ([::1]:45470 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmiJw-0003oq-4g\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 11:20:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43720)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dmiJN-0003l2-O4\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:20:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dmiJK-0006zL-J3\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:20:17 -0400","from mx1.redhat.com ([209.132.183.28]:52684)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mst@redhat.com>) id 1dmiJK-0006yw-9N\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:20:14 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 09B676146C;\n\tTue, 29 Aug 2017 15:20:13 +0000 (UTC)","from redhat.com (ovpn-120-128.rdu2.redhat.com [10.10.120.128])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 6B98677EFD;\n\tTue, 29 Aug 2017 15:20:05 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 09B676146C","Date":"Tue, 29 Aug 2017 18:20:05 +0300","From":"\"Michael S. Tsirkin\" <mst@redhat.com>","To":"=?iso-8859-1?q?Marc-Andr=E9?= Lureau <marcandre.lureau@gmail.com>","Message-ID":"<20170829181921-mutt-send-email-mst@kernel.org>","References":"<20170829144805.28872-1-marcandre.lureau@redhat.com>\n\t<20170829144805.28872-2-marcandre.lureau@redhat.com>\n\t<20170829175820-mutt-send-email-mst@kernel.org>\n\t<CAJ+F1CLYGyJyfNB26iyiaRbf5Pq9HveW_h+rFp_ZFrrvkmATDA@mail.gmail.com>\n\t<20170829180900-mutt-send-email-mst@kernel.org>\n\t<CAJ+F1CJ5-s-wqWgiHTNQ_a6AvPkG4RyXy8xbCCQQHsSmhhXpNQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<CAJ+F1CJ5-s-wqWgiHTNQ_a6AvPkG4RyXy8xbCCQQHsSmhhXpNQ@mail.gmail.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tTue, 29 Aug 2017 15:20:13 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/2] libvhost-user: support resuming\n\tvq->last_avail_idx based on used_idx","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Victor Kaplansky <victork@redhat.com>, QEMU <qemu-devel@nongnu.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]