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

[Xen-devel] RE: [PATCH] passthrough: update bus2bridge mapping as PCI devices get added/removed


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
  • Date: Fri, 7 Oct 2011 18:39:40 -0700
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 07 Oct 2011 18:40:23 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcyEv80sHSj/QYc+Q3WIsFj6xv6s6wAmvupA
  • Thread-topic: [PATCH] passthrough: update bus2bridge mapping as PCI devices get added/removed

> +            for ( ; sec_bus <= sub_bus; sec_bus++ )
> +                pseg->bus2bridge[sec_bus] = pseg->bus2bridge[pdev->bus];

OK.  You are collapsing the bridge of the subordinate buses to be the same 
upstream bridge of the pdev we are removing.  Looks good.  Ack!

Allen

-----Original Message-----
From: Jan Beulich [mailto:JBeulich@xxxxxxxx] 
Sent: Friday, October 07, 2011 12:08 AM
To: Kay, Allen M
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [PATCH] passthrough: update bus2bridge mapping as PCI devices get 
added/removed

>>> On 07.10.11 at 04:00, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:
> Hi Jan,
> 
> I'm not able to spot the difference between this patch and the earlier one 
> you had second thoughts about in attached email.  Was there a change I 
> missed?

It addresses the comment I made in the mail you had attached, i.e. ...

> Allen
> 
> -----Original Message-----
>...
> -static void free_pdev(struct pci_dev *pdev)
> +static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>  {
> +    /* update bus2bridge */
> +    switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )
> +    {
> +        u8 dev, func, sec_bus, sub_bus;
> +
> +        case DEV_TYPE_PCIe2PCI_BRIDGE:
> +        case DEV_TYPE_LEGACY_PCI_BRIDGE:
> +            dev = PCI_SLOT(pdev->devfn);
> +            func = PCI_FUNC(pdev->devfn);
> +            sec_bus = pci_conf_read8(pseg->nr, pdev->bus, dev, func,
> +                                     PCI_SECONDARY_BUS);
> +            sub_bus = pci_conf_read8(pseg->nr, pdev->bus, dev, func,
> +                                     PCI_SUBORDINATE_BUS);
> +
> +            spin_lock(&pseg->bus2bridge_lock);
> +            for ( ; sec_bus <= sub_bus; sec_bus++ )
> +                pseg->bus2bridge[sec_bus] = pseg->bus2bridge[pdev->bus];

... the right side of this was 0 on the first posting.

Jan

> +            spin_unlock(&pseg->bus2bridge_lock);
> +            break;
> +    }
> +
>      list_del(&pdev->alldevs_list);
>      xfree(pdev);
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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