From: Jason Wang <jasowang@redhat.com>
To: Viktor Prutyanov <viktor@daynix.com>
Cc: mst@redhat.com, cohuck@redhat.com, pasic@linux.ibm.com,
farman@linux.ibm.com, linux-s390@vger.kernel.org,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, yan@daynix.com
Subject: Re: [PATCH v2] virtio: add VIRTIO_F_NOTIFICATION_DATA feature support
Date: Tue, 21 Mar 2023 10:29:11 +0800 [thread overview]
Message-ID: <CACGkMEu5qa2KUHti3w59DcXNxBdh8_ogZ9oW9bo1_PHwbNiCBg@mail.gmail.com> (raw)
In-Reply-To: <20230320232115.1940587-1-viktor@daynix.com>
On Tue, Mar 21, 2023 at 7:21 AM Viktor Prutyanov <viktor@daynix.com> wrote:
>
> According to VirtIO spec v1.2, VIRTIO_F_NOTIFICATION_DATA feature
> indicates that the driver passes extra data along with the queue
> notifications.
>
> In a split queue case, the extra data is 16-bit available index. In a
> packed queue case, the extra data is 1-bit wrap counter and 15-bit
> available index.
>
> Add support for this feature for MMIO and PCI transports. Channel I/O
> transport will not accept this feature.
>
> Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
> ---
>
> v2: reject the feature in virtio_ccw, replace __le32 with u32
>
> drivers/s390/virtio/virtio_ccw.c | 4 +---
> drivers/virtio/virtio_mmio.c | 15 ++++++++++++++-
> drivers/virtio/virtio_pci_common.c | 10 ++++++++++
> drivers/virtio/virtio_pci_common.h | 4 ++++
> drivers/virtio/virtio_pci_legacy.c | 2 +-
> drivers/virtio/virtio_pci_modern.c | 2 +-
> drivers/virtio/virtio_ring.c | 17 +++++++++++++++++
> include/linux/virtio_ring.h | 2 ++
> include/uapi/linux/virtio_config.h | 6 ++++++
> 9 files changed, 56 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
> index a10dbe632ef9..d72a59415527 100644
> --- a/drivers/s390/virtio/virtio_ccw.c
> +++ b/drivers/s390/virtio/virtio_ccw.c
> @@ -789,9 +789,7 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
>
> static void ccw_transport_features(struct virtio_device *vdev)
> {
> - /*
> - * Currently nothing to do here.
> - */
> + __virtio_clear_bit(vdev, VIRTIO_F_NOTIFICATION_DATA);
Is there any restriction that prevents us from implementing
VIRTIO_F_NOTIFICATION_DATA? (Spec seems doesn't limit us from this)
> }
>
> static int virtio_ccw_finalize_features(struct virtio_device *vdev)
> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> index 3ff746e3f24a..0e13da17fe0a 100644
> --- a/drivers/virtio/virtio_mmio.c
> +++ b/drivers/virtio/virtio_mmio.c
> @@ -285,6 +285,19 @@ static bool vm_notify(struct virtqueue *vq)
> return true;
> }
>
> +static bool vm_notify_with_data(struct virtqueue *vq)
> +{
> + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
> + u32 data = vring_fill_notification_data(vq);
Can we move this to the initialization?
Thanks
next prev parent reply other threads:[~2023-03-21 2:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 23:21 [PATCH v2] virtio: add VIRTIO_F_NOTIFICATION_DATA feature support Viktor Prutyanov
2023-03-21 2:29 ` Jason Wang [this message]
2023-03-21 7:13 ` Michael S. Tsirkin
2023-03-21 9:00 ` Viktor Prutyanov
2023-03-21 9:07 ` Michael S. Tsirkin
2023-03-21 13:10 ` Cornelia Huck
2023-03-21 9:23 ` Michael S. Tsirkin
2023-03-21 11:49 ` Viktor Prutyanov
2023-03-21 12:21 ` Michael S. Tsirkin
2023-03-21 9:27 ` Michael S. Tsirkin
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=CACGkMEu5qa2KUHti3w59DcXNxBdh8_ogZ9oW9bo1_PHwbNiCBg@mail.gmail.com \
--to=jasowang@redhat.com \
--cc=cohuck@redhat.com \
--cc=farman@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=viktor@daynix.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=yan@daynix.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).