aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index 96fcc64c61cd..47a6a754a591 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -49,7 +49,8 @@ struct mthca_tavor_srq_context {
49 __be32 state_pd; 49 __be32 state_pd;
50 __be32 lkey; 50 __be32 lkey;
51 __be32 uar; 51 __be32 uar;
52 __be32 wqe_cnt; 52 __be16 limit_watermark;
53 __be16 wqe_cnt;
53 u32 reserved[2]; 54 u32 reserved[2];
54}; 55};
55 56
@@ -369,6 +370,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
369 struct mthca_srq *srq = to_msrq(ibsrq); 370 struct mthca_srq *srq = to_msrq(ibsrq);
370 struct mthca_mailbox *mailbox; 371 struct mthca_mailbox *mailbox;
371 struct mthca_arbel_srq_context *arbel_ctx; 372 struct mthca_arbel_srq_context *arbel_ctx;
373 struct mthca_tavor_srq_context *tavor_ctx;
372 u8 status; 374 u8 status;
373 int err; 375 int err;
374 376
@@ -382,9 +384,11 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
382 384
383 if (mthca_is_memfree(dev)) { 385 if (mthca_is_memfree(dev)) {
384 arbel_ctx = mailbox->buf; 386 arbel_ctx = mailbox->buf;
385 srq_attr->srq_limit = arbel_ctx->limit_watermark; 387 srq_attr->srq_limit = be16_to_cpu(arbel_ctx->limit_watermark);
386 } else 388 } else {
387 srq_attr->srq_limit = 0; 389 tavor_ctx = mailbox->buf;
390 srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark);
391 }
388 392
389 srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; 393 srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max;
390 srq_attr->max_sge = srq->max_gs; 394 srq_attr->max_sge = srq->max_gs;