From: "Jan Beulich" Subject: Re: xl/SR-IOV: disposition of VFs when PF disappears? Date: Tue, 28 Oct 2014 16:25:16 +0000 Message-ID: <544FD17C0200007800042D5B@mail.emea.novell.com> References: <544E4A4E020000780004267D@mail.emea.novell.com> <1414414666.23883.13.camel@eu.citrix.com> <20141027133534.GC4050@laptop.dumpdata.com> <20141027180723.GD12989@laptop.dumpdata.com> <544F7D310200007800042BC2@mail.emea.novell.com> <20141028140029.GC21290@laptop.dumpdata.com> <544FC1EA0200007800042CF7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartCCF9DA7C.3__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xj9aB-0002q7-Sw for xen-devel@lists.xenproject.org; Tue, 28 Oct 2014 16:25:19 +0000 In-Reply-To: <544FC1EA0200007800042CF7@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: Wei Liu , Stefano Stabellini , "ian.jackson@eu.citrix.com" , Ian Campbell , xen-devel , Anirban Chakraborty List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartCCF9DA7C.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> On 28.10.14 at 16:18, wrote: > That flag doesn't inhibit the PF driver unloading. It only suppresses > it freeing the VFs in that process (and afaics nothing will ever allow > them to be released subsequently in that case). I'm about to test a > change to pciback (it's building right now). Attached a raw patch for you or anyone else to comment on from a conceptual perspective. The main thing probably is to determine whether any further serialization needs to be added. Jan --=__PartCCF9DA7C.3__= Content-Type: text/plain; name="901839.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="901839.patch" --- sle12.orig/drivers/xen/xen-pciback/pci_stub.c=0A+++ sle12/drivers/xen/x= en-pciback/pci_stub.c=0A@@ -1502,6 +1502,44 @@ parse_error:=0A fs_initcall(= pcistub_init);=0A #endif=0A =0A+#ifdef CONFIG_PCI_IOV=0A+static int = pci_stub_notifier(struct notifier_block *nb,=0A+ = unsigned long action, void *data)=0A+{=0A+ struct device *dev =3D = data;=0A+ struct pci_dev *pdev =3D to_pci_dev(dev);=0A+=0A+ = switch (action) {=0A+ case BUS_NOTIFY_UNBIND_DRIVER:=0A+ = for (;;) {=0A+ struct pcistub_device *psdev;=0A+ = unsigned long flags;=0A+ bool found =3D = false;=0A+=0A+ spin_lock_irqsave(&pcistub_devices_lock, = flags);=0A+=0A+ list_for_each_entry(psdev, &pcistub_devices= , dev_list)=0A+ if (!psdev->pdev && psdev->dev = !=3D pdev=0A+ && pci_physfn(psdev->dev) = =3D=3D pdev) {=0A+ found =3D = true;=0A+ break;=0A+ = }=0A+ spin_unlock_irqrestore(&pcistub_devices_loc= k, flags);=0A+ if (!found)=0A+ = break;=0A+ device_release_driver(&psdev->dev->dev);=0A= + }=0A+ break;=0A+ }=0A+=0A+ return = NOTIFY_DONE;=0A+}=0A+=0A+static struct notifier_block pci_stub_nb =3D = {=0A+ .notifier_call =3D pci_stub_notifier,=0A+};=0A+#endif=0A+=0A = static int __init xen_pcibk_init(void)=0A {=0A int err;=0A@@ -1523,6 = +1561,10 @@ static int __init xen_pcibk_init(void)=0A err =3D xen_pcibk_x= enbus_register();=0A if (err)=0A pcistub_exit();=0A+#ifdef = CONFIG_PCI_IOV=0A+ else=0A+ bus_register_notifier(&pci_= bus_type, &pci_stub_nb);=0A+#endif=0A =0A return err;=0A }=0A --=__PartCCF9DA7C.3__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartCCF9DA7C.3__=--