RDMA/irdma: Fix Passthrough mode in VM
authorMustafa Ismail <mustafa.ismail@intel.com>
Fri, 25 Feb 2022 16:32:10 +0000 (10:32 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:36 +0000 (14:23 +0200)
commita0051c05312e205bb29d1519d641739e7638cde6
tree607fb739798ecc6e28123023bf7fe2a3f3b2d83f
parent5e96bb45c9363c5329399e7c369aba21494e7591
RDMA/irdma: Fix Passthrough mode in VM

[ Upstream commit b200189626b5cefbaf8be9cadd7a28215e065bb9 ]

Using PCI_FUNC macro in a VM, when the device is in passthrough mode does
not provide the real function instance. This means that currently, devices
will not probe unless the instance in the VM matches the instance in the
host.

Fix this by getting the pf_id from the LAN during the probe.

Fixes: 8498a30e1b94 ("RDMA/irdma: Register auxiliary driver and implement private channel OPs")
Link: https://lore.kernel.org/r/20220225163211.127-3-shiraz.saleem@intel.com
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/irdma/hw.c
drivers/infiniband/hw/irdma/i40iw_if.c
drivers/infiniband/hw/irdma/main.c
drivers/infiniband/hw/irdma/main.h