aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-05-24 16:16:06 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 19:57:06 -0800
commite9351ef948dd70aad4fbafbc1d4df724bd3e8e2c (patch)
tree20e9e2fda90912c1b9b04746490ecabca47780f8
parent901de706050348abe52fea336e924aa3f002f9b8 (diff)
downloadlibmthca-e9351ef948dd70aad4fbafbc1d4df724bd3e8e2c.tar.gz
Fix posting lists of 256 receive entries to SRQ on Tavor
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog6
-rw-r--r--src/srq.c36
2 files changed, 24 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 602372d..95255c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-24 Michael S. Tsirkin <mst@mellanox.co.il>
+
+ * src/srq.c (mthca_tavor_post_srq_recv): Fix posting of lists of
+ receives that have exactly a multiple of 256 entries (same as QP
+ bug fixed below).
+
2006-05-22 Roland Dreier <rdreier@cisco.com>
* configure.in, src/mthca.c (openib_driver_init): Check for the
diff --git a/src/srq.c b/src/srq.c
index c6b6e37..639b9d7 100644
--- a/src/srq.c
+++ b/src/srq.c
@@ -97,24 +97,7 @@ int mthca_tavor_post_srq_recv(struct ibv_srq *ibsrq,
first_ind = srq->first_free;
- for (nreq = 0; wr; ++nreq, wr = wr->next) {
- if (nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB) {
- nreq = 0;
-
- doorbell[0] = htonl(first_ind << srq->wqe_shift);
- doorbell[1] = htonl(srq->srqn << 8);
-
- /*
- * Make sure that descriptors are written
- * before doorbell is rung.
- */
- mb();
-
- mthca_write64(doorbell, to_mctx(ibsrq->context), MTHCA_RECV_DOORBELL);
-
- first_ind = srq->first_free;
- }
-
+ for (nreq = 0; wr; wr = wr->next) {
ind = srq->first_free;
if (ind < 0) {
@@ -172,6 +155,23 @@ int mthca_tavor_post_srq_recv(struct ibv_srq *ibsrq,
srq->wrid[ind] = wr->wr_id;
srq->first_free = next_ind;
+
+ if (++nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB) {
+ nreq = 0;
+
+ doorbell[0] = htonl(first_ind << srq->wqe_shift);
+ doorbell[1] = htonl(srq->srqn << 8);
+
+ /*
+ * Make sure that descriptors are written
+ * before doorbell is rung.
+ */
+ mb();
+
+ mthca_write64(doorbell, to_mctx(ibsrq->context), MTHCA_RECV_DOORBELL);
+
+ first_ind = srq->first_free;
+ }
}
if (nreq) {