Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/ipath: Fix ib_ipath driver to work with SRP

I am still working on a proposal to remove the phys_to_virt() calls
in the ib_ipath driver. In the mean time, this patch allows SRP
to work by fixing the R_Key check and conversion from IB address
to kernel virtual address. It also returns the correct page size
for FMRs.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Ralph Campbell and committed by
Roland Dreier
c9f79bdc 3d37b9e2

+16
+15
drivers/infiniband/hw/ipath/ipath_keys.c
··· 197 197 size_t off; 198 198 int ret; 199 199 200 + /* 201 + * We use RKEY == zero for physical addresses 202 + * (see ipath_get_dma_mr). 203 + */ 204 + if (rkey == 0) { 205 + sge->mr = NULL; 206 + sge->vaddr = phys_to_virt(vaddr); 207 + sge->length = len; 208 + sge->sge_length = len; 209 + ss->sg_list = NULL; 210 + ss->num_sge = 1; 211 + ret = 1; 212 + goto bail; 213 + } 214 + 200 215 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; 201 216 if (unlikely(mr == NULL || mr->lkey != rkey)) { 202 217 ret = 0;
+1
drivers/infiniband/hw/ipath/ipath_verbs.c
··· 627 627 props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | 628 628 IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | 629 629 IB_DEVICE_SYS_IMAGE_GUID; 630 + props->page_size_cap = PAGE_SIZE; 630 631 props->vendor_id = ipath_layer_get_vendorid(dev->dd); 631 632 props->vendor_part_id = ipath_layer_get_deviceid(dev->dd); 632 633 props->hw_ver = ipath_layer_get_pcirev(dev->dd);