Hi Eric,

>-----Original Message-----
>From: Eric Auger <eric.au...@redhat.com>
>Sent: Wednesday, September 27, 2023 9:14 PM
>Subject: Re: [PATCH v2 11/12] vfio/common: Introduce two kinds of VFIO device
>lists
>
>Hi Zhenzhong,
>On 9/26/23 13:32, Zhenzhong Duan wrote:
>> In VFIO subsystem, there are different VFIO device iteration requirements.
>> One requirement is to iterate all VFIO devices, the other is to iterate
>> VFIO device in same container.
>>
>> Currently VFIO device is iterated through VFIO group list which is group
>> perceivable and less efficient.
>>
>> Introduce two kinds of VFIO device lists, one is a global list, the other
>> is per container list. With the two lists added, we can make some migration
>> and reset related functions group agnostic.
>>
>> For example, vfio_device_list is used in below functions:
>> vfio_mig_active
>> vfio_reset_handler
>> vfio_multiple_devices_migration_is_supported
>>
>> Per container list is used in below functions:
>> vfio_devices_all_dirty_tracking
>> vfio_devices_all_device_dirty_tracking
>> vfio_devices_all_running_and_mig_active
>> vfio_devices_dma_logging_stop
>> vfio_devices_dma_logging_start
>> vfio_devices_query_dirty_bitmap
>>
>> This is a prerequisite for future IOMMUFD backend support which
>> has same kind of iteration requirement.
>>
>> vfio_group_list is preserved for some functions which honor group
>> iteration, those functions are all related to legacy backend.
>>
>> Suggested-by: Alex Williamson <alex.william...@redhat.com>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.d...@intel.com>
>
>This may be split into 3 patches
>1. creation of container->device_list
>2. creation of global device list
>3. addition of container field in vbasedev (which is not described in
>the commit msg by the way) and looks somehow unrelated to me?

Ah, ok, I just thought adding pointer to container is trivial which is
counterpart to container->device_list. And yes, I'm fine to split it
into 3 patches.

Thanks
Zhenzhong

Reply via email to