IB/srp: Prevent mapping failures
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 12 May 2016 17:50:35 +0000 (10:50 -0700)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 17:46:51 +0000 (13:46 -0400)
commit509c5f33f4f6dc328d96bf4099ef6589739f22d4
tree4ed2e3b56ebdcf5976c5427c8de1539c211e5826
parent835ee624c99d0b63797babf25abe208182bb88bf
IB/srp: Prevent mapping failures

If both max_sectors and the queue_depth are high enough it can
happen that the MR pool is depleted temporarily. This causes
the SRP initiator to report mapping failures. Although the SRP
initiator recovers from such mapping failures, prevent that
this can happen by allocating more memory regions.

Additionally, only enable memory registration if at least two
pages can be registered per memory region.

Reported-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srp/ib_srp.c
drivers/infiniband/ulp/srp/ib_srp.h