<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">2017-07-19 21:18 GMT+03:00 Konrad Rzeszutek Wilk <span dir="ltr"><<a href="mailto:konrad.wilk@oracle.com" target="_blank">konrad.wilk@oracle.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Wed, Jul 19, 2017 at 05:14:41PM +0000, Alexander Bezzubikov wrote:<br>
> ср, 19 июля 2017 г. в 16:57, Konrad Rzeszutek Wilk <<a href="mailto:konrad.wilk@oracle.com" target="_blank">konrad.wilk@oracle.com</a>>:<br>
><br>
> > On Wed, Jul 19, 2017 at 04:20:12PM +0300, Aleksandr Bezzubikov wrote:<br>
> > > Now PCI bridges (and PCIE root port too) get a bus range number in<br>
> > system init,<br>
> > > basing on currently plugged devices. That's why when one wants to<br>
> > hotplug another bridge,<br>
> > > it needs his child bus, which the parent is unable to provide.<br>
> ><br>
> > Could you explain how you trigger this?<br>
><br>
><br>
> I'm trying to hot plug pcie-pci bridge into pcie root port, and Linux says<br>
> 'cannot allocate bus number for device bla-bla'. This obviously does not<br>
> allow me to use the bridge at all.<br>
><br>
> ><br>
> ><br>
> > > The suggested workaround is to have vendor-specific capability in RedHat<br>
> > generic pcie-root-port<br>
> > > that contains number of additional bus to reserve on BIOS PCI init.<br>
> ><br>
> > But wouldn't the proper fix be for the PCI bridge to have the subordinate<br>
> > value be extended to fit more bus ranges?<br>
><br>
><br>
> What do you mean? This is what I'm trying to do. Do you suppose to get rid<br>
> of vendor-specific cap and use original register value instead of it?<br>
<br>
</span>I would suggest a simple fix - each bridge has a a number of bus devices<br>
it can use. You have up to 255 - so you split the number of northbridge<br>
numbers by the amount of NUMA nodes (if that is used) - so for example<br>
if you have 4 NUMA nodes, each bridge would cover 63 bus numbers.<br>
<br>
Meaning the root bridge would cover 0->63 bus, 64->128, and so on.<br>
That gives you enough space to plug in your plugged in devices<br>
(up to 63).<br>
<br>
And if you need sub-briges then carve out a specific range.<br></blockquote><div> </div></div></div><div>The problem is that we don't know at the init moment how many subbridges we may need,</div><div>and how deep the whole device tree will be. The key moment - PCI bridge hotplugging</div><div>needs either rescan all buses on each bridge device addition, or reserve space in advance during BIOS init.</div><div>In this series the second way was chosen.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="m_-2072988878752408355HOEnZb"><div class="m_-2072988878752408355h5"><br>
<br>
><br>
> ><br>
> > ><br>
> > > Aleksandr Bezzubikov (2):<br>
> > >   pci: add support for direct usage of bdf for capability lookup<br>
> > >   pci: enable RedHat pci bridges to reserve more buses<br>
> > ><br>
> > >  src/fw/pciinit.c   | 12 ++++++++++--<br>
> > >  src/hw/pcidevice.c | 24 ++++++++++++++++++++++++<br>
> > >  src/hw/pcidevice.h |  1 +<br>
> > >  3 files changed, 35 insertions(+), 2 deletions(-)<br>
> > ><br>
> > > --<br>
> > > 2.7.4<br>
> > ><br>
> > ><br>
> ><br>
> --<br>
> Alexander Bezzubikov<br>
</div></div></blockquote></span></div><span class="HOEnZb"><br><br clear="all"><div style="color:rgb(136,136,136)"><br></div><font color="#888888">-- </font><br><div class="m_-2072988878752408355gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="background-color:rgb(255,255,255)"><font color="#000000">Alexander Bezzubikov</font></span></div></div></div></div>
</span></div></div>
</div><br>
</div>