[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 7/8] vhost_net: return VIRTIO_NET_S_ANNOUNCE is device
From: |
Jason Wang |
Subject: |
Re: [RFC PATCH v2 7/8] vhost_net: return VIRTIO_NET_S_ANNOUNCE is device model has it set |
Date: |
Thu, 20 Oct 2022 12:35:54 +0800 |
On Wed, Oct 19, 2022 at 8:52 PM Eugenio Pérez <eperezma@redhat.com> wrote:
>
> Temporal, as this affects other vhost backends and we must check status
> feature first.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/net/vhost_net.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index 5660606c1d..300f370e2a 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -118,6 +118,7 @@ int vhost_net_get_config(struct vhost_net *net, uint8_t
> *config,
> uint32_t config_len)
> {
> VirtIODevice *vdev;
> + VirtIONet *n;
> int r = vhost_dev_get_config(&net->dev, config, config_len, NULL);
>
> if (unlikely(r != 0)) {
> @@ -142,6 +143,13 @@ int vhost_net_get_config(struct vhost_net *net, uint8_t
> *config,
> ((struct virtio_net_config *)config)->status |= VIRTIO_NET_S_LINK_UP;
> }
>
> + if (!(net->dev.acked_features & BIT_ULL(VIRTIO_NET_F_GUEST_ANNOUNCE))) {
> + return 0;
> + }
> +
> + n = VIRTIO_NET(vdev);
> + ((struct virtio_net_config *)config)->status |=
> + (n->status &
> VIRTIO_NET_S_ANNOUNCE);
Similar to the previous patch, it would be better to move this to virtio-net.c.
Thanks
> return 0;
> }
> int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
> --
> 2.31.1
>
- Re: [RFC PATCH v2 2/8] vdpa: Save emulated features list in vhost_vdpa, (continued)
[RFC PATCH v2 3/8] vhost_net: Emulate link state up if backend doesn't expose it, Eugenio Pérez, 2022/10/19
[RFC PATCH v2 1/8] vdpa: Delete duplicated vdpa_feature_bits entry, Eugenio Pérez, 2022/10/19
[RFC PATCH v2 5/8] vdpa: Remove shadow CVQ command check, Eugenio Pérez, 2022/10/19
[RFC PATCH v2 7/8] vhost_net: return VIRTIO_NET_S_ANNOUNCE is device model has it set, Eugenio Pérez, 2022/10/19
- Re: [RFC PATCH v2 7/8] vhost_net: return VIRTIO_NET_S_ANNOUNCE is device model has it set,
Jason Wang <=
[RFC PATCH v2 8/8] vdpa: Offer VIRTIO_NET_F_GUEST_ANNOUNCE feature if SVQ is enabled, Eugenio Pérez, 2022/10/19
[RFC PATCH v2 6/8] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail, Eugenio Pérez, 2022/10/19
[RFC PATCH v2 4/8] vdpa: Expose VIRTIO_NET_F_STATUS unconditionally, Eugenio Pérez, 2022/10/19
Re: [RFC PATCH v2 0/8] Guest announce feature emulation using Shadow VirtQueue, Jason Wang, 2022/10/20