From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
bill.mills@linaro.org, edgar.iglesias@amd.com
Subject: Re: [PATCH v1 1/5] virtio: Introduce notify_queue
Date: Wed, 05 Nov 2025 12:38:11 +0000 [thread overview]
Message-ID: <87bjlgvemk.fsf@draig.linaro.org> (raw)
In-Reply-To: <20251028152351.1247812-2-edgar.iglesias@gmail.com> (Edgar E. Iglesias's message of "Tue, 28 Oct 2025 16:23:46 +0100")
"Edgar E. Iglesias" <edgar.iglesias@gmail.com> writes:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
> hw/virtio/virtio.c | 7 +++++++
> include/hw/virtio/virtio-bus.h | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 153ee0a0cf..8a53fb5f93 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2700,12 +2700,19 @@ static void virtio_irq(VirtQueue *vq)
>
> void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
> {
> + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
> + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
> +
> WITH_RCU_READ_LOCK_GUARD() {
> if (!virtio_should_notify(vdev, vq)) {
> return;
> }
> }
>
> + if (k->notify_queue) {
> + k->notify_queue(qbus->parent, virtio_get_queue_index(vq));
> + }
> +
> trace_virtio_notify(vdev, vq);
> virtio_irq(vq);
> }
> diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
> index 7ab8c9dab0..043dbeb4cf 100644
> --- a/include/hw/virtio/virtio-bus.h
> +++ b/include/hw/virtio/virtio-bus.h
> @@ -39,6 +39,7 @@ DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass,
> struct VirtioBusClass {
> /* This is what a VirtioBus must implement */
> BusClass parent;
> + void (*notify_queue)(DeviceState *d, uint16_t index);
> void (*notify)(DeviceState *d, uint16_t vector);
> void (*save_config)(DeviceState *d, QEMUFile *f);
> void (*save_queue)(DeviceState *d, int n, QEMUFile *f);
The code looks fine but we could do with a little outline of why we need
this is the commit messages. Why do we have notify and notify_queue? Are
they mutually exclusive?
Not specific to this patch but we should strive to document the
individual methods in each class to give a clearer idea of what they do.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2025-11-05 12:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 15:23 [PATCH v1 0/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 1/5] virtio: Introduce notify_queue Edgar E. Iglesias
2025-11-05 12:38 ` Alex Bennée [this message]
2025-11-13 20:43 ` Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 2/5] virtio: Add virtio_queue_get_rings Edgar E. Iglesias
2025-11-05 12:39 ` Alex Bennée
2025-10-28 15:23 ` [PATCH v1 3/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 4/5] hw/misc: Add generic virtio-msg AMP PCI device Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 5/5] docs: Describe virtio-msg-amp-pci Edgar E. Iglesias
2025-11-05 19:52 ` Alex Bennée
2025-10-28 15:30 ` [PATCH v1 0/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2026-02-03 13:22 ` Michael S. Tsirkin
2026-02-03 17:09 ` Edgar E. Iglesias
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=87bjlgvemk.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=bill.mills@linaro.org \
--cc=edgar.iglesias@amd.com \
--cc=edgar.iglesias@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 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.