Cache vdpa initialization & startup slow ioctls
Goal
Repetitive ioctls makes vdpa devices initialization and startup slow. This is true especially if the device has many vqs, as some of them must be applied per vq.
Some of these ioctls results can be cached so there is no need to call the ioctl again.
Technical details
As to cache increases complexity of qemu vdpa layer, it must be justified with the latency it decreased.
Areas I think it may be worth to cache:
- Virtio device configuration
- Virtio feature bits.
- Virtio state (DRIVER_OK etc), as it is fetched before adding any feature bit.
Additional information
- vring groups are cached in this patch, still not upstream this example patch.
- hw/virtio/vhost-vdpa.c and net/vhost-vdpa.c are both files that worth exploring.