]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
IB/isert: allocate RW ctxs according to max IO size
authorMax Gurtovoy <maxg@mellanox.com>
Wed, 8 Jul 2020 09:19:08 +0000 (12:19 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 16 Jul 2020 17:23:22 +0000 (14:23 -0300)
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>
drivers/infiniband/ulp/isert/ib_isert.c
drivers/infiniband/ulp/isert/ib_isert.h

index b7df38ee8ae056585a08d9b756fae3d3dee3d895..49f5f053c7b20a026d06eda1bf6d5c3225918150 100644 (file)
@@ -119,7 +119,7 @@ isert_create_qp(struct isert_conn *isert_conn,
 {
        struct isert_device *device = isert_conn->device;
        struct ib_qp_init_attr attr;
-       int ret;
+       int ret, factor;
 
        memset(&attr, 0, sizeof(struct ib_qp_init_attr));
        attr.event_handler = isert_qp_event_callback;
@@ -128,7 +128,9 @@ isert_create_qp(struct isert_conn *isert_conn,
        attr.recv_cq = comp->cq;
        attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1;
        attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1;
-       attr.cap.max_rdma_ctxs = ISCSI_DEF_XMIT_CMDS_MAX;
+       factor = rdma_rw_mr_factor(device->ib_device, cma_id->port_num,
+                                  ISCSI_ISER_MAX_SG_TABLESIZE);
+       attr.cap.max_rdma_ctxs = ISCSI_DEF_XMIT_CMDS_MAX * factor;
        attr.cap.max_send_sge = device->ib_device->attrs.max_send_sge;
        attr.cap.max_recv_sge = 1;
        attr.sq_sig_type = IB_SIGNAL_REQ_WR;
index 3b296bac4f6039f356052e6110afc3016bd7b46e..c9ccf1d87833cc798cb1b2c7789d9bc8147348bf 100644 (file)
@@ -63,7 +63,8 @@
                (ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge) + \
                 sizeof(struct ib_cqe) + sizeof(bool)))
 
-#define ISCSI_ISER_SG_TABLESIZE                256
+/* Maximum support is 16MB I/O size */
+#define ISCSI_ISER_MAX_SG_TABLESIZE    4096
 
 enum isert_desc_type {
        ISCSI_TX_CONTROL,