[PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-02 Thread Wei Yang
When retrieving VF IOV BAR in virtfn_add(), it will divide the total PF's IOV BAR size with the totalVF number. This is true for most cases, while may not be correct on some specific platform. For example on PowerNV platform, in order to fix PF's IOV BAR into a hardware alignment, the PF's IOV BAR

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-18 Thread Bjorn Helgaas
[+cc Don, Myron] Hi Wei, On Sun, Nov 02, 2014 at 11:41:19PM +0800, Wei Yang wrote: > When retrieving VF IOV BAR in virtfn_add(), it will divide the total PF's IOV > BAR size with the totalVF number. This is true for most cases, while may not > be correct on some specific platform. > > For exampl

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-18 Thread Benjamin Herrenschmidt
On Tue, 2014-11-18 at 18:12 -0700, Bjorn Helgaas wrote: > > Can you help me understand this? > > We have previously called sriov_init() on the PF. There, we sized the VF > BARs, which are in the PF's SR-IOV Capability (SR-IOV spec sec 3.3.14). > The size we discover is the amount of space requir

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-18 Thread Wei Yang
On Wed, Nov 19, 2014 at 01:15:32PM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-18 at 18:12 -0700, Bjorn Helgaas wrote: >> >> Can you help me understand this? >> >> We have previously called sriov_init() on the PF. There, we sized the VF >> BARs, which are in the PF's SR-IOV Capability

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-18 Thread Bjorn Helgaas
On Wed, Nov 19, 2014 at 11:21:00AM +0800, Wei Yang wrote: > On Wed, Nov 19, 2014 at 01:15:32PM +1100, Benjamin Herrenschmidt wrote: > >On Tue, 2014-11-18 at 18:12 -0700, Bjorn Helgaas wrote: > >> > >> Can you help me understand this? > >> > >> We have previously called sriov_init() on the PF. Th

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-19 Thread Wei Yang
On Tue, Nov 18, 2014 at 09:26:01PM -0700, Bjorn Helgaas wrote: >On Wed, Nov 19, 2014 at 11:21:00AM +0800, Wei Yang wrote: >> On Wed, Nov 19, 2014 at 01:15:32PM +1100, Benjamin Herrenschmidt wrote: >> >On Tue, 2014-11-18 at 18:12 -0700, Bjorn Helgaas wrote: >> >> >> >> Can you help me understand th

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-19 Thread Bjorn Helgaas
On Wed, Nov 19, 2014 at 05:27:40PM +0800, Wei Yang wrote: > On Tue, Nov 18, 2014 at 09:26:01PM -0700, Bjorn Helgaas wrote: > >On Wed, Nov 19, 2014 at 11:21:00AM +0800, Wei Yang wrote: > >> On Wed, Nov 19, 2014 at 01:15:32PM +1100, Benjamin Herrenschmidt wrote: > >> >On Tue, 2014-11-18 at 18:12 -070

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-19 Thread Benjamin Herrenschmidt
On Wed, 2014-11-19 at 10:23 -0700, Bjorn Helgaas wrote: > > Yes, I've read that many times. What's missing is the connection between a > PE and the things in the PCI specs (buses, devices, functions, MMIO address > space, DMA, MSI, etc.) Presumably the PE structure imposes constraints on > how t

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-19 Thread Wei Yang
On Wed, Nov 19, 2014 at 10:23:50AM -0700, Bjorn Helgaas wrote: >On Wed, Nov 19, 2014 at 05:27:40PM +0800, Wei Yang wrote: >> On Tue, Nov 18, 2014 at 09:26:01PM -0700, Bjorn Helgaas wrote: >> >On Wed, Nov 19, 2014 at 11:21:00AM +0800, Wei Yang wrote: >> >> On Wed, Nov 19, 2014 at 01:15:32PM +1100, B

Re: [PATCH V9 03/18] PCI: Add weak pcibios_iov_resource_size() interface

2014-11-19 Thread Wei Yang
On Thu, Nov 20, 2014 at 07:51:40AM +1100, Benjamin Herrenschmidt wrote: >On Wed, 2014-11-19 at 10:23 -0700, Bjorn Helgaas wrote: >> >> Yes, I've read that many times. What's missing is the connection between a >> PE and the things in the PCI specs (buses, devices, functions, MMIO address >> space