qemu-stable
[Top][All Lists]
Advanced

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

Thanks! Reply: [PATCH]vdpa-dev: Fix the issue of device status not updat


From: Gavin Liu
Subject: Thanks! Reply: [PATCH]vdpa-dev: Fix the issue of device status not updating when configuration interruption is triggered
Date: Sun, 7 Apr 2024 05:33:16 +0000

Thanks

----- Original Message -----
From: Jason Wang jasowang@redhat.com
Sent: April 7, 2024 11:46 AM
To: Gavin Liu gavin.liu@jaguarmicro.com
Cc: eperezma@redhat.com; sgarzare@redhat.com; mst@redhat.com; 
qemu-stable@nongnu.org; qemu-devel@nongnu.org; kwolf@redhat.com
Subject: Re: [PATCH] vdpa-dev: Fix the issue of device status not updating when 
configuration interruption is triggered
External Mail: This email originated from OUTSIDE of the organization!
Do not click links, open attachments or provide ANY information unless you 
recognize the sender and know the content is safe.


On Sun, Apr 7, 2024 at 11:22 AM lyx634449800 <yuxue.liu@jaguarmicro.com> wrote:
>
> The set_config callback function vhost_vdpa_device_get_config in 
> vdpa-dev does not fetch the current device status from the hardware 
> device, causing the GUEST OS to not receive the latest device status

nit: no need for upper case here.

> information.
>
> The hardware updates the config status of the vdpa device and then 
> notifies the OS. The GUEST OS receives an interrupt notification, 
> triggering a get_config access in the kernel, which then enters qemu 
> internally. Ultimately, the vhost_vdpa_device_get_config function of 
> vdpa-dev is called
>
> One scenario encountered is when the device needs to bring down the 
> vdpa net device. After modifying the status field of virtio_net_config 
> in the hardware, it sends an interrupt notification. However, the 
> guest OS always receives the STATUS field as VIRTIO_NET_S_LINK_UP.
>
> Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>

This aligns with the vhost-net support for vDPA.

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

Thanks

> ---
>  hw/virtio/vdpa-dev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index 
> 13e87f06f6..64b96b226c 100644
> --- a/hw/virtio/vdpa-dev.c
> +++ b/hw/virtio/vdpa-dev.c
> @@ -195,7 +195,14 @@ static void
>  vhost_vdpa_device_get_config(VirtIODevice *vdev, uint8_t *config)  {
>      VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
> +    int ret;
>
> +    ret = vhost_dev_get_config(&s->dev, s->config, s->config_size,
> +                            NULL);
> +    if (ret < 0) {
> +        error_report("get device config space failed");
> +        return;
> +    }
>      memcpy(config, s->config, s->config_size);
>  }
>
> --
> 2.43.0
>


reply via email to

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