Commit b2001896 authored by Mustafa Ismail's avatar Mustafa Ismail Committed by Jason Gunthorpe
Browse files

RDMA/irdma: Fix Passthrough mode in VM

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: 8498a30e ("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: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 6702bc14
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1600,7 +1600,7 @@ static int irdma_initialize_dev(struct irdma_pci_f *rf)
	info.fpm_commit_buf = mem.va;

	info.bar0 = rf->hw.hw_addr;
	info.hmc_fn_id = PCI_FUNC(rf->pcidev->devfn);
	info.hmc_fn_id = rf->pf_id;
	info.hw = &rf->hw;
	status = irdma_sc_dev_init(rf->rdma_ver, &rf->sc_dev, &info);
	if (status)
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ static void i40iw_fill_device_info(struct irdma_device *iwdev, struct i40e_info
	rf->rdma_ver = IRDMA_GEN_1;
	rf->gen_ops.request_reset = i40iw_request_reset;
	rf->pcidev = cdev_info->pcidev;
	rf->pf_id = cdev_info->fid;
	rf->hw.hw_addr = cdev_info->hw_addr;
	rf->cdev = cdev_info;
	rf->msix_count = cdev_info->msix_count;
+1 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ static void irdma_fill_device_info(struct irdma_device *iwdev, struct ice_pf *pf
	rf->hw.hw_addr = pf->hw.hw_addr;
	rf->pcidev = pf->pdev;
	rf->msix_count =  pf->num_rdma_msix;
	rf->pf_id = pf->hw.pf_id;
	rf->msix_entries = &pf->msix_entries[pf->rdma_base_vector];
	rf->default_vsi.vsi_idx = vsi->vsi_num;
	rf->protocol_used = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ?
+1 −0
Original line number Diff line number Diff line
@@ -256,6 +256,7 @@ struct irdma_pci_f {
	u8 *mem_rsrc;
	u8 rdma_ver;
	u8 rst_to;
	u8 pf_id;
	enum irdma_protocol_used protocol_used;
	u32 sd_type;
	u32 msix_count;