diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2005-11-29 17:43:08 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 19:57:04 -0800 |
commit | 8c27d04f7e2ef7d1ff5512645ba7c6c3d3f19ed0 (patch) | |
tree | ca7b3002ef355b0852e7ec1a0d65443ea07ff65b | |
parent | 2ef11fb07a1c6152bb7a921927ed9d3fad95e3f4 (diff) | |
download | libmthca-8c27d04f7e2ef7d1ff5512645ba7c6c3d3f19ed0.tar.gz |
Fix posting send work request lists of length >= 255 on Arbel
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | src/qp.c | 29 | ||||
-rw-r--r-- | src/wqe.h | 3 |
2 files changed, 29 insertions, 3 deletions
@@ -425,6 +425,7 @@ int mthca_arbel_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, struct ibv_send_wr **bad_wr) { struct mthca_qp *qp = to_mqp(ibqp); + uint32_t doorbell[2]; void *wqe, *prev_wqe; int ind; int nreq; @@ -440,6 +441,32 @@ int mthca_arbel_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, ind = qp->sq.head & (qp->sq.max - 1); for (nreq = 0; wr; ++nreq, wr = wr->next) { + if (nreq == MTHCA_ARBEL_MAX_WQES_PER_SEND_DB) { + nreq = 0; + + doorbell[0] = htonl((MTHCA_ARBEL_MAX_WQES_PER_SEND_DB << 24) | + ((qp->sq.head & 0xffff) << 8) | f0 | op0); + doorbell[1] = htonl((ibqp->qp_num << 8) | size0); + + qp->sq.head += MTHCA_ARBEL_MAX_WQES_PER_SEND_DB; + + /* + * Make sure that descriptors are written before + * doorbell record. + */ + mb(); + *qp->sq.db = htonl(qp->sq.head & 0xffff); + + /* + * Make sure doorbell record is written before we + * write MMIO send doorbell. + */ + mb(); + mthca_write64(doorbell, to_mctx(ibqp->context), MTHCA_SEND_DOORBELL); + + size0 = 0; + } + if (wq_overflow(&qp->sq, nreq, to_mcq(qp->ibv_qp.send_cq))) { ret = -1; *bad_wr = wr; @@ -620,8 +647,6 @@ int mthca_arbel_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, out: if (nreq) { - uint32_t doorbell[2]; - doorbell[0] = htonl((nreq << 24) | ((qp->sq.head & 0xffff) << 8) | f0 | op0); @@ -55,7 +55,8 @@ enum { enum { MTHCA_INVAL_LKEY = 0x100, - MTHCA_TAVOR_MAX_WQES_PER_RECV_DB = 256 + MTHCA_TAVOR_MAX_WQES_PER_RECV_DB = 256, + MTHCA_ARBEL_MAX_WQES_PER_SEND_DB = 255 }; struct mthca_next_seg { |