Skip to content

Commit 317000b

Browse files
Max Gurtovoyjgunthorpe
authored andcommitted
IB/isert: allocate RW ctxs according to max IO size
Current iSER target code allocates MR pool budget based on queue size. Since there is no handshake between iSER initiator and target on max IO size, we'll set the iSER target to support upto 16MiB IO operations and allocate the correct number of RDMA ctxs according to the factor of MR's per IO operation. This would guarantee sufficient size of the MR pool for the required IO queue depth and IO size. Link: https://lore.kernel.org/r/[email protected] Reported-by: Krishnamraju Eraparaju <[email protected]> Tested-by: Krishnamraju Eraparaju <[email protected]> Signed-off-by: Max Gurtovoy <[email protected]> Acked-by: Sagi Grimberg <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 0829d2d commit 317000b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/infiniband/ulp/isert/ib_isert.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ isert_create_qp(struct isert_conn *isert_conn,
119119
{
120120
struct isert_device *device = isert_conn->device;
121121
struct ib_qp_init_attr attr;
122-
int ret;
122+
int ret, factor;
123123

124124
memset(&attr, 0, sizeof(struct ib_qp_init_attr));
125125
attr.event_handler = isert_qp_event_callback;
@@ -128,7 +128,9 @@ isert_create_qp(struct isert_conn *isert_conn,
128128
attr.recv_cq = comp->cq;
129129
attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1;
130130
attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1;
131-
attr.cap.max_rdma_ctxs = ISCSI_DEF_XMIT_CMDS_MAX;
131+
factor = rdma_rw_mr_factor(device->ib_device, cma_id->port_num,
132+
ISCSI_ISER_MAX_SG_TABLESIZE);
133+
attr.cap.max_rdma_ctxs = ISCSI_DEF_XMIT_CMDS_MAX * factor;
132134
attr.cap.max_send_sge = device->ib_device->attrs.max_send_sge;
133135
attr.cap.max_recv_sge = 1;
134136
attr.sq_sig_type = IB_SIGNAL_REQ_WR;

drivers/infiniband/ulp/isert/ib_isert.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
(ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge) + \
6464
sizeof(struct ib_cqe) + sizeof(bool)))
6565

66-
#define ISCSI_ISER_SG_TABLESIZE 256
66+
/* Maximum support is 16MB I/O size */
67+
#define ISCSI_ISER_MAX_SG_TABLESIZE 4096
6768

6869
enum isert_desc_type {
6970
ISCSI_TX_CONTROL,

0 commit comments

Comments
 (0)