Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1397119

[PATCH 1/4] staging: lustre: o2iblnd: limit cap.max_send_wr for MLX5

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 1/4] staging: lustre: o2iblnd: limit cap.max_send_wr for MLX5
Date 2016-05-09 17:00 +0200
Message-ID <rwUP9-7Fi-15@gated-at.bofh.it> (permalink)
References <rwUP7-7Fi-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Dmitry Eremin <dmitry.eremin@intel.com>

Decrease cap.max_send_wr until it is accepted by rdma_create_qp()

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7124
Reviewed-on: http://review.whamcloud.com/18347
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index d99b4fa..bc179a2 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -768,7 +768,12 @@ kib_conn_t *kiblnd_create_conn(kib_peer_t *peer, struct rdma_cm_id *cmid,
 
 	conn->ibc_sched = sched;
 
-	rc = rdma_create_qp(cmid, conn->ibc_hdev->ibh_pd, init_qp_attr);
+	do {
+		rc = rdma_create_qp(cmid, conn->ibc_hdev->ibh_pd, init_qp_attr);
+		if (!rc || init_qp_attr->cap.max_send_wr < 16)
+			break;
+	} while (rc);
+
 	if (rc) {
 		CERROR("Can't create QP: %d, send_wr: %d, recv_wr: %d\n",
 		       rc, init_qp_attr->cap.max_send_wr,
@@ -776,6 +781,10 @@ kib_conn_t *kiblnd_create_conn(kib_peer_t *peer, struct rdma_cm_id *cmid,
 		goto failed_2;
 	}
 
+	if (init_qp_attr->cap.max_send_wr != IBLND_SEND_WRS(conn))
+		CDEBUG(D_NET, "original send wr %d, created with %d\n",
+		       IBLND_SEND_WRS(conn), init_qp_attr->cap.max_send_wr);
+
 	LIBCFS_FREE(init_qp_attr, sizeof(*init_qp_attr));
 
 	/* 1 ref for caller and each rxmsg */
-- 
1.7.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] staging: lustre: small recent fixes for LNet/libcfs James Simmons <jsimmons@infradead.org> - 2016-05-09 17:00 +0200
  [PATCH 2/4] staging: lustre: o2iblnd: make rdma_create_id() support containers James Simmons <jsimmons@infradead.org> - 2016-05-09 17:00 +0200
  [PATCH 1/4] staging: lustre: o2iblnd: limit cap.max_send_wr for MLX5 James Simmons <jsimmons@infradead.org> - 2016-05-09 17:00 +0200
  [PATCH 4/4] staging: lustre: ko2iblnd: fix memory corruption with fragments James Simmons <jsimmons@infradead.org> - 2016-05-09 17:00 +0200
  [PATCH 3/4] staging: lustre: libcfs: fix memort leak in libcfs crypto layer James Simmons <jsimmons@infradead.org> - 2016-05-09 17:00 +0200

csiph-web