[PATCH v4 0/6] Vhost-vdpa Shadow Virtqueue Offloads support

Hawkins Jiawei posted 6 patches 10 months, 4 weeks ago
Failed in applying to current master (apply log)
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c            |  2 +-
include/hw/virtio/virtio-net.h |  1 +
include/hw/virtio/virtio.h     |  2 +-
net/vhost-vdpa.c               | 49 +++++++++++++++++++++++++++++++---
4 files changed, 48 insertions(+), 6 deletions(-)
[PATCH v4 0/6] Vhost-vdpa Shadow Virtqueue Offloads support
Posted by Hawkins Jiawei 10 months, 4 weeks ago
This series enables shadowed CVQ to intercept Offloads commands
through shadowed CVQ, update the virtio NIC device model so qemu
send it in a migration, and the restore of that Offloads state
in the destination.

Changelog
=========
v4:
  - refactor the commit message suggested by Eugenio in patch#4
"virtio-net: expose virtio_net_supported_guest_offloads()"
  - fix the wrong "cpu_to_le64()" pointed out by Eugenio in patch$5
"vdpa: Add vhost_vdpa_net_load_offloads()"
  - refactor the comment in patch#5
"vdpa: Add vhost_vdpa_net_load_offloads()"

v3: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00206.html

v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00044.html

v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07198.html

Hawkins Jiawei (6):
  include/hw/virtio: make some VirtIODevice const
  vdpa: reuse virtio_vdev_has_feature()
  hw/net/virtio-net: make some VirtIONet const
  virtio-net: expose virtio_net_supported_guest_offloads()
  vdpa: Add vhost_vdpa_net_load_offloads()
  vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

 hw/net/virtio-net.c            |  2 +-
 include/hw/virtio/virtio-net.h |  1 +
 include/hw/virtio/virtio.h     |  2 +-
 net/vhost-vdpa.c               | 49 +++++++++++++++++++++++++++++++---
 4 files changed, 48 insertions(+), 6 deletions(-)

-- 
2.25.1
Re: [PATCH v4 0/6] Vhost-vdpa Shadow Virtqueue Offloads support
Posted by Lei Yang 10 months, 4 weeks ago
QE tested this series v4 on the vp_vdpa device with the following
scenarios: reboot/shutdown, hotplug/unplug, nic driver load/unload,
ping, vDPA control virtqueue(changed the mac address), everything are
working fine. And L1 guest will not appear  error messages "vdpa svq
does not work with features 0x4" after applied this series of patches.

Tested-by: Lei Yang <leiyang@redhat.com>


On Fri, Jun 2, 2023 at 7:55 PM Hawkins Jiawei <yin31149@gmail.com> wrote:
>
> This series enables shadowed CVQ to intercept Offloads commands
> through shadowed CVQ, update the virtio NIC device model so qemu
> send it in a migration, and the restore of that Offloads state
> in the destination.
>
> Changelog
> =========
> v4:
>   - refactor the commit message suggested by Eugenio in patch#4
> "virtio-net: expose virtio_net_supported_guest_offloads()"
>   - fix the wrong "cpu_to_le64()" pointed out by Eugenio in patch$5
> "vdpa: Add vhost_vdpa_net_load_offloads()"
>   - refactor the comment in patch#5
> "vdpa: Add vhost_vdpa_net_load_offloads()"
>
> v3: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00206.html
>
> v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00044.html
>
> v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07198.html
>
> Hawkins Jiawei (6):
>   include/hw/virtio: make some VirtIODevice const
>   vdpa: reuse virtio_vdev_has_feature()
>   hw/net/virtio-net: make some VirtIONet const
>   virtio-net: expose virtio_net_supported_guest_offloads()
>   vdpa: Add vhost_vdpa_net_load_offloads()
>   vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ
>
>  hw/net/virtio-net.c            |  2 +-
>  include/hw/virtio/virtio-net.h |  1 +
>  include/hw/virtio/virtio.h     |  2 +-
>  net/vhost-vdpa.c               | 49 +++++++++++++++++++++++++++++++---
>  4 files changed, 48 insertions(+), 6 deletions(-)
>
> --
> 2.25.1
>
>
Re: [PATCH v4 0/6] Vhost-vdpa Shadow Virtqueue Offloads support
Posted by Eugenio Perez Martin 10 months, 4 weeks ago
On Fri, Jun 2, 2023 at 1:52 PM Hawkins Jiawei <yin31149@gmail.com> wrote:
>
> This series enables shadowed CVQ to intercept Offloads commands
> through shadowed CVQ, update the virtio NIC device model so qemu
> send it in a migration, and the restore of that Offloads state
> in the destination.
>
> Changelog
> =========
> v4:
>   - refactor the commit message suggested by Eugenio in patch#4
> "virtio-net: expose virtio_net_supported_guest_offloads()"
>   - fix the wrong "cpu_to_le64()" pointed out by Eugenio in patch$5
> "vdpa: Add vhost_vdpa_net_load_offloads()"
>   - refactor the comment in patch#5
> "vdpa: Add vhost_vdpa_net_load_offloads()"
>
> v3: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00206.html
>
> v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00044.html
>
> v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07198.html
>

