IB/iser: Accept session->cmds_max from user space
authorShlomo Pongratz <shlomop@mellanox.com>
Sun, 28 Jul 2013 09:35:38 +0000 (12:35 +0300)
committerRoland Dreier <roland@purestorage.com>
Sat, 10 Aug 2013 00:18:08 +0000 (17:18 -0700)
commitb7f04513090cf12394de27588a1956d1f97188cb
tree26a57432c8ee96d556ccf824b11d0d4120d1f4e3
parent986db0d6c08125bdf50d8ffdc3b0307aa2871e3e
IB/iser: Accept session->cmds_max from user space

Use cmds_max passed from user space to be the number of PDUs to be
supported for the session instead of hard-coded ISCSI_DEF_XMIT_CMDS_MAX.
This allow controlling the max number of SCSI commands for the session.
Also don't ignore the qdepth passed from user space.

Derive from session->cmds_max the actual number of RX buffers and FMR
pool size to allocate during the connection bind phase.

Since the iser transport connection is established before the iscsi
session/connection are created and bound, we still use one hard-coded
quantity ISER_DEF_XMIT_CMDS_MAX to compute the maximum number of
work-requests to be supported by the RC QP used for the connection.

The above quantity is made to be a power of two between ISCSI_TOTAL_CMDS_MIN
(16) and ISER_DEF_XMIT_CMDS_MAX (512) inclusive.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/infiniband/ulp/iser/iscsi_iser.h
drivers/infiniband/ulp/iser/iser_initiator.c
drivers/infiniband/ulp/iser/iser_verbs.c