srp-target: Retry when QP creation fails with ENOMEM
authorBart Van Assche <bvanassche@acm.org>
Sun, 19 Oct 2014 15:05:33 +0000 (18:05 +0300)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:20 +0000 (17:05 +0800)
commit9aa66231c8d8efb13ced247c8e8096bcb52a7e86
tree0131b7e44d09514eb7c35894661351cb94a564e8
parent0def10217e7b768a501d2c51ea6d5ee4332afe69
srp-target: Retry when QP creation fails with ENOMEM

commit ab477c1ff5e0a744c072404bf7db51bfe1f05b6e upstream.

It is not guaranteed to that srp_sq_size is supported
by the HCA. So if we failed to create the QP with ENOMEM,
try with a smaller srp_sq_size. Keep it up until we hit
MIN_SRPT_SQ_SIZE, then fail the connection.

Reported-by: Mark Lehrer <lehrer@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/infiniband/ulp/srpt/ib_srpt.c