aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srpt/ib_srpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/srpt/ib_srpt.c')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 7206547c13ce..dc829682701a 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2092,6 +2092,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
2092 if (!qp_init) 2092 if (!qp_init)
2093 goto out; 2093 goto out;
2094 2094
2095retry:
2095 ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch, 2096 ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch,
2096 ch->rq_size + srp_sq_size, 0); 2097 ch->rq_size + srp_sq_size, 0);
2097 if (IS_ERR(ch->cq)) { 2098 if (IS_ERR(ch->cq)) {
@@ -2115,6 +2116,13 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
2115 ch->qp = ib_create_qp(sdev->pd, qp_init); 2116 ch->qp = ib_create_qp(sdev->pd, qp_init);
2116 if (IS_ERR(ch->qp)) { 2117 if (IS_ERR(ch->qp)) {
2117 ret = PTR_ERR(ch->qp); 2118 ret = PTR_ERR(ch->qp);
2119 if (ret == -ENOMEM) {
2120 srp_sq_size /= 2;
2121 if (srp_sq_size >= MIN_SRPT_SQ_SIZE) {
2122 ib_destroy_cq(ch->cq);
2123 goto retry;
2124 }
2125 }
2118 printk(KERN_ERR "failed to create_qp ret= %d\n", ret); 2126 printk(KERN_ERR "failed to create_qp ret= %d\n", ret);
2119 goto err_destroy_cq; 2127 goto err_destroy_cq;
2120 } 2128 }