Please keep all the v2, v3 etc changes here too. A reviewer may see
this newly from an older revision.

Apart from that,
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Tested-by: Eugenio Pérez <eperezma@redhat.com>

I tested it by tracing the value it sends at destination when the
guest enable or disable hw GRO offloads with:
ethtool -K rx-gro-hw off.

As you point in previous series, a migration blocker needs to be
conditionally added. This is done in [1].

While investigating this I discovered two related issues, it might be
in handy if other reviewer wants to test the changes [2][3].

Thanks!

[1] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00512.html
[2] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00601.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00604.html

> Hawkins Jiawei (6):
>   include/hw/virtio: make some VirtIODevice const
>   vdpa: reuse virtio_vdev_has_feature()
>   hw/net/virtio-net: make some VirtIONet const
>   virtio-net: expose virtio_net_supported_guest_offloads()
>   vdpa: Add vhost_vdpa_net_load_offloads()
>   vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ
>
>  hw/net/virtio-net.c            |  2 +-
>  include/hw/virtio/virtio-net.h |  1 +
>  include/hw/virtio/virtio.h     |  2 +-
>  net/vhost-vdpa.c               | 49 +++++++++++++++++++++++++++++++---
>  4 files changed, 48 insertions(+), 6 deletions(-)
>
> --
> 2.25.1
>
Re: [PATCH v4 0/6] Vhost-vdpa Shadow Virtqueue Offloads support
Posted by Hawkins Jiawei 10 months, 3 weeks ago
On 2023/6/3 1:47, Eugenio Perez Martin wrote:
> On Fri, Jun 2, 2023 at 1:52 PM Hawkins Jiawei <yin31149@gmail.com> wrote:
>>
>> This series enables shadowed CVQ to intercept Offloads commands
>> through shadowed CVQ, update the virtio NIC device model so qemu
>> send it in a migration, and the restore of that Offloads state
>> in the destination.
>>
>> Changelog
>> =========
>> v4:
>>    - refactor the commit message suggested by Eugenio in patch#4
>> "virtio-net: expose virtio_net_supported_guest_offloads()"
>>    - fix the wrong "cpu_to_le64()" pointed out by Eugenio in patch$5
>> "vdpa: Add vhost_vdpa_net_load_offloads()"
>>    - refactor the comment in patch#5
>> "vdpa: Add vhost_vdpa_net_load_offloads()"
>>
>> v3: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00206.html
>>
>> v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00044.html
>>
>> v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07198.html
>>
>
> Please keep all the v2, v3 etc changes here too. A reviewer may see
> this newly from an older revision.

Thank you for the reminder, I will include all change log in the
upcoming patches.

>
> Apart from that,
> Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
> Tested-by: Eugenio Pérez <eperezma@redhat.com>
>
> I tested it by tracing the value it sends at destination when the
> guest enable or disable hw GRO offloads with:
> ethtool -K rx-gro-hw off.
>
> As you point in previous series, a migration blocker needs to be
> conditionally added. This is done in [1].
>
> While investigating this I discovered two related issues, it might be
> in handy if other reviewer wants to test the changes [2][3].
>
> Thanks!
>
> [1] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00512.html
> [2] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00601.html
> [3] https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00604.html

Thanks for your explanation!


>
>> Hawkins Jiawei (6):
>>    include/hw/virtio: make some VirtIODevice const
>>    vdpa: reuse virtio_vdev_has_feature()
>>    hw/net/virtio-net: make some VirtIONet const
>>    virtio-net: expose virtio_net_supported_guest_offloads()
>>    vdpa: Add vhost_vdpa_net_load_offloads()
>>    vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ
>>
>>   hw/net/virtio-net.c            |  2 +-
>>   include/hw/virtio/virtio-net.h |  1 +
>>   include/hw/virtio/virtio.h     |  2 +-
>>   net/vhost-vdpa.c               | 49 +++++++++++++++++++++++++++++++---
>>   4 files changed, 48 insertions(+), 6 deletions(-)
>>
>> --
>> 2.25.1
>>
>