<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/iov.c, branch linux-4.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-02-19T22:28:27Z</updated>
<entry>
<title>PCI: Set SR-IOV NumVFs to zero after enumeration</title>
<updated>2016-02-19T22:28:27Z</updated>
<author>
<name>Alexander Duyck</name>
</author>
<published>2015-10-29T21:20:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16a7fccaff5101c80f52b799728a0cbbd2892b12'/>
<id>urn:sha1:16a7fccaff5101c80f52b799728a0cbbd2892b12</id>
<content type='text'>
commit ea9a8854161d9580cfabe011c0ae296ecc0e1d4f upstream.

The enumeration path should leave NumVFs set to zero.  But after
4449f079722c ("PCI: Calculate maximum number of buses required for VFs"),
we call virtfn_max_buses() in the enumeration path, which changes NumVFs.
This NumVFs change is visible via lspci and sysfs until a driver enables
SR-IOV.

Iterate from TotalVFs down to zero so NumVFs is zero when we're finished
computing the maximum number of buses.  Validate offset and stride in
the loop, so we can test it at every possible NumVFs setting.  Rename
virtfn_max_buses() to compute_max_vf_buses() to hint that it does have a
side effect of updating iov-&gt;max_VF_buses.

[bhelgaas: changelog, rename, allow numVF==1 &amp;&amp; stride==0, rework loop,
reverse sense of error path]
Fixes: 4449f079722c ("PCI: Calculate maximum number of buses required for VFs")
Based-on-patch-by: Ethan Zhao &lt;ethan.zhao@oracle.com&gt;
Signed-off-by: Alexander Duyck &lt;aduyck@mirantis.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PCI: Add pcibios_iov_resource_alignment() interface</title>
<updated>2015-03-31T02:02:36Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=978d2d68312326b715a5913aaab1eaf24fe99108'/>
<id>urn:sha1:978d2d68312326b715a5913aaab1eaf24fe99108</id>
<content type='text'>
Per the SR-IOV spec r1.1, sec 3.3.14, the required alignment of a PF's IOV
BAR is the size of an individual VF BAR, and the size consumed is the
individual VF BAR size times NumVFs.

The PowerNV platform has additional alignment requirements to help support
its Partitionable Endpoint device isolation feature (see
Documentation/powerpc/pci_iov_resource_on_powernv.txt).

Add a pcibios_iov_resource_alignment() interface to allow platforms to
request additional alignment.

[bhelgaas: changelog, adapt to reworked pci_sriov_resource_alignment(),
drop "align" parameter]
Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Add pcibios_sriov_enable() and pcibios_sriov_disable()</title>
<updated>2015-03-31T02:02:36Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=995df527f3990d91fe8f3d7d1917a7adc3938320'/>
<id>urn:sha1:995df527f3990d91fe8f3d7d1917a7adc3938320</id>
<content type='text'>
VFs are dynamically created when a driver enables them.  On some platforms,
like PowerNV, special resources are necessary to enable VFs.

Add platform hooks for enabling and disabling VFs.

Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Export pci_iov_virtfn_bus() and pci_iov_virtfn_devfn()</title>
<updated>2015-03-31T02:02:36Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b07579c0924eee1543eb6cd2c19544d15a4b5236'/>
<id>urn:sha1:b07579c0924eee1543eb6cd2c19544d15a4b5236</id>
<content type='text'>
On PowerNV, some resource reservation is needed for SR-IOV VFs that don't
exist at the bootup stage.  To do the match between resources and VFs, the
code need to get the VF's BDF in advance.

Rename virtfn_bus() and virtfn_devfn() to pci_iov_virtfn_bus() and
pci_iov_virtfn_devfn() and export them.

[bhelgaas: changelog, make "busnr" int]
Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Calculate maximum number of buses required for VFs</title>
<updated>2015-03-31T02:02:36Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4449f079722c86d2f6925da039835acdd8e973a8'/>
<id>urn:sha1:4449f079722c86d2f6925da039835acdd8e973a8</id>
<content type='text'>
An SR-IOV device can change its First VF Offset and VF Stride based on the
values of ARI Capable Hierarchy and NumVFs.  The number of buses required
for all VFs is determined by NumVFs, First VF Offset, and VF Stride (see
SR-IOV spec r1.1, sec 2.1.2).

