IB/ehca: Prevent sending UD packets to QP0
[linux-2.6] / drivers / infiniband / hw / mlx4 / srq.c
index 12fac1c..e7e9a3d 100644 (file)
@@ -240,6 +240,24 @@ int mlx4_ib_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
        return 0;
 }
 
+int mlx4_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
+{
+       struct mlx4_ib_dev *dev = to_mdev(ibsrq->device);
+       struct mlx4_ib_srq *srq = to_msrq(ibsrq);
+       int ret;
+       int limit_watermark;
+
+       ret = mlx4_srq_query(dev->dev, &srq->msrq, &limit_watermark);
+       if (ret)
+               return ret;
+
+       srq_attr->srq_limit = limit_watermark;
+       srq_attr->max_wr    = srq->msrq.max - 1;
+       srq_attr->max_sge   = srq->msrq.max_gs;
+
+       return 0;
+}
+
 int mlx4_ib_destroy_srq(struct ib_srq *srq)
 {
        struct mlx4_ib_dev *dev = to_mdev(srq->device);