[PATCH 0/3] Emulate status feature in vhost-vdpa net

Eugenio Pérez posted 3 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221026095303.37907-1-eperezma@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
There is a newer version of this series
include/net/vhost-vdpa.h |  1 +
hw/net/vhost_net.c       | 16 ++++++++++++++--
hw/net/virtio-net.c      | 39 ++++++++++++++++++++++++---------------
net/vhost-vdpa.c         |  3 +++
4 files changed, 42 insertions(+), 17 deletions(-)
[PATCH 0/3] Emulate status feature in vhost-vdpa net
Posted by Eugenio Pérez 1 year, 6 months ago
The net config space is already copied from the device so it can me modified
by qemu. In particular, this is already done to fix cases where the NIC does
not expose the right fields.

It's trivial to emulate _F_STATE with qemu if not supported by the device,
sice a valid approach is to always show the link as up. If the feature is
already supported by the device, no config space modification is needed.

This is a pre requisite to use other features like _F_GUEST_ANNOUNCE, since
_F_STATUS is needed for the guest to access the status.

These patches are sent on top of [1] series, so trivial conflicts could arise
if it is applied directly on master. Future versions can be not based on
it is more convenient.

Eugenio Pérez (3):
  virtio_net: Modify virtio_net_get_config to early return
  virtio_net: Handle _F_STATUS emulation in virtio_net_get_config
  vdpa: Expose VIRTIO_NET_F_STATUS unconditionally

 include/net/vhost-vdpa.h |  1 +
 hw/net/vhost_net.c       | 16 ++++++++++++++--
 hw/net/virtio-net.c      | 39 ++++++++++++++++++++++++---------------
 net/vhost-vdpa.c         |  3 +++
 4 files changed, 42 insertions(+), 17 deletions(-)

-- 
2.31.1

Re: [PATCH 0/3] Emulate status feature in vhost-vdpa net
Posted by Michael S. Tsirkin 1 year, 6 months ago
On Wed, Oct 26, 2022 at 11:53:00AM +0200, Eugenio Pérez wrote:
> The net config space is already copied from the device so it can me modified
> by qemu. In particular, this is already done to fix cases where the NIC does
> not expose the right fields.
> 
> It's trivial to emulate _F_STATE with qemu if not supported by the device,
> sice a valid approach is to always show the link as up. If the feature is
> already supported by the device, no config space modification is needed.
> 
> This is a pre requisite to use other features like _F_GUEST_ANNOUNCE, since
> _F_STATUS is needed for the guest to access the status.
> 
> These patches are sent on top of [1] series, so trivial conflicts could arise
> if it is applied directly on master. Future versions can be not based on
> it is more convenient.

Jason seems to be taking all this work through net tree.

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>



> Eugenio Pérez (3):
>   virtio_net: Modify virtio_net_get_config to early return
>   virtio_net: Handle _F_STATUS emulation in virtio_net_get_config
>   vdpa: Expose VIRTIO_NET_F_STATUS unconditionally
> 
>  include/net/vhost-vdpa.h |  1 +
>  hw/net/vhost_net.c       | 16 ++++++++++++++--
>  hw/net/virtio-net.c      | 39 ++++++++++++++++++++++++---------------
>  net/vhost-vdpa.c         |  3 +++
>  4 files changed, 42 insertions(+), 17 deletions(-)
> 
> -- 
> 2.31.1
>