Commit 84d8505e authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman

powerpc/powernv/sriov: Remove vfs_expanded

Previously iov->vfs_expanded was used for two purposes.

1) To work out how much we need to multiple the per-VF BAR size to figure
   out the total space required for the IOV BAR.

2) To indicate that IOV is not usable with this device (vfs_expanded == 0).

We don't really need the field for either since the multiple in 1) is
always the number PEs supported by the PHB. Similarly, we don't really need
it in 2) either since the IOV data field will be NULL if we can't use IOV
with the device.
Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200722065715.1432738-16-oohall@gmail.com
parent 4c51f3e1
...@@ -212,8 +212,6 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) ...@@ -212,8 +212,6 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev)
iov->need_shift = true; iov->need_shift = true;
} }
iov->vfs_expanded = mul;
return; return;
disable_iov: disable_iov:
...@@ -255,6 +253,7 @@ void pnv_pci_ioda_fixup_iov(struct pci_dev *pdev) ...@@ -255,6 +253,7 @@ void pnv_pci_ioda_fixup_iov(struct pci_dev *pdev)
resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev, resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
int resno) int resno)
{ {
struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus);
struct pnv_iov_data *iov = pnv_iov_get(pdev); struct pnv_iov_data *iov = pnv_iov_get(pdev);
resource_size_t align; resource_size_t align;
...@@ -266,8 +265,6 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev, ...@@ -266,8 +265,6 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
*/ */
if (!iov) if (!iov)
return align; return align;
if (!iov->vfs_expanded)
return align;
align = pci_iov_resource_size(pdev, resno); align = pci_iov_resource_size(pdev, resno);
...@@ -289,7 +286,7 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev, ...@@ -289,7 +286,7 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
* If the M64 BAR is in Single PE mode, return the VF BAR size or * If the M64 BAR is in Single PE mode, return the VF BAR size or
* M64 segment size if IOV BAR size is less. * M64 segment size if IOV BAR size is less.
*/ */
return iov->vfs_expanded * align; return phb->ioda.total_pe_num * align;
} }
static int pnv_pci_vf_release_m64(struct pci_dev *pdev, u16 num_vfs) static int pnv_pci_vf_release_m64(struct pci_dev *pdev, u16 num_vfs)
...@@ -707,7 +704,7 @@ static int pnv_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) ...@@ -707,7 +704,7 @@ static int pnv_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
return -ENXIO; return -ENXIO;
} }
if (!iov->vfs_expanded) { if (!iov) {
dev_info(&pdev->dev, "don't support this SRIOV device with non 64bit-prefetchable IOV BAR\n"); dev_info(&pdev->dev, "don't support this SRIOV device with non 64bit-prefetchable IOV BAR\n");
return -ENOSPC; return -ENOSPC;
} }
......
...@@ -234,9 +234,6 @@ void pnv_ioda_free_pe(struct pnv_ioda_pe *pe); ...@@ -234,9 +234,6 @@ void pnv_ioda_free_pe(struct pnv_ioda_pe *pe);
* and this structure is used to keep track of it all. * and this structure is used to keep track of it all.
*/ */
struct pnv_iov_data { struct pnv_iov_data {
/* number of VFs IOV BAR expanded. FIXME: rename this to something less bad */
u16 vfs_expanded;
/* number of VFs enabled */ /* number of VFs enabled */
u16 num_vfs; u16 num_vfs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment