aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_srq.c
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.co.il>2006-02-13 19:40:21 -0500
committerRoland Dreier <rolandd@cisco.com>2006-03-20 13:08:15 -0500
commit8ebe5077e37a0cb0da527e397460188e6bfdd3ee (patch)
tree401491fb7a94516dfbeeee027d8eeb294117cb5b /drivers/infiniband/hw/mthca/mthca_srq.c
parent8bdb0e8632e0f5061bd18b6934346cb609490135 (diff)
IB/mthca: Support for query QP and SRQ
Implement the query_qp and query_srq methods in mthca. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_srq.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index f1a1da147d0b..deb526ce013d 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -360,6 +360,38 @@ int mthca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
360 return 0; 360 return 0;
361} 361}
362 362
363int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
364{
365 struct mthca_dev *dev = to_mdev(ibsrq->device);
366 struct mthca_srq *srq = to_msrq(ibsrq);
367 struct mthca_mailbox *mailbox;
368 struct mthca_arbel_srq_context *arbel_ctx;
369 u8 status;
370 int err;
371
372 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
373 if (IS_ERR(mailbox))
374 return PTR_ERR(mailbox);
375
376 err = mthca_QUERY_SRQ(dev, srq->srqn, mailbox, &status);
377 if (err)
378 goto out;
379
380 if (mthca_is_memfree(dev)) {
381 arbel_ctx = mailbox->buf;
382 srq_attr->srq_limit = arbel_ctx->limit_watermark;
383 } else
384 srq_attr->srq_limit = 0;
385
386 srq_attr->max_wr = srq->max;
387 srq_attr->max_sge = srq->max_gs;
388
389out:
390 mthca_free_mailbox(dev, mailbox);
391
392 return err;
393}
394
363void mthca_srq_event(struct mthca_dev *dev, u32 srqn, 395void mthca_srq_event(struct mthca_dev *dev, u32 srqn,
364 enum ib_event_type event_type) 396 enum ib_event_type event_type)
365{ 397{