Previously pci_iov_bus_range() computed how many buses would be required by
TotalVFs, but this was based on a single NumVFs value and may not have been
the maximum for all NumVFs configurations.

Iterate over all valid NumVFs and calculate the maximum number of bus
numbers that could ever be required for VFs of this device.

[bhelgaas: changelog, compute busnr of NumVFs, not TotalVFs, remove
kerenl-doc comment marker]
Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Refresh First VF Offset and VF Stride when updating NumVFs</title>
<updated>2015-03-31T02:02:36Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f59dca27d20c73500c4a88ab9a077e40669755db'/>
<id>urn:sha1:f59dca27d20c73500c4a88ab9a077e40669755db</id>
<content type='text'>
The First VF Offset and VF Stride fields depend on the NumVFs setting, so
refresh the cached fields in struct pci_sriov when updating NumVFs.  See
the SR-IOV spec r1.1, sec 3.3.9 and 3.3.10.

[bhelgaas: changelog, remove kernel-doc comment marker]
Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Index IOV resources in the conventional style</title>
<updated>2015-03-31T02:02:36Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2015-03-25T08:23:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1fe1f96e30d31cc99826f19a058d9e9eef87712'/>
<id>urn:sha1:c1fe1f96e30d31cc99826f19a058d9e9eef87712</id>
<content type='text'>
Most of PCI uses "res = &amp;dev-&gt;resource[i]", not "res = dev-&gt;resource + i".
Use that style in iov.c also.

No functional change.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Keep individual VF BAR size in struct pci_sriov</title>
<updated>2015-03-31T02:02:35Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e6c9122a6ec96d19f1db61e9750287d86b6829c'/>
<id>urn:sha1:0e6c9122a6ec96d19f1db61e9750287d86b6829c</id>
<content type='text'>
Currently we don't store the individual VF BAR size.  We calculate it when
needed by dividing the PF's IOV resource size (which contains space for
*all* the VFs) by total_VFs or by reading the BAR in the SR-IOV capability
again.

Keep the individual VF BAR size in struct pci_sriov.barsz[], add
pci_iov_resource_size() to retrieve it, and use that instead of doing the
division or reading the SR-IOV capability BAR.

[bhelgaas: rename to "barsz[]", simplify barsz[] index computation, remove
SR-IOV capability BAR sizing]
Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Print PF SR-IOV resource that contains all VF(n) BAR space</title>
<updated>2015-03-31T02:02:35Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2015-03-25T08:23:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e88ae01d2c43be3c3a6f340bfa7bab8b87127f57'/>
<id>urn:sha1:e88ae01d2c43be3c3a6f340bfa7bab8b87127f57</id>
<content type='text'>
When we size VF BAR0, VF BAR1, etc., from the SR-IOV Capability of a PF, we
learn the alignment requirement and amount of space consumed by a single
VF.  But when VFs are enabled, *each* of the NumVFs consumes that amount of
space, so the total size of the PF resource is "VF BAR size * NumVFs".

Add a printk of the total space consumed by the VFs corresponding to what
we already do for normal non-IOV BARs.

No functional change; new message only.

[bhelgaas: split out into its own patch]
Signed-off-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>PCI: Print more info in sriov_enable() error message</title>
<updated>2015-03-31T02:02:35Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2015-03-25T08:23:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68f8e9fa56ce6b5cb18323e8d8fa536fee0f89ca'/>
<id>urn:sha1:68f8e9fa56ce6b5cb18323e8d8fa536fee0f89ca</id>
<content type='text'>
If we don't have space for all the bus numbers required to enable VFs,
print the largest bus number required and the range available.

No functional change; improved error message only.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Wei Yang &lt;weiyang@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
</feed>
