diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2006-05-24 16:16:06 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 19:57:06 -0800 |
commit | e9351ef948dd70aad4fbafbc1d4df724bd3e8e2c (patch) | |
tree | 20e9e2fda90912c1b9b04746490ecabca47780f8 | |
parent | 901de706050348abe52fea336e924aa3f002f9b8 (diff) | |
download | libmthca-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-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/srq.c | 36 |
2 files changed, 24 insertions, 18 deletions
@@ -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 @@ -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) { |