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

[xen staging] xen/pci: remove logic catering to adding VF without PF



commit 8fe330a4daf64d72b8e55682d805aac90645fd06
Author:     Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
AuthorDate: Tue Nov 26 11:23:42 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 26 11:23:42 2024 +0100

    xen/pci: remove logic catering to adding VF without PF
    
    The hardware domain is expected to add a PF first before adding
    associated VFs. If adding happens out of order, print a warning and
    return an error. Drop the recursive call to pci_add_device().
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/drivers/passthrough/pci.c | 31 +++++++------------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index a5ad86267f..777c6b1a7f 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -699,30 +699,13 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
 
             if ( !pf_pdev )
             {
-                ret = pci_add_device(seg, info->physfn.bus, info->physfn.devfn,
-                                     NULL, node);
-                if ( ret )
-                {
-                    printk(XENLOG_WARNING
-                           "Failed to add SR-IOV device PF %pp for VF %pp\n",
-                           &PCI_SBDF(seg, info->physfn.bus, 
info->physfn.devfn),
-                           &pdev->sbdf);
-                    free_pdev(pseg, pdev);
-                    goto out;
-                }
-                pf_pdev = pci_get_pdev(NULL, PCI_SBDF(seg, info->physfn.bus,
-                                                      info->physfn.devfn));
-                if ( !pf_pdev )
-                {
-                    printk(XENLOG_ERR
-                           "Inconsistent PCI state: failed to find newly added 
PF %pp for VF %pp\n",
-                           &PCI_SBDF(seg, info->physfn.bus, 
info->physfn.devfn),
-                           &pdev->sbdf);
-                    ASSERT_UNREACHABLE();
-                    free_pdev(pseg, pdev);
-                    ret = -EILSEQ;
-                    goto out;
-                }
+                printk(XENLOG_WARNING
+                       "Attempted to add SR-IOV VF %pp without PF %pp\n",
+                       &pdev->sbdf,
+                       &PCI_SBDF(seg, info->physfn.bus, info->physfn.devfn));
+                free_pdev(pseg, pdev);
+                ret = -ENODEV;
+                goto out;
             }
 
             if ( !pdev->pf_pdev )
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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