[ofa-general] Re: [PATCH 2 of 2] libmlx4: implement query_qp

Jack Morgenstein jackm at dev.mellanox.co.il
Sun Jul 15 00:58:55 PDT 2007


On Friday 13 July 2007 01:43, Roland Dreier wrote:
>  > +	init_attr->cap.max_recv_wr =  mqp->rq.max_post;
>  > +	init_attr->cap.max_recv_sge =  mqp->rq.max_gs;
> 
> Why do we have to reset these in userspace?  Doesn't the kernel
> already give us correct info for the receive queue?
> 
>  - R.
> 
I just thought it was cleaner to have kernel-space deal with kernel-space
qp capabilities, and user-space deal with user-space qp capabilities
(and not split things between sq capabilities -- which do require user-space-only
info -- and rq capabilities, which do not).

Thus, in the kernel-space patch, at the end of procedure mlx4_ib_query_qp(), in file
drivers/infiniband/hw/mlx4/qp.c, I have:

+       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;
+       }

If you wish to have the kernel return max_recv_wr and max_recv_sge, you will need
to change the above code snippet, and move the max_recv_wr and max_recv_sge assignments
outside the "if".

- Jack




More information about the general mailing list