diff options
author | Mike Marciniszyn | 2015-07-21 14:36:07 +0200 |
---|---|---|
committer | Doug Ledford | 2015-08-29 04:54:46 +0200 |
commit | d6f1c17e162b2a11e708f28fa93f2f79c164b442 (patch) | |
tree | aa1a64585e9a27ae91aeb8ae229ac4636162d297 /drivers/infiniband/hw/qib/qib_keys.c | |
parent | mlx5: Expose correct page_size_cap in device attributes (diff) | |
download | kernel-qcow2-linux-d6f1c17e162b2a11e708f28fa93f2f79c164b442.tar.gz kernel-qcow2-linux-d6f1c17e162b2a11e708f28fa93f2f79c164b442.tar.xz kernel-qcow2-linux-d6f1c17e162b2a11e708f28fa93f2f79c164b442.zip |
IB/qib: Change lkey table allocation to support more MRs
The lkey table is allocated with with a get_user_pages() with an
order based on a number of index bits from a module parameter.
The underlying kernel code cannot allocate that many contiguous pages.
There is no reason the underlying memory needs to be physically
contiguous.
This patch:
- switches the allocation/deallocation to vmalloc/vfree
- caps the number of bits to 23 to insure at least 1 generation bit
o this matches the module parameter description
Cc: stable@vger.kernel.org
Reviewed-by: Vinit Agnihotri <vinit.abhay.agnihotri@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_keys.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_keys.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index ad843c786e72..5afaa218508d 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c @@ -86,6 +86,10 @@ int qib_alloc_lkey(struct qib_mregion *mr, int dma_region) * unrestricted LKEY. */ rkt->gen++; + /* + * bits are capped in qib_verbs.c to insure enough bits + * for generation number + */ mr->lkey = (r << (32 - ib_qib_lkey_table_size)) | ((((1 << (24 - ib_qib_lkey_table_size)) - 1) & rkt->gen) << 8); |