diff options
Diffstat (limited to 'drivers/infiniband/hw/mlx4/srq.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/srq.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c index 12fac1c8989d..408748fb5285 100644 --- a/drivers/infiniband/hw/mlx4/srq.c +++ b/drivers/infiniband/hw/mlx4/srq.c | |||
@@ -240,6 +240,24 @@ int mlx4_ib_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, | |||
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
242 | 242 | ||
243 | int mlx4_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr) | ||
244 | { | ||
245 | struct mlx4_ib_dev *dev = to_mdev(ibsrq->device); | ||
246 | struct mlx4_ib_srq *srq = to_msrq(ibsrq); | ||
247 | int ret; | ||
248 | int limit_watermark; | ||
249 | |||
250 | ret = mlx4_srq_query(dev->dev, &srq->msrq, &limit_watermark); | ||
251 | if (ret) | ||
252 | return ret; | ||
253 | |||
254 | srq_attr->srq_limit = be16_to_cpu(limit_watermark); | ||
255 | srq_attr->max_wr = srq->msrq.max - 1; | ||
256 | srq_attr->max_sge = srq->msrq.max_gs; | ||
257 | |||
258 | return 0; | ||
259 | } | ||
260 | |||
243 | int mlx4_ib_destroy_srq(struct ib_srq *srq) | 261 | int mlx4_ib_destroy_srq(struct ib_srq *srq) |
244 | { | 262 | { |
245 | struct mlx4_ib_dev *dev = to_mdev(srq->device); | 263 | struct mlx4_ib_dev *dev = to_mdev(srq->device); |