Skip to content

Commit

Permalink
RDMA/hns: Don't overwrite supplied QP attributes
Browse files Browse the repository at this point in the history
[ Upstream commit e66e495 ]

QP attributes that were supplied by IB/core already have all parameters
set when they are passed to the driver. The drivers are not supposed to
change anything in struct ib_qp_init_attr.

Fixes: 66d86e5 ("RDMA/hns: Add UD support for HIP09")
Link: https://lore.kernel.org/r/5987138875e8ade9aa339d4db6e1bd9694ed4591.1627040189.git.leonro@nvidia.com
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rleon authored and gregkh committed Sep 18, 2021
1 parent 97bd7d7 commit 94de8d7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/infiniband/hw/hns/hns_roce_qp.c
Expand Up @@ -1171,14 +1171,8 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd,
if (!hr_qp)
return ERR_PTR(-ENOMEM);

if (init_attr->qp_type == IB_QPT_XRC_INI)
init_attr->recv_cq = NULL;

if (init_attr->qp_type == IB_QPT_XRC_TGT) {
if (init_attr->qp_type == IB_QPT_XRC_TGT)
hr_qp->xrcdn = to_hr_xrcd(init_attr->xrcd)->xrcdn;
init_attr->recv_cq = NULL;
init_attr->send_cq = NULL;
}

if (init_attr->qp_type == IB_QPT_GSI) {
hr_qp->port = init_attr->port_num - 1;
Expand Down

0 comments on commit 94de8d7

Please sign in to comment.