IB/qib: Change lkey table allocation to support more MRs
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Tue, 21 Jul 2015 12:36:07 +0000 (08:36 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Oct 2015 02:46:07 +0000 (03:46 +0100)
commitcb463364d46787ddf6209db1b5c50386db221ba7
tree72fffe59569825edc26b72941dba8bf3a79b629b
parentff8c37e67a9b4a8e8442c601fc2a557f58d99c2c
IB/qib: Change lkey table allocation to support more MRs

commit d6f1c17e162b2a11e708f28fa93f2f79c164b442 upstream.

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

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>
[bwh: Backported to 3.2:
 - Adjust context
 - Add definition of qib_dev_warn(), added upstream by commit ddb887658970
   ("IB/qib: Convert opcode counters to per-context")]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/hw/qib/qib.h
drivers/infiniband/hw/qib/qib_keys.c
drivers/infiniband/hw/qib/qib_verbs.c
drivers/infiniband/hw/qib/qib_verbs.h