Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/20200708091908.162263-1-maxg@mellanox.com
Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
Tested-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Max Gurtovoy and committed by
Jason Gunthorpe
317000b9 0829d2da

+6 -3
+4 -2
drivers/infiniband/ulp/isert/ib_isert.c
··· 119 119 { 120 120 struct isert_device *device = isert_conn->device; 121 121 struct ib_qp_init_attr attr; 122 - int ret; 122 + int ret, factor; 123 123 124 124 memset(&attr, 0, sizeof(struct ib_qp_init_attr)); 125 125 attr.event_handler = isert_qp_event_callback; ··· 128 128 attr.recv_cq = comp->cq; 129 129 attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1; 130 130 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; 132 134 attr.cap.max_send_sge = device->ib_device->attrs.max_send_sge; 133 135 attr.cap.max_recv_sge = 1; 134 136 attr.sq_sig_type = IB_SIGNAL_REQ_WR;
+2 -1
drivers/infiniband/ulp/isert/ib_isert.h
··· 63 63 (ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge) + \ 64 64 sizeof(struct ib_cqe) + sizeof(bool))) 65 65 66 - #define ISCSI_ISER_SG_TABLESIZE 256 66 + /* Maximum support is 16MB I/O size */ 67 + #define ISCSI_ISER_MAX_SG_TABLESIZE 4096 67 68 68 69 enum isert_desc_type { 69 70 ISCSI_TX_CONTROL,