qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Kangjie Xu <kangjie.xu@linux.alibaba.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, hengqi@linux.alibaba.com, xuanzhuo@linux.alibaba.com
Subject: Re: [PATCH 13/16] virtio: introduce queue_enable in virtio
Date: Tue, 26 Jul 2022 12:17:50 +0800	[thread overview]
Message-ID: <9211abdb-cf8c-f24f-7947-5f1cf23d1ae6@redhat.com> (raw)
In-Reply-To: <a7a06e68bde2cf8c57fbf2c95b095b9f86eb527f.1658141552.git.kangjie.xu@linux.alibaba.com>


在 2022/7/18 19:17, Kangjie Xu 写道:
> Introduce the interface queue_enable() in VirtioDeviceClass and the
> fucntion virtio_queue_enable() in virtio, it can be called when
> VIRTIO_PCI_COMMON_Q_ENABLE is written.


I'd suggest to split this series into two.

1) queue_enable

2) queue_reset

The patch looks good to me.

Thanks


>
> Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> ---
>   hw/virtio/virtio-pci.c     | 1 +
>   hw/virtio/virtio.c         | 9 +++++++++
>   include/hw/virtio/virtio.h | 2 ++
>   3 files changed, 12 insertions(+)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 35e8a5101a..85e1840479 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1335,6 +1335,7 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
>                          proxy->vqs[vdev->queue_sel].avail[0],
>                          ((uint64_t)proxy->vqs[vdev->queue_sel].used[1]) << 32 |
>                          proxy->vqs[vdev->queue_sel].used[0]);
> +            virtio_queue_enable(vdev, vdev->queue_sel);
>               proxy->vqs[vdev->queue_sel].enabled = 1;
>               proxy->vqs[vdev->queue_sel].reset = 0;
>           } else {
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 0e9d41366f..82eb9dd4f2 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2050,6 +2050,15 @@ void virtio_queue_reset(VirtIODevice *vdev, uint32_t queue_index)
>       __virtio_queue_reset(vdev, queue_index);
>   }
>   
> +void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index)
> +{
> +    VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
> +
> +    if (k->queue_enable) {
> +        k->queue_enable(vdev, queue_index);
> +    }
> +}
> +
>   void virtio_reset(void *opaque)
>   {
>       VirtIODevice *vdev = opaque;
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index 879394299b..085997d8f3 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -131,6 +131,7 @@ struct VirtioDeviceClass {
>       void (*reset)(VirtIODevice *vdev);
>       void (*set_status)(VirtIODevice *vdev, uint8_t val);
>       void (*queue_reset)(VirtIODevice *vdev, uint32_t queue_index);
> +    void (*queue_enable)(VirtIODevice *vdev, uint32_t queue_index);
>       /* For transitional devices, this is a bitmap of features
>        * that are only exposed on the legacy interface but not
>        * the modern one.
> @@ -270,6 +271,7 @@ int virtio_queue_set_host_notifier_mr(VirtIODevice *vdev, int n,
>   int virtio_set_status(VirtIODevice *vdev, uint8_t val);
>   void virtio_reset(void *opaque);
>   void virtio_queue_reset(VirtIODevice *vdev, uint32_t queue_index);
> +void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index);
>   void virtio_update_irq(VirtIODevice *vdev);
>   int virtio_set_features(VirtIODevice *vdev, uint64_t val);
>   



  reply	other threads:[~2022-07-26  4:19 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 11:16 [PATCH 00/16] Support VIRTIO_F_RING_RESET for virtio-net and vhost-user in virtio pci Kangjie Xu
2022-07-18 11:16 ` [PATCH 01/16] virtio-pci: virtio_pci_common_cfg add queue_notify_data Kangjie Xu
2022-07-26  3:17   ` Jason Wang
2022-07-26  6:16     ` Kangjie Xu
2022-07-18 11:16 ` [PATCH 02/16] virtio: add VIRTIO_F_RING_RESET Kangjie Xu
2022-07-18 11:17 ` [PATCH 03/16] virtio: pci: virtio_pci_common_cfg add queue_reset Kangjie Xu
2022-07-18 11:17 ` [PATCH 04/16] virtio: introduce __virtio_queue_reset() Kangjie Xu
2022-07-26  3:20   ` Jason Wang
2022-07-18 11:17 ` [PATCH 05/16] virtio: introduce virtio_queue_reset() Kangjie Xu
2022-07-26  3:21   ` Jason Wang
2022-07-18 11:17 ` [PATCH 06/16] virtio-pci: support queue reset Kangjie Xu
2022-07-26  3:31   ` Jason Wang
2022-07-18 11:17 ` [PATCH 07/16] virtio-net: " Kangjie Xu
2022-07-26  3:43   ` Jason Wang
2022-07-26  7:01     ` Kangjie Xu
2022-07-27  5:00       ` Jason Wang
2022-07-27  6:23         ` Kangjie Xu
2022-07-27  6:59           ` Jason Wang
2022-07-27  7:12             ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 08/16] vhost: add op to enable or disable a single vring Kangjie Xu
2022-07-26  3:49   ` Jason Wang
2022-07-26  6:39     ` Kangjie Xu
2022-07-27  4:55       ` Jason Wang
2022-07-27  7:05         ` Kangjie Xu
2022-07-28  2:41           ` Jason Wang
2022-07-29  1:51             ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 09/16] vhost-user: enable/disable " Kangjie Xu
2022-07-26  4:07   ` Jason Wang
2022-07-26  5:27     ` Kangjie Xu
2022-07-27  4:51       ` Jason Wang
2022-07-27  6:44         ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 10/16] vhost: extract the logic of unmapping the vrings and desc Kangjie Xu
2022-07-26  4:07   ` Jason Wang
2022-07-18 11:17 ` [PATCH 11/16] vhost: introduce restart and release for vhost_dev's vqs Kangjie Xu
2022-07-26  4:13   ` Jason Wang
2022-07-26  6:15     ` Kangjie Xu
     [not found]     ` <f28d29ac-f244-a523-ed78-84c438d13340@linux.alibaba.com>
     [not found]       ` <CACGkMEtxXSm8Qc1LpKJJYm9cQ-F+eU5Lqecr62maRPxq1tM5rg@mail.gmail.com>
2022-07-27  8:23         ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 12/16] vhost-net: introduce restart and stop for vhost_net's vqs Kangjie Xu
2022-07-26  4:16   ` Jason Wang
2022-07-26  6:11     ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 13/16] virtio: introduce queue_enable in virtio Kangjie Xu
2022-07-26  4:17   ` Jason Wang [this message]
2022-07-26  6:19     ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 14/16] virtio-net: support queue_enable for vhost-user Kangjie Xu
2022-07-26  4:25   ` Jason Wang
2022-07-26  6:54     ` Kangjie Xu
2022-07-27  4:58       ` Jason Wang
2022-07-18 11:17 ` [PATCH 15/16] virtio-net: support queue_reset " Kangjie Xu
2022-07-18 11:17 ` [PATCH 16/16] vhost-net: vq reset feature bit support Kangjie Xu
2022-07-26  4:28   ` Jason Wang
2022-07-26  6:24     ` Kangjie Xu
2022-07-27  4:53       ` Jason Wang
2022-07-27  6:48         ` Kangjie Xu
2022-07-25  2:34 ` [PATCH 00/16] Support VIRTIO_F_RING_RESET for virtio-net and vhost-user in virtio pci Kangjie Xu
2022-07-25  3:29   ` Jason Wang

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=9211abdb-cf8c-f24f-7947-5f1cf23d1ae6@redhat.com \
    --to=jasowang@redhat.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=kangjie.xu@linux.alibaba.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xuanzhuo@linux.alibaba.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).