Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f5eb9bb8c7fb3bd411674b856872d7ab4a7b1a3
Commit:     7f5eb9bb8c7fb3bd411674b856872d7ab4a7b1a3
Parent:     c9f2ba5ed26a204a78bf23aa08a4f528f11a18f4
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 17 20:59:02 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Jul 17 20:59:02 2007 -0700

    IB/mlx4: Return receive queue sizes for userspace QPs from query QP
    
    Return the receive queue sizes for both userspace QPs and kernel Qps
    (not just kernel QPs) from mlx4_ib_query_qp().  Also zero the send
    queue sizes for userspace QPs to avoid a possible information leak,
    and set the max_inline_data for kernel QPs to 0 since inline sends are
    not supported for kernel QPs.
    
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/qp.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 0793059..8d09aa3 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1581,17 +1581,25 @@ int mlx4_ib_query_qp(struct ib_qp *ibqp, struct 
ib_qp_attr *qp_attr, int qp_attr
 
 done:
        qp_attr->cur_qp_state        = qp_attr->qp_state;
+       qp_attr->cap.max_recv_wr     = qp->rq.wqe_cnt;
+       qp_attr->cap.max_recv_sge    = qp->rq.max_gs;
+
        if (!ibqp->uobject) {
-               qp_attr->cap.max_send_wr     = qp->sq.wqe_cnt;
-               qp_attr->cap.max_recv_wr     = qp->rq.wqe_cnt;
-               qp_attr->cap.max_send_sge    = qp->sq.max_gs;
-               qp_attr->cap.max_recv_sge    = qp->rq.max_gs;
-               qp_attr->cap.max_inline_data = (1 << qp->sq.wqe_shift) -
-                       send_wqe_overhead(qp->ibqp.qp_type) -
-                       sizeof (struct mlx4_wqe_inline_seg);
-               qp_init_attr->cap            = qp_attr->cap;
+               qp_attr->cap.max_send_wr  = qp->sq.wqe_cnt;
+               qp_attr->cap.max_send_sge = qp->sq.max_gs;
+       } else {
+               qp_attr->cap.max_send_wr  = 0;
+               qp_attr->cap.max_send_sge = 0;
        }
 
+       /*
+        * We don't support inline sends for kernel QPs (yet), and we
+        * don't know what userspace's value should be.
+        */
+       qp_attr->cap.max_inline_data = 0;
+
+       qp_init_attr->cap            = qp_attr->cap;
+
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to