Commit 0540d814 authored by Noa Osherovich's avatar Noa Osherovich Committed by Doug Ledford

IB/mlx5: Fix returned values of query QP

Some variables were not initialized properly: max_recv_wr,
max_recv_sge, max_send_wr, qp_context and max_inline_data.

Fixes: e126ba97 ('mlx5: Add driver for Mellanox Connect-IB...')
Signed-off-by: default avatarNoa Osherovich <noaos@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent bc5c6eed
...@@ -235,6 +235,8 @@ static int set_rq_size(struct mlx5_ib_dev *dev, struct ib_qp_cap *cap, ...@@ -235,6 +235,8 @@ static int set_rq_size(struct mlx5_ib_dev *dev, struct ib_qp_cap *cap,
qp->rq.max_gs = 0; qp->rq.max_gs = 0;
qp->rq.wqe_cnt = 0; qp->rq.wqe_cnt = 0;
qp->rq.wqe_shift = 0; qp->rq.wqe_shift = 0;
cap->max_recv_wr = 0;
cap->max_recv_sge = 0;
} else { } else {
if (ucmd) { if (ucmd) {
qp->rq.wqe_cnt = ucmd->rq_wqe_count; qp->rq.wqe_cnt = ucmd->rq_wqe_count;
...@@ -4079,17 +4081,19 @@ int mlx5_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, ...@@ -4079,17 +4081,19 @@ int mlx5_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
qp_attr->cap.max_recv_sge = qp->rq.max_gs; qp_attr->cap.max_recv_sge = qp->rq.max_gs;
if (!ibqp->uobject) { if (!ibqp->uobject) {
qp_attr->cap.max_send_wr = qp->sq.wqe_cnt; qp_attr->cap.max_send_wr = qp->sq.max_post;
qp_attr->cap.max_send_sge = qp->sq.max_gs; qp_attr->cap.max_send_sge = qp->sq.max_gs;
qp_init_attr->qp_context = ibqp->qp_context;
} else { } else {
qp_attr->cap.max_send_wr = 0; qp_attr->cap.max_send_wr = 0;
qp_attr->cap.max_send_sge = 0; qp_attr->cap.max_send_sge = 0;
} }
/* We don't support inline sends for kernel QPs (yet), and we qp_init_attr->qp_type = ibqp->qp_type;
* don't know what userspace's value should be. qp_init_attr->recv_cq = ibqp->recv_cq;
*/ qp_init_attr->send_cq = ibqp->send_cq;
qp_attr->cap.max_inline_data = 0; qp_init_attr->srq = ibqp->srq;
qp_attr->cap.max_inline_data = qp->max_inline_data;
qp_init_attr->cap = qp_attr->cap; qp_init_attr->cap = qp_attr->cap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment