[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 7/8] Move the detach of PCI device to the beginnging of live hotplug




On May 20, 2016 12:36 AM, "Laine Stump" <laine laine org> wrote:
>
> On 05/19/2016 02:46 PM, Shivaprasad bhat wrote:
>>
>>
>>
>> On Fri, May 20, 2016 at 12:05 AM, Laine Stump <laine laine org> wrote:
>>>
>>> On 05/18/2016 05:35 PM, Shivaprasad G Bhat wrote:
>>>>
>>>> The hostdevices are the only devices which have dependencies
>>>> outside of themselves such that, other functions of the PCI
>>>> card should also have been detached from host driver before
>>>> attempting the hotplug.
>>>
>>>
>>> Are you saying that all the functions on a host device must be detached from their host driver, even if you're only assigning one or another of them to the guest?
>>>
>> Yes. All devices from same iommu group should be detached from the host.
>
>
> Ah right, I forgot about that. But that is something we already don't deal with (currently you can assign a single device from an iommu group with many devices, but managed='yes' won't work for it. That would require some other sort of managed mode, like "managed='group'" or something, but more elaborate managed modes have already been NACKed on the list (I posted an RFC patch for "managed='detach'" at the request of someone else - it would detach the device from the host driver before assignment, but not reattach it afterwards. This was deemed inappropriate and unnecessary.)
>
> You may wonder why we don't want to automatically detach all the other devices without any clue to do so in the config - it's because you can't expect the user to know which devices are in the same iommu group as the one you want to assign, and you don't want to just automatically/silent detach one that is essential for continued operation of the host.
>
> So we really should only detach those devices that are going to be assigned to the guest.
>
>
>> Here, I hope the Card is independent. Otherwise, many cards can also
>> belong to same iommu group. In such case, manual the nodedev-detach for other card functions is necessary.
>>  
>>>>
>>>>
>>>> This patch moves the detach to the beginning of the hotplug
>>>> so that the following patch can detach all funtions first before
>>>> attempting to hotplug any.
>>>>
>>>> We need not move the detach for net devices using SRIOV as
>>>> all SRIOV devices are single function devices.
>>>
>>>
>>>
>>> I'm not sure why that makes any difference. In any case, you should detach all the devices that are going to be assigned, then assign them all, with the one going to function 0 being last.
>>
>>
>> There will be only function zero. So I felt its not necessary. Are you saying different SRIOV functions(all with function zero) be hotplugged as
>> different functions of single card in guest ? In that case, we would need to do that.
>
>
> I couldn't parse your question, but I wasn't talking about SRIOV in particular, just saying that the way multifunction device assignment is done in qemu is to assign all the non-0 functions, then assign function 0. But that was just an incidental part of the conversation. The important part is that you first detach from the host all devices to be assigned, then you assign them all.

The SRIOV devices are single function and they dont have the dependency of "other" function to be detached before the device_add. So, they can be detached in qemuDomainAttachNetDevice() itself.

The case I am talking about is, should we be supporting the devices belonging to different iommu groups be hotplugged as a singled card into guest? Say 5 SRIOV functions hotplugged as a single Card. I am not sure we should allow that. Unlike I mentioned, in such case too we can detach in qemuDomainAttachNetDevice() itself and expect it to work.

>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]