aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2005-11-29 17:43:08 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 19:57:04 -0800
commit8c27d04f7e2ef7d1ff5512645ba7c6c3d3f19ed0 (patch)
treeca7b3002ef355b0852e7ec1a0d65443ea07ff65b
parent2ef11fb07a1c6152bb7a921927ed9d3fad95e3f4 (diff)
downloadlibmthca-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.c29
-rw-r--r--src/wqe.h3
2 files changed, 29 insertions, 3 deletions
diff --git a/src/qp.c b/src/qp.c
index b06213a..9170b37 100644
--- a/src/qp.c
+++ b/src/qp.c
@@ -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);
diff --git a/src/wqe.h b/src/wqe.h
index 240a174..b9c3c29 100644
--- a/src/wqe.h
+++ b/src/wqe.h
@@ -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 {