From 85ac2c728b91ac752f92122f68c29d4bf11c4075 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 25 Jun 2011 19:32:32 +0000 Subject: [PATCH] ib_srpt: Works again on mthca (not tested yet). A quote from the OFED 1.2.5 release notes (docs/mthca_release_notes.txt), section "3. Known Issues": 3. In mem-free devices, RC QPs can be created with a maximum of (max_sge - 3) entries only. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3627 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 50970ca6a..50566bc48 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2008,8 +2008,8 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) qp_init->sq_sig_type = IB_SIGNAL_REQ_WR; qp_init->qp_type = IB_QPT_RC; qp_init->cap.max_send_wr = srpt_sq_size; - ch->max_sge = sdev->dev_attr.max_sge - 2; - BUG_ON(ch->max_sge <= 2); + ch->max_sge = sdev->dev_attr.max_sge - 3; + BUG_ON(ch->max_sge < 1); qp_init->cap.max_send_sge = ch->max_sge; ch->qp = ib_create_qp(sdev->pd, qp_init);