qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Albert Esteve <aesteve@redhat.com>, qemu-devel@nongnu.org
Cc: Fam Zheng <fam@euphon.net>, "Michael S. Tsirkin" <mst@redhat.com>,
	cohuck@redhat.com, kraxel@redhat.com, marcandre.lureau@gmail.com
Subject: Re: [PATCH v6 3/3] vhost-user: add shared_object msg
Date: Wed, 6 Sep 2023 16:27:20 +0200	[thread overview]
Message-ID: <9d5377ba-c987-dce3-2813-d9c98f162d3f@linaro.org> (raw)
In-Reply-To: <20230906111549.357178-4-aesteve@redhat.com>

Hi Albert,

On 6/9/23 13:15, Albert Esteve wrote:
> Add three new vhost-user protocol
> `VHOST_USER_BACKEND_SHARED_OBJECT_* messages`.
> These new messages are sent from vhost-user
> back-ends to interact with the virtio-dmabuf
> table in order to add or remove themselves as
> virtio exporters, or lookup for virtio dma-buf
> shared objects.
> 
> The action taken in the front-end depends
> on the type stored in the virtio shared
> object hash table.
> 
> When the table holds a pointer to a vhost
> backend for a given UUID, the front-end sends
> a VHOST_USER_GET_SHARED_OBJECT to the
> backend holding the shared object.
> 
> In the libvhost-user library we need to add
> helper functions to allow sending messages to
> interact with the virtio shared objects
> hash table.
> 
> The messages can only be sent after successfully
> negotiating a new VHOST_USER_PROTOCOL_F_SHARED_OBJECT
> vhost-user protocol feature bit.
> 
> Finally, refactor code to send response message so
> that all common parts both for the common REPLY_ACK
> case, and other data responses, can call it and
> avoid code repetition.
> 
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
>   docs/interop/vhost-user.rst               |  57 +++++++
>   hw/virtio/vhost-user.c                    | 174 ++++++++++++++++++++--
>   include/hw/virtio/vhost-backend.h         |   3 +
>   subprojects/libvhost-user/libvhost-user.c | 118 +++++++++++++++
>   subprojects/libvhost-user/libvhost-user.h |  55 ++++++-
>   5 files changed, 393 insertions(+), 14 deletions(-)

Almost 400 lines of changes is too much for me to review in a
single patch. Looking at the names, can't we split virtio VS
libvhost-user?

> +static bool vhost_user_send_resp(QIOChannel *ioc, VhostUserHeader *hdr,
> +                                 VhostUserPayload *payload)
> +{
> +    Error *local_err = NULL;
> +    struct iovec iov[] = {
> +        { .iov_base = hdr,      .iov_len = VHOST_USER_HDR_SIZE },
> +        { .iov_base = payload,  .iov_len = hdr->size },
> +    };
> +
> +    hdr->flags &= ~VHOST_USER_NEED_REPLY_MASK;
> +    hdr->flags |= VHOST_USER_REPLY_MASK;
> +
> +    if (qio_channel_writev_all(ioc, iov, ARRAY_SIZE(iov), &local_err)) {
> +        error_report_err(local_err);
> +        return false;
> +    }
> +
> +    return true;
> +}

I note you  ignored my comment regarding adding a 'Error **' argument in
the previous version:
https://lore.kernel.org/qemu-devel/911eef0c-d04f-2fcf-e78b-2475cd7af8f0@linaro.org/


  reply	other threads:[~2023-09-06 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 11:15 [PATCH v6 0/3] Virtio shared dma-buf Albert Esteve
2023-09-06 11:15 ` [PATCH v6 1/3] uuid: add a hash function Albert Esteve
2023-09-06 11:15 ` [PATCH v6 2/3] virtio-dmabuf: introduce virtio-dmabuf Albert Esteve
2023-09-06 12:03   ` Albert Esteve
2023-09-06 14:21   ` Philippe Mathieu-Daudé
2023-09-06 15:34     ` Albert Esteve
2023-09-06 11:15 ` [PATCH v6 3/3] vhost-user: add shared_object msg Albert Esteve
2023-09-06 14:27   ` Philippe Mathieu-Daudé [this message]
2023-09-06 14:33     ` Albert Esteve
2023-09-06 14:43       ` Philippe Mathieu-Daudé
2023-09-06 16:01         ` Albert Esteve
2023-09-06 16:18           ` Albert Esteve
2023-09-07  6:19             ` Philippe Mathieu-Daudé

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=9d5377ba-c987-dce3-2813-d9c98f162d3f@linaro.org \
    --to=philmd@linaro.org \
    --cc=aesteve@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=fam@euphon.net \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).