RDMA/srpt: Reduce max_recv_sge to 1
authorBart Van Assche <bvanassche@acm.org>
Mon, 25 May 2020 17:22:11 +0000 (10:22 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 29 May 2020 17:49:55 +0000 (14:49 -0300)
Since srpt_post_recv() always sets num_sge to 1, reduce the max_recv_sge
parameter that is used at queue pair allocation time to 1.

Link: https://lore.kernel.org/r/20200525172212.14413-4-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/srpt/ib_srpt.c

index b96e91e..84f80f3 100644 (file)
@@ -1818,16 +1818,12 @@ retry:
        qp_init->cap.max_rdma_ctxs = sq_size / 2;
        qp_init->cap.max_send_sge = min(attrs->max_send_sge,
                                        SRPT_MAX_SG_PER_WQE);
-       qp_init->cap.max_recv_sge = min(attrs->max_recv_sge,
-                                       SRPT_MAX_SG_PER_WQE);
+       qp_init->cap.max_recv_sge = 1;
        qp_init->port_num = ch->sport->port;
-       if (sdev->use_srq) {
+       if (sdev->use_srq)
                qp_init->srq = sdev->srq;
-       } else {
+       else
                qp_init->cap.max_recv_wr = ch->rq_size;
-               qp_init->cap.max_recv_sge = min(attrs->max_recv_sge,
-                                               SRPT_MAX_SG_PER_WQE);
-       }
 
        if (ch->using_rdma_cm) {
                ret = rdma_create_qp(ch->rdma_cm.cm_id, sdev->pd, qp_init);