Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11992255rwb; Sat, 26 Nov 2022 02:43:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ZELUmXRyAVYAZ4q19033YM6YWpx22+eGaZG3gXnCbluUXVgmBKUUR6ktgiZQ3dhkqdL85 X-Received: by 2002:a17:907:16a5:b0:7be:42dc:4cfc with SMTP id hc37-20020a17090716a500b007be42dc4cfcmr789828ejc.128.1669459421362; Sat, 26 Nov 2022 02:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669459421; cv=none; d=google.com; s=arc-20160816; b=zHPRNSa73LqJ8fnaX4LT6zVU6DaGwZiD8MYBidSkRn0p+lQJuR8SWIANhQwQbWJohO A6AqPzRsk8wgq3VR/6wQk4GN/Ns/DtJOemcuxIdXdB42/oJwKNtY/AZFFzlgDyqF8/gk 5Hiq6VtZ4E8PS2O83pjfPYpYZnAlUwcZffZlt9yXrHS43X6KJw18RsTqpkPBF/5htiny u14WO17/DMKetyLh1/f+T7f9j22kxEObjE2qUccrNOaT3LE3t7R7LwNEGShaPUbWJPGr G2X0U9aIXIHz5fwd50vVJFCw1w50PfxvUMd7/xSWpd05y+IEFQpGl5SGQt4FUlkh1Ydg JaSQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rUMh+l5DFaaGgeqfbnRzCxyYUEJmhuDp3zIzGBeUaLk=; b=xoVrGEAzuUbtkAbw5h6CG8C867Wjoxh/UJVzzTdKTeutkH5TxOtKV/xHoP/1a/mXrA AsdPGBnMFq+jiR3skSNCrqvFqK0TL8NLCCisPw6L3VPhDme4wgF7GltKwrrfgk7+f9aI U393/K8KMLCvxCUONPV8BdDKVb7OZpvPeYG/KL4KE9APzK13iW+KL8DwAVDce6g1QMui grn6TJRbYUoxFZm94fsDYOJYjFdFsadPRw41d+PRavFdRfQXQbF6xeL/qOnLaRZ9ZV5w svsgZDD6UlLRp8T2v6lrmmmuXnz6xeOpNy/IsO+ShFo/lstN/+dGxy7on2wdWT9N+hy4 QTbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a50cd54000000b00469ca3f142dsi5311548edj.609.2022.11.26.02.43.20; Sat, 26 Nov 2022 02:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbiKZKaO (ORCPT + 85 others); Sat, 26 Nov 2022 05:30:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiKZKaJ (ORCPT ); Sat, 26 Nov 2022 05:30:09 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F29D327FF8; Sat, 26 Nov 2022 02:30:07 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NK7JV6yMbzmVt8; Sat, 26 Nov 2022 18:29:30 +0800 (CST) Received: from kwepemm600013.china.huawei.com (7.193.23.68) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 26 Nov 2022 18:30:06 +0800 Received: from localhost.localdomain (10.67.165.2) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 26 Nov 2022 18:30:05 +0800 From: Haoyue Xu To: , CC: , , , Subject: [PATCH for-next 2/6] RDMA/hns: Fix AH attr queried by query_qp Date: Sat, 26 Nov 2022 18:29:07 +0800 Message-ID: <20221126102911.2921820-3-xuhaoyue1@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20221126102911.2921820-1-xuhaoyue1@hisilicon.com> References: <20221126102911.2921820-1-xuhaoyue1@hisilicon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengchang Tang The queried AH attr is invalid. This patch fix it. This problem is found by rdma-core test test_mr_rereg_pd ERROR: test_mr_rereg_pd (tests.test_mr.MRTest) Test that cover rereg MR's PD with this flow: ---------------------------------------------------------------------- Traceback (most recent call last): File "./tests/test_mr.py", line 157, in test_mr_rereg_pd self.restate_qps() File "./tests/test_mr.py", line 113, in restate_qps self.server.qp.to_rts(self.server_qp_attr) File "qp.pyx", line 1137, in pyverbs.qp.QP.to_rts File "qp.pyx", line 1123, in pyverbs.qp.QP.to_rtr pyverbs.pyverbs_error.PyverbsRDMAError: Failed to modify QP state to RTR. Errno: 22, Invalid argument Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC") Signed-off-by: Chengchang Tang Signed-off-by: Haoyue Xu --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 93c677239686..a8f8c790d31d 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -5470,6 +5470,8 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, rdma_ah_set_sl(&qp_attr->ah_attr, hr_reg_read(&context, QPC_SL)); + rdma_ah_set_port_num(&qp_attr->ah_attr, hr_qp->port + 1); + rdma_ah_set_ah_flags(&qp_attr->ah_attr, IB_AH_GRH); grh->flow_label = hr_reg_read(&context, QPC_FL); grh->sgid_index = hr_reg_read(&context, QPC_GMV_IDX); grh->hop_limit = hr_reg_read(&context, QPC_HOPLIMIT); -- 2.30.0