aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2007-07-17 21:07:44 -0700
committerRoland Dreier <rolandd@cisco.com>2007-07-17 21:07:44 -0700
commitaebd40033702fd80b1fe7f659c2bcbc7a5c76ab0 (patch)
tree5938f45dc67c4e4ef1575c4e75f80fafd3658e53
parent662a7652320c6c2cd986b2c61fea7efa7bd03939 (diff)
downloadlibmlx4-aebd40033702fd80b1fe7f659c2bcbc7a5c76ab0.tar.gz
Fill in send queue sizes in userspace query QP function
The kernel doesn't know the real size of the send queue so we have to fill in the info in userspace. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/verbs.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/verbs.c b/src/verbs.c
index 2243b6c..78dfabf 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -440,13 +440,25 @@ err:
return NULL;
}
-int mlx4_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
+int mlx4_query_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,
enum ibv_qp_attr_mask attr_mask,
struct ibv_qp_init_attr *init_attr)
{
struct ibv_query_qp cmd;
+ struct mlx4_qp *qp = to_mqp(ibqp);
+ int ret;
+
+ ret = ibv_cmd_query_qp(ibqp, attr, attr_mask, init_attr, &cmd, sizeof cmd);
+ if (ret)
+ return ret;
+
+ init_attr->cap.max_send_wr = qp->sq.max_post;
+ init_attr->cap.max_send_sge = qp->sq.max_gs;
+ init_attr->cap.max_inline_data = qp->max_inline_data;
- return ibv_cmd_query_qp(qp, attr, attr_mask, init_attr, &cmd, sizeof cmd);
+ attr->cap = init_attr->cap;
+
+ return 0;
}
int mlx4_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,