[ofa-general] [PATCH 2 of 2] libmlx4: implement query_qp
Jack Morgenstein
jackm at dev.mellanox.co.il
Thu Jun 21 02:29:08 PDT 2007
For query-qp, fill in qp capabilities from user-space qp object.
Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>
Index: a/src/verbs.c
===================================================================
--- a/src/verbs.c 2007-06-18 09:33:04.000000000 +0300
+++ a/src/verbs.c 2007-06-18 17:10:23.000000000 +0300
@@ -445,8 +445,21 @@
struct ibv_qp_init_attr *init_attr)
{
struct ibv_query_qp cmd;
+ struct mlx4_qp *mqp;
+ int ret;
+
+ ret = ibv_cmd_query_qp(qp, attr, attr_mask, init_attr, &cmd, sizeof cmd);
+ if (ret)
+ return ret;
+ mqp = to_mqp(qp);
+ init_attr->cap.max_send_wr = mqp->sq.max_post;
+ init_attr->cap.max_send_sge = mqp->sq.max_gs;
+ init_attr->cap.max_recv_wr = mqp->rq.max_post;
+ init_attr->cap.max_recv_sge = mqp->rq.max_gs;
+ init_attr->cap.max_inline_data = mqp->max_inline_data;
+ attr->cap = init_attr->cap;
- return ibv_cmd_query_qp(qp, attr, attr_mask, init_attr, &cmd, sizeof cmd);
+ return 0;
}
int mlx4_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
More information about the general
mailing list