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

IB/{qib, hfi1, rdmavt}: Correct ibv_devinfo max_mr value

The command 'ibv_devinfo -v' reports 0 for max_mr.

Fix by assigning the query values after the mr lkey_table has been built
rather than early on in the driver.

Fixes: 7b1e2099adc8 ("IB/rdmavt: Move memory registration into rdmavt")
Reviewed-by: Josh Collier <josh.d.collier@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Mike Marciniszyn and committed by
Jason Gunthorpe
35164f52 6d517353

+2 -4
-2
drivers/infiniband/hw/hfi1/verbs.c
··· 1356 1356 rdi->dparms.props.max_cq = hfi1_max_cqs; 1357 1357 rdi->dparms.props.max_ah = hfi1_max_ahs; 1358 1358 rdi->dparms.props.max_cqe = hfi1_max_cqes; 1359 - rdi->dparms.props.max_mr = rdi->lkey_table.max; 1360 - rdi->dparms.props.max_fmr = rdi->lkey_table.max; 1361 1359 rdi->dparms.props.max_map_per_fmr = 32767; 1362 1360 rdi->dparms.props.max_pd = hfi1_max_pds; 1363 1361 rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC;
-2
drivers/infiniband/hw/qib/qib_verbs.c
··· 1459 1459 rdi->dparms.props.max_cq = ib_qib_max_cqs; 1460 1460 rdi->dparms.props.max_cqe = ib_qib_max_cqes; 1461 1461 rdi->dparms.props.max_ah = ib_qib_max_ahs; 1462 - rdi->dparms.props.max_mr = rdi->lkey_table.max; 1463 - rdi->dparms.props.max_fmr = rdi->lkey_table.max; 1464 1462 rdi->dparms.props.max_map_per_fmr = 32767; 1465 1463 rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC; 1466 1464 rdi->dparms.props.max_qp_init_rd_atom = 255;
+2
drivers/infiniband/sw/rdmavt/mr.c
··· 96 96 for (i = 0; i < rdi->lkey_table.max; i++) 97 97 RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL); 98 98 99 + rdi->dparms.props.max_mr = rdi->lkey_table.max; 100 + rdi->dparms.props.max_fmr = rdi->lkey_table.max; 99 101 return 0; 100 102 } 101 103