On Mon, Apr 28, 2025 at 05:39:46PM +0200, Cédric Le Goater wrote: > On 4/9/25 15:48, John Levon wrote: > > Instead of requesting region information on demand with > > VFIO_DEVICE_GET_REGION_INFO, maintain a cache: this will become > > necessary for performance for vfio-user, where this call becomes a > > message over the control socket, so is of higher overhead than the > > traditional path. > > > +static void vfio_device_get_all_region_info(VFIODevice *vbasedev) > > +{ > > + struct vfio_region_info *info; > > + int i; > > + > > + for (i = 0; i < vbasedev->num_regions; i++) { > > + vfio_device_get_region_info(vbasedev, i, &info); > > + } > > +} > > + > > if the vfio_device_get_all_region_info() routine queries *all* region > infos to fill the ->reginfo[] cache array, why do we also need the > lazy cache filling method in vfio_device_get_region_info() ? This looks > redundant to me. I would rather have vfio_device_get_region_info() > operate on the cache only.
I think we briefly talked about this last time. I don't know why the cache fill code is there; I can drop it. regards john