qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow v


From: Eugenio Perez Martin
Subject: Re: [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow vq
Date: Sat, 26 Feb 2022 12:12:21 +0100

On Sat, Feb 26, 2022 at 10:31 AM Liuxiangdong <liuxiangdong5@huawei.com> wrote:
>
> Hi, Eugenio.
>
> diff --git a/hw/virtio/vhost-shadow-virtqueue.c
> b/hw/virtio/vhost-shadow-virtqueue.c
> index 9619c8082c..51442b3dbf 100644
> --- a/hw/virtio/vhost-shadow-virtqueue.c
> +++ b/hw/virtio/vhost-shadow-virtqueue.c
> @@ -45,6 +45,50 @@ const EventNotifier *vhost_svq_get_dev_kick_notifier(
>       return &svq->hdev_kick;
>   }
>
> +/**
> + * Validate the transport device features that SVQ can use with the device
> + *
> + * @dev_features  The device features. If success, the acknowledged
> features.
> + *
> + * Returns true if SVQ can go with a subset of these, false otherwise.
> + */
> +bool vhost_svq_valid_device_features(uint64_t *dev_features)
> +{
> +    bool r = true;
> +
> +    for (uint64_t b = VIRTIO_TRANSPORT_F_START; b <=
> VIRTIO_TRANSPORT_F_END;
> +         ++b) {
> +        switch (b) {
> +        case VIRTIO_F_NOTIFY_ON_EMPTY:
> +        case VIRTIO_F_ANY_LAYOUT:
> +            continue;
>
>
>
> #define VIRTIO_TRANSPORT_F_START    28
> #define VIRTIO_TRANSPORT_F_END        38
>
> #define VIRTIO_F_NOTIFY_ON_EMPTY    24
>
> This case (VIRTIO_F_NOTIFY_ON_EMPTY) may be useless.
>

Hi Xiangdong Liu,

You're right, it's out of the range so it does not make any sense to
check for it. I will delete it in the next version, thank you very
much!

>
> Thanks.
> Xiangdong Liu
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]