]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/hns: Don't overwrite supplied QP attributes
authorLeon Romanovsky <leonro@nvidia.com>
Fri, 23 Jul 2021 11:39:44 +0000 (14:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:41:52 +0000 (13:41 +0200)
[ Upstream commit e66e49592b690d6abd537cc207b07a3db2f413d0 ]

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: 66d86e529dd5 ("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>
drivers/infiniband/hw/hns/hns_roce_qp.c

index 230a909ba9bcd196d2bd653ae6272aea5c11c8d5..80661d3688600feda15ad2f0437068cb86c6b7cc 100644 (file)
@@ -1158,14 +1158,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;