[RFC 0/2] Virtio in order feature support for virtio-net device.

Guo Zhi posted 2 patches 1 year, 7 months ago
hw/net/virtio-net.c        | 30 +++++++++++++++++++++++++++---
include/hw/virtio/virtio.h |  4 +++-
2 files changed, 30 insertions(+), 4 deletions(-)
[RFC 0/2] Virtio in order feature support for virtio-net device.
Posted by Guo Zhi 1 year, 7 months ago
In virtio-spec 1.1, new feature bit VIRTIO_F_IN_ORDER was introduced.
When this feature has been negotiated, virtio driver will use
descriptors in ring order: starting from offset 0 in the table, and
wrapping around at the end of the table. Virtio devices will always use
descriptors in the same order in which they have been made available.
This can reduce virtio accesses to used ring.

Based on updated virtio-spec, this series realized IN_ORDER prototype
for virtio-net device in QEMU.

Some work haven't been done in this patch series:
1. Virtio device in_order support for packed vq is left for the future.

Related patches:
In order feature in Linux(support virtio driver, vhost_test and vsock device): https://lkml.org/lkml/2022/8/17/643

Guo Zhi (2):
  virtio: expose used buffers
  virtio: enable f_in_order feature for virtio-net

 hw/net/virtio-net.c        | 30 +++++++++++++++++++++++++++---
 include/hw/virtio/virtio.h |  4 +++-
 2 files changed, 30 insertions(+), 4 deletions(-)

-- 
2.17.1
Re: [RFC 0/2] Virtio in order feature support for virtio-net device.
Posted by Jason Wang 1 year, 7 months ago
On Thu, Aug 18, 2022 at 11:13 PM Guo Zhi <qtxuning1999@sjtu.edu.cn> wrote:
>
> In virtio-spec 1.1, new feature bit VIRTIO_F_IN_ORDER was introduced.
> When this feature has been negotiated, virtio driver will use
> descriptors in ring order: starting from offset 0 in the table, and
> wrapping around at the end of the table. Virtio devices will always use
> descriptors in the same order in which they have been made available.
> This can reduce virtio accesses to used ring.

So the bached used buffer seems like an optimization, I'd like
re-order the patches

1) Just enable virtio-net in-order without the batching, to see the performance
2) Add the batching optimization on top.

>
> Based on updated virtio-spec, this series realized IN_ORDER prototype
> for virtio-net device in QEMU.

Please share with us some performance numbers. E.g pps.

>
> Some work haven't been done in this patch series:
> 1. Virtio device in_order support for packed vq is left for the future.

Anything makes packed virtqueue special?

Thanks

>
> Related patches:
> In order feature in Linux(support virtio driver, vhost_test and vsock device): https://lkml.org/lkml/2022/8/17/643
>
> Guo Zhi (2):
>   virtio: expose used buffers
>   virtio: enable f_in_order feature for virtio-net
>
>  hw/net/virtio-net.c        | 30 +++++++++++++++++++++++++++---
>  include/hw/virtio/virtio.h |  4 +++-
>  2 files changed, 30 insertions(+), 4 deletions(-)
>
> --
> 2.17.1
>