+ if (peer_ni->ibp_queue_depth_mod &&
+ peer_ni->ibp_queue_depth_mod < peer_ni->ibp_queue_depth) {
+ conn->ibc_queue_depth = peer_ni->ibp_queue_depth_mod;
+ CDEBUG(D_NET, "Use reduced queue depth %u (from %u)\n",
+ peer_ni->ibp_queue_depth_mod,
+ peer_ni->ibp_queue_depth);
+ }
+
+ do {
+ /* kiblnd_send_wrs() can change the connection's queue depth if
+ * the maximum work requests for the device is maxed out
+ */
+ init_qp_attr.cap.max_send_wr = kiblnd_send_wrs(conn);
+ init_qp_attr.cap.max_recv_wr = IBLND_RECV_WRS(conn);
+ rc = rdma_create_qp(cmid, conn->ibc_hdev->ibh_pd,
+ &init_qp_attr);
+ if (rc != -ENOMEM || conn->ibc_queue_depth < 2)
+ break;
+ conn->ibc_queue_depth--;
+ } while (rc);
+