diff options
author | Eli Cohen <eli@mellanox.co.il> | 2006-03-13 07:33:01 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-20 13:08:26 -0500 |
commit | fd02e8038eb943755e8727a0ea193c037a51714f (patch) | |
tree | 597dc0e67899c445ac85fc5b7ae8a151ca4491ee | |
parent | bfef73fa78ca1e56175dcbd33aa11de4764f85a5 (diff) |
IB/mthca: Query SRQ srq_limit fixes
Fix endianness handling of srq_limit: it is big-endian in the context
structure, so we need to swab it before returning it.
Also add support for srq_limit query for Tavor (non-MemFree) HCAs.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_srq.c | 12 |
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; |