Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1914247pxb; Thu, 16 Sep 2021 20:06:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw09FQwE3cFTCFB4EVUJXAXSSZQezIgFDeK6TmfcAx5TW+82Ky/2qxL6J2FfH+bSvh+PW5i X-Received: by 2002:a17:906:4310:: with SMTP id j16mr9668585ejm.48.1631847990267; Thu, 16 Sep 2021 20:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631847990; cv=none; d=google.com; s=arc-20160816; b=AaRHhgZp2p/2wdnp6+RCN4BCc1RVT/qp7Qhf5ke9RCAbj9O/eGW/TFD3rR6W7gYUGy wSYgXXT2p+ILl9OxbJSBrCecndXCOE7GGrkyHVEDsyuqOnWmesAFwOxlJf4Mn+EnT/af DmiSIKI2n5iFYNgWecu6R5lPK9y1hcaNMff5dyMSNNZMyBDa57kG21j6CCHL7CakZsbR qmKf5Nr7/F6ERyzhIBt2AoWnA0Oko8428SBkNYtsiv90PLDsJOp7/6CBjVGuWrYczUW1 2XwkClOKOmEuT0ITxCpEKNzrgTRirkd/Xb2crcwUfrd1afple/01E81JrCr8qkHF0znE 8Xsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r8f07oYdz4vD3GCyLgoUCbewBMng2vCMySTA5h4njnI=; b=vjcNOQEVxiteiJtXjGHKplF/HK32chEYHbjLCt56fP0VX6V4kjk8P/JyquvYkh84fA yD0L6lJPRwh1rh6euLpLJnzSiuul09K5kVM1dAwiE2+EE/2/G/83iwsgyGIGSaajJ1AY StF9uLiuec2226JRSitiqYjuNkonuhxSejMucwpF5ziZdUqD5Ghz4XLDrMFBrvqnbDBz Xmiu08ceoXf+IX8p9P2mScG4zgN8BdXYbNCYVW7CsewlBM11O74QZfDL0bDvZfCgmoCs ZMfbsOW8FKCnupJbOepXIZrb/t8vw4IuyEkIlWtCUqDvCm8ieBpuStGSMWXGKm8N/BMw qsYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LJKLaMi1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si5977298ejd.124.2021.09.16.20.06.06; Thu, 16 Sep 2021 20:06:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LJKLaMi1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352365AbhIPRYT (ORCPT + 99 others); Thu, 16 Sep 2021 13:24:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243966AbhIPRP6 (ORCPT ); Thu, 16 Sep 2021 13:15:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FC9361BA6; Thu, 16 Sep 2021 16:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810403; bh=DerjmtjVPV3EHwZB5MvO89BhWKQ7W0uW/gnQ1822Ago=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LJKLaMi1it00GJ0PVJ8MJ4o6ty5STPwmOOJUSCJ6J6CgbxR1zU4lCoJkLCNDd8BhQ RQ8VBuhxlZfyabJ+lcPNfmjkXjnEZNzr+tTCqzPE9BwiEpic+wMU6v3NMHq/q/QPc+ XcUGb/skqLMhbEyaA5GQHj2NsLk8NIbt21uZvKas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.14 096/432] RDMA/hns: Dont overwrite supplied QP attributes Date: Thu, 16 Sep 2021 17:57:25 +0200 Message-Id: <20210916155814.031972734@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky [ 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 Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_qp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index b101b7e578f2..c3e2fee16c0e 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -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; -- 2.30.2