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

Re: [PATCH v6 2/3] xen/pci: introduce PF<->VF links


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 12 Nov 2024 12:41:04 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WJQvci0kCIKXPwYB4n0Chs115xklp9BM0XmPSlGqaZE=; b=FMJjSQ900OnjvdXbk5EdkZ9T2e0qaUM1qP0uKP4jNnmPOjqEWtBA2fj2mit/OYjgMezCi4DHjArAa7VhfOetAjmXr6fhSJFjdtjtbp/XnlLn/sa2DH0ddhqY9mSTHj/YsOKLfsoZdYi8zgxncuJVAxl9zb5d4P41/LKg/dtqF8zmnOipck09maYNKUwz9ivXISgCAgmrSwl9TRslq6+5MX0U+OTjJ+njLiWyUas7fD2CJBQf2Qc7EgGpgGyIU0Boh0uweIsBEVoLjCxz4fn0KxTLqUNU8FjzHCMSwlXzYXxKF+huxd5C3rwnybpfmw1y7eMzKlcel5AEMZSzYO0t6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NddPkhpq3xAIcLREO44zdM46nHoKzQdAleidL7jTO/AORscc+2F5iw92YQwZKjJq3tE6WLFi492mGxpMdU6WdkD9137xGDyhR8wdfRQOhrCCDhVIH7yYZvfgYIIJWwkE0fS1IxAKaXTqYOIlVWQ36wtTdXUNFobwrneXz4b8T/J0AF0v/Z10liQ3r+dpU6oj9bs/8X6UbefdgHkF55CKuvEt7bhFh7ClqPStObCFzdlif+btETUi8ofsC3J7oYgScrLqxZOd7HwFnaoB2hoestGLHe7DaA70WHDqSbnAL01RwGBJhqKqfDcbwgdS09cVZxh1/EX9ieH5gN8cZ5GJAQ==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 12 Nov 2024 17:41:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/12/24 04:39, Jan Beulich wrote:
> On 12.11.2024 10:02, Roger Pau Monné wrote:
>> On Mon, Nov 11, 2024 at 03:07:28PM -0500, Stewart Hildebrand wrote:
>>> On 10/28/24 14:41, Roger Pau Monné wrote:
>>>> if ( !pdev->info.is_virtfn && !list_empty(&pdev->vf_list) )
>>>> {
>>>>     struct pci_dev *vf_pdev;
>>>>
>>>>     while ( (vf_pdev = list_first_entry_or_null(&pdev->vf_list,
>>>>                                                 struct pci_dev,
>>>>                                            vf_list)) != NULL )
>>>>     {
>>>>         list_del(&vf_pdev->vf_list);
>>>>         vf_pdev->virtfn.pf_pdev = NULL;
>>>>         vf_pdev->broken = true;
>>>>     }
>>>>
>>>>     printk(XENLOG_WARNING "PCI SR-IOV PF %pp removed with VFs still 
>>>> present\n",
>>>>            &pdev->sbdf);
>>>> }
>>>
>>> Yeah. Given that the consensus is leaning toward keeping the PF and
>>> returning an error, here's my suggestion:
>>>
>>>     if ( !pdev->info.is_virtfn && !list_empty(&pdev->vf_list) )
>>>     {
>>>         struct pci_dev *vf_pdev;
>>>
>>>         list_for_each_entry(vf_pdev, &pdev->vf_list, vf_list)
>>>             vf_pdev->broken = true;
>>>
>>>         pdev->broken = true;
>>
>> Do you need to mark the devices as broken?  My expectation would be
>> that returning -EBUSY here should prevent the device from being
>> removed, and hence there would be no breakage, just failure to fulfill
>> the (possible) hot-unplug request.
> 
> That very much depends on Dom0 kernels then actually respecting the error,
> and not considering the underlying hypercall a mere notification.

All dom0 Linux does is print a warning:

# echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/sriov_numvfs
# echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
[   56.738750]  0000:01:00.0: driver left SR-IOV enabled after remove
(XEN) Attempted to remove PCI SR-IOV PF 0000:01:00.0 with VFs still present
[   56.749904] pci 0000:01:00.0: Failed to delete - passthrough or MSI/MSI-X 
might fail!
# echo $?
0

Subsequently, lspci reveals no entry for 0000:01:00.0. I think it's
appropriate to mark them broken.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.