powerpc/powernv/sriov: Drop iov->pe_num_map[]
authorOliver O'Halloran <oohall@gmail.com>
Wed, 22 Jul 2020 06:57:10 +0000 (16:57 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 26 Jul 2020 13:34:23 +0000 (23:34 +1000)
commitd29a2488d2c020032fdb1fe052347a6021e3591d
tree1e88fdd679229f17a60192417300594d8faee655
parenta4bc676ed5c3f53781cc342b73097eb7e8d43fa5
powerpc/powernv/sriov: Drop iov->pe_num_map[]

Currently the iov->pe_num_map[] does one of two things depending on
whether single PE mode is being used or not. When it is, this contains an
array which maps a vf_index to the corresponding PE number. When single PE
mode is not being used this contains a scalar which is the base PE for the
set of enabled VFs (for for VFn is base + n).

The array was necessary because when calling pnv_ioda_alloc_pe() there is
no guarantee that the allocated PEs would be contigious. We can now
allocate contigious blocks of PEs so this is no longer an issue. This
allows us to drop the if (single_mode) {} .. else {} block scattered
through the SR-IOV code which is a nice clean up.

This also fixes a bug in pnv_pci_sriov_disable() which is the non-atomic
bitmap_clear() to manipulate the PE allocation map. Other users of the map
assume it will be accessed with atomic ops.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200722065715.1432738-11-oohall@gmail.com
arch/powerpc/platforms/powernv/pci-sriov.c
arch/powerpc/platforms/powernv/pci.h