Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp484222pxx; Wed, 28 Oct 2020 09:21:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3BnD74tbP5kEFeg0NG7bUXCBunurmDfXNmBEpOFPoJw85UXNJ149wg2C7yuTyTAuxonez X-Received: by 2002:a50:85c6:: with SMTP id q6mr8872646edh.126.1603902099242; Wed, 28 Oct 2020 09:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603902099; cv=none; d=google.com; s=arc-20160816; b=Pr7TTZFggGDF/S7/A59RI/1H4mvC4kK5275TqhfMUlkAknJJ+gy6T1k2ubBdiHU5nn HNVC/auHFAodww+MPJzYSa602bTzSmPQjdd3Jw1o/e4c8ubF6QWDiEZDgBtPBAdCna5e hX0evuVYs+dxXTOZUEaFqPkOFqiYYJneDRHsDOdXy734pVKYUqJYtWMBudrwESDLNmB0 ln13re90OtyPT9XiYSfrG1uCuuo4xYrvy9zqZibD6La6rFD+k5+hBpDfUraYq9xzhb1j SdhGKSMdyrU19/4BjXIRqHMg7ir3cFI1kfLTGwH+AqG60UZP1W3VNxHPoxEtLlf6Pf9J YodQ== 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=nPxuzK7yUdmUbelu9NaxiP4wf36yJf0EKzPHZKUVu+k=; b=lXue0QC6I3PrDaKV7wuDPXdOgQQqLeRMLbD0L4aJiG2SnqOBr4kHngqt0jAKeJG1z6 V7Sm0FQsOOGijCXuHcDllp/qV9fv2dWChdcQ0J3YKTACew8oYMy9xwJR4rx/G9Wa2SEO DeOD2A825nNW9rSe0dotTW/iNxtklARb0pNEVNFi/HlVpyMK+Y2V2c7uuTePdKiTjafG pHOsn1OZ7HRHr+H5p27alstXM7sBv1e4wdnSf7198tvifiokVVHuKRb+u8BJOluUvOTr AUwawD1FSOVDSJMfGHYSeO1JkhJIXfRwctKnHLAd+rt5kr+4bxijdIYizKxNGi70HVKF rSyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mX8Na8bY; 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=fail (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 y21si3722087edu.215.2020.10.28.09.21.16; Wed, 28 Oct 2020 09:21:39 -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=@kernel.org header.s=default header.b=mX8Na8bY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1816470AbgJ0RGv (ORCPT + 99 others); Tue, 27 Oct 2020 13:06:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:41562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793551AbgJ0PHC (ORCPT ); Tue, 27 Oct 2020 11:07:02 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC3442231B; Tue, 27 Oct 2020 15:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811221; bh=TyVLVpQbrbZbdnp3suHmIAEOOnGENSRJ2GVL9c0NgDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mX8Na8bYmLvwP6GOQUEHZrbRAm20Yl7PKeXpj/pFTbeU0gEps3uB2O+WQaIQaAnPM pwU2Bxcx1npy4M3rS3+YfmydJ1jQ5/WZnm2Kowoi4mg6pIIqgFZiV6pdEsKhQRCp5y 8eBLZDeVMvXvucykyUeEXzQ2Mwms4N+2LIthVxPM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenpeng Liang , Weihang Li , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 385/633] RDMA/hns: Fix the wrong value of rnr_retry when querying qp Date: Tue, 27 Oct 2020 14:52:08 +0100 Message-Id: <20201027135540.766288845@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Wenpeng Liang [ Upstream commit 99fcf82521d91468ee6115a3c253aa032dc63cbc ] The rnr_retry returned to the user is not correct, it should be got from another fields in QPC. Fixes: bfe860351e31 ("RDMA/hns: Fix cast from or to restricted __le32 for driver") Link: https://lore.kernel.org/r/1600509802-44382-7-git-send-email-liweihang@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index fdd9605c67630..a55a850a8b997 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4795,7 +4795,9 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, qp_attr->retry_cnt = roce_get_field(context.byte_212_lsn, V2_QPC_BYTE_212_RETRY_CNT_M, V2_QPC_BYTE_212_RETRY_CNT_S); - qp_attr->rnr_retry = le32_to_cpu(context.rq_rnr_timer); + qp_attr->rnr_retry = roce_get_field(context.byte_244_rnr_rxack, + V2_QPC_BYTE_244_RNR_CNT_M, + V2_QPC_BYTE_244_RNR_CNT_S); done: qp_attr->cur_qp_state = qp_attr->qp_state; -- 2.25.1