qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Hawkins Jiawei <yin31149@gmail.com>
Cc: eperezma@redhat.com, 18801353760@163.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/2] vdpa: rename vhost_vdpa_net_cvq_add()
Date: Wed, 17 May 2023 12:12:30 +0800	[thread overview]
Message-ID: <CACGkMEttwMJ6J6LegqYg-yobWbXnFvmVTCBFXKv40=AZ2Ov6fw@mail.gmail.com> (raw)
In-Reply-To: <fbaa1630a3cf8d08c59c2e273d53f055da8292b3.1683371965.git.yin31149@gmail.com>

On Sat, May 6, 2023 at 10:07 PM Hawkins Jiawei <yin31149@gmail.com> wrote:
>
> We want to introduce a new version of vhost_vdpa_net_cvq_add() that
> does not poll immediately after forwarding custom buffers
> to the device, so that QEMU can send all the SVQ control commands
> in parallel instead of serialized.
>
> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
> ---
>  net/vhost-vdpa.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 99904a0da7..10804c7200 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -590,8 +590,14 @@ static void vhost_vdpa_net_cvq_stop(NetClientState *nc)
>      vhost_vdpa_net_client_stop(nc);
>  }
>
> -static ssize_t vhost_vdpa_net_cvq_add(VhostVDPAState *s, size_t out_len,
> -                                      size_t in_len)
> +/**
> + * vhost_vdpa_net_cvq_add_and_wait() adds SVQ control commands to SVQ,
> + * kicks the device and polls the device used buffers.
> + *
> + * Return the length written by the device.
> + */
> +static ssize_t vhost_vdpa_net_cvq_add_and_wait(VhostVDPAState *s,

Nit: is it better to use "poll" or "sync" other than wait?

Other than this:

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> +                                    size_t out_len, size_t in_len)
>  {
>      /* Buffers for the device */
>      const struct iovec out = {
> @@ -636,7 +642,7 @@ static ssize_t vhost_vdpa_net_load_cmd(VhostVDPAState *s, uint8_t class,
>      memcpy(s->cvq_cmd_out_buffer, &ctrl, sizeof(ctrl));
>      memcpy(s->cvq_cmd_out_buffer + sizeof(ctrl), data, data_size);
>
> -    return vhost_vdpa_net_cvq_add(s, sizeof(ctrl) + data_size,
> +    return vhost_vdpa_net_cvq_add_and_wait(s, sizeof(ctrl) + data_size,
>                                    sizeof(virtio_net_ctrl_ack));
>  }
>
> @@ -753,7 +759,8 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
>          dev_written = sizeof(status);
>          *s->status = VIRTIO_NET_OK;
>      } else {
> -        dev_written = vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status));
> +        dev_written = vhost_vdpa_net_cvq_add_and_wait(s, out.iov_len,
> +                                                      sizeof(status));
>          if (unlikely(dev_written < 0)) {
>              goto out;
>          }
> --
> 2.25.1
>



  reply	other threads:[~2023-05-17  4:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-06 14:06 [PATCH v2 0/2] Send all the SVQ control commands in parallel Hawkins Jiawei
2023-05-06 14:06 ` [PATCH v2 1/2] vdpa: rename vhost_vdpa_net_cvq_add() Hawkins Jiawei
2023-05-17  4:12   ` Jason Wang [this message]
2023-05-17 15:11     ` Hawkins Jiawei
2023-05-06 14:06 ` [PATCH v2 2/2] vdpa: send CVQ state load commands in parallel Hawkins Jiawei
2023-05-17  5:22   ` Jason Wang
2023-05-17  8:21     ` Eugenio Perez Martin
2023-05-17 15:01       ` Hawkins Jiawei
2023-05-18  5:46         ` Jason Wang
2023-05-18  6:00           ` Eugenio Perez Martin
2023-05-18  6:12             ` Jason Wang
2023-05-18  6:54               ` Hawkins Jiawei

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='CACGkMEttwMJ6J6LegqYg-yobWbXnFvmVTCBFXKv40=AZ2Ov6fw@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=18801353760@163.com \
    --cc=eperezma@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yin31149@gmail.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 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).