Skip to contentSkip to conversation

iwch_create_cq off by one error

PATCH Applied Steve Wise 3 participants 6 messages Feb 29, 2008 – Mar 9, 2008 2 messages not in the archive

lore
Share & tools
lore

Steve Wise

author Acked-by
#1 lore raw
In reply to a message not in the archive
Quoted 26 lines · Jon Mason

The cxbg3 driver is unnecessarily decreasing the number of cq entries by one when creating a cq. This will cause an error of not having as many cqs as requested by the user, if the user requests a power of 2 cq length.

Thanks,
Jon

---
 drivers/infiniband/hw/cxgb3/iwch_provider.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/infiniband/hw/cxgb3/iwch_provider.c +1 -1
index f0c7775..800ef6d 100644
@@ -188,7 +188,7 @@ static struct ib_cq *iwch_create_cq(struct ib_device *ibdev, int entries, int ve
 		return ERR_PTR(-ENOMEM);
 	}
 	chp->rhp = rhp;
-	chp->ibcq.cqe = (1 << chp->cq.size_log2) - 1;
+	chp->ibcq.cqe = 1 << chp->cq.size_log2;
 	spin_lock_init(&chp->lock);
 	atomic_set(&chp->refcnt, 1);
 	init_waitqueue_head(&chp->wait);
author Acked-by
#6 lore raw

Re: [PATCH] update max_inline_data when creating a qp

In reply to a message not in the archive
Quoted 28 lines · Jon Mason

mthca modifies the attributes passed in when creating the qp to have (amongst other things) the max_inline_data. While cxgb3 does modify the attributes of some of the parameters, it does not modify the max_inline_data to be what the adapter supports. cxgb should conform to the same behavior as mthca (as some user space programs are expecting this) and return the max_inline_data.

---
 drivers/infiniband/hw/cxgb3/iwch_provider.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/infiniband/hw/cxgb3/iwch_provider.c +3 -0
index 800ef6d..5f0c9d3 100644
@@ -818,8 +818,11 @@ static struct ib_qp *iwch_create_qp(struct ib_pd *pd,
 		kfree(qhp);
 		return ERR_PTR(-ENOMEM);
 	}
+
 	attrs->cap.max_recv_wr = rqsize - 1;
 	attrs->cap.max_send_wr = sqsize;
+	attrs->cap.max_inline_data = T3_MAX_INLINE;
+
 	qhp->rhp = rhp;
 	qhp->attr.pd = php->pdid;
 	qhp->attr.scq = ((struct iwch_cq *) attrs->send_cq)->cq.cqid;
#7 lore raw

Re: [ofa-general] Re: [PATCH] update max_inline_data when creating a qp

thanks, applied

author
#2 lore raw
In reply to Steve Wise

Hey Roland,

Are you going to pull this one in?

Thanks,

Steve.

Quoted 38 lines · Steve Wise
Quoted 22 lines · Jon Mason

The cxbg3 driver is unnecessarily decreasing the number of cq entries by one when creating a cq. This will cause an error of not having as many cqs as requested by the user, if the user requests a power of 2 cq length.

Thanks,
Jon

---
 drivers/infiniband/hw/cxgb3/iwch_provider.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/infiniband/hw/cxgb3/iwch_provider.c +0 -0
index f0c7775..800ef6d 100644
@@ -188,7 +188,7 @@ static struct ib_cq *iwch_create_cq(struct 

ib_device *ibdev, int entries, int ve

         return ERR_PTR(-ENOMEM);
     }
     chp->rhp = rhp;

drivers/infiniband/hw/cxgb3/iwch_provider.c

Quoted 5 lines
drivers/infiniband/hw/cxgb3/iwch_provider.c +1 -1
-    chp->ibcq.cqe = (1 << chp->cq.size_log2) - 1;
+    chp->ibcq.cqe = 1 << chp->cq.size_log2;
     spin_lock_init(&chp->lock);
     atomic_set(&chp->refcnt, 1);
     init_waitqueue_head(&chp->wait);

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

#3 lore raw
Quoted 1 line

Are you going to pull this one in?

Yeah... I'm on vacation for the week but I'll get it next week.