Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp407385pxu; Tue, 1 Dec 2020 14:29:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF9sCeBFWCo9tVHTjNizvsoZHbpS91MHo87+sKu/Thoi96hPFu4TyG6gwnoyk0XdDhStbR X-Received: by 2002:a17:906:a047:: with SMTP id bg7mr5172114ejb.30.1606861788463; Tue, 01 Dec 2020 14:29:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861788; cv=none; d=google.com; s=arc-20160816; b=M7FA4OfExrHERyuXqEMQsIwGxlgkUJJr6NTwIYsQXzvjSlKxP81lMz6cSBErA+4ust xagcDYzTgDwJlzSROcm40eP/t0QrfcbVR4r+p9beHuX1+4HGfGy+br1YyrF6lUHDF4AR vrT4xvEpQB56xUGgGngJr1/bmxhYNeUaLO2nqmW0gIcY9wxaVOBD52ZZo2e+lLTRkgXg rkJVKjWvg6/KKqhI/y3aIbjfWja0d5I2LYBaxBFSE9U58jpQMhQcFLUd6rVdSLAUyrhO N8laWanTxyupIRSj8IO52D5kQSwaoYAf51D5yHFYyXvMOEwwl3YHyf4nnOaF/FtX7q0s VhJA== 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=GSI/tmmRtqFtAEhHTy6AlvdJTaauCpRAdTRi3nijE5I=; b=AqtRQUT0g3kS9l+XIMlBGEqJp7d/dB3nlwIV19oyi3cWYp/ZETM3OXQAnCjmBFiejw vPh0bryZ+z6hAQ/x/kpCvZNMJrFyYOqfbPmEJ2+i6x4rh8aEDJVAVUBeglm78QC4zMNt WhHfSek4s1HQB0AhRjLr4mWjDvexK41g3kn9RTUcblmHrHLj+lkj5V7BSyzIlRrzC4tq RNqHCfCJ995Fb7HJLj9dNovwj8+xH4ruBUke03UxY/LFCxvvYSBQ832fgQW+nkqCNnUn ru3ZEaprrHEjPY5Nl4XDsS2ooze7uLTjfBfx2PKcuUi0D6L5hWjJOrSL/74OlQ7TwCBf 2GiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="r6HG/0kf"; 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 u8si777562eje.57.2020.12.01.14.29.26; Tue, 01 Dec 2020 14:29:48 -0800 (PST) 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="r6HG/0kf"; 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 S2390331AbgLAJOi (ORCPT + 99 others); Tue, 1 Dec 2020 04:14:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:52756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390205AbgLAJOL (ORCPT ); Tue, 1 Dec 2020 04:14:11 -0500 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 10E02221FF; Tue, 1 Dec 2020 09:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606814007; bh=C7Hr7eeAjhgBmS1+zePSlbyKpdNUKtdPF2tBJncRM5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r6HG/0kfP0TCfJBLbMaACERjHIRtbhOm5TaF7grgA630HUh2RS4OcL+rs2IRZGpo+ MQ5Pwq02DaBsf1/AAQ3aQIv4meKToHiH/oFOJvXU8+aiBUEWDOsZGYYeQ5ac1/5Stt dRYepkHodeZeahHk2LoNXLV5JYTpuUYueTsInzqM= 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.9 134/152] RDMA/hns: Fix retry_cnt and rnr_cnt when querying QP Date: Tue, 1 Dec 2020 09:54:09 +0100 Message-Id: <20201201084729.364928887@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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 ab6f7248cc446b85fe9e31091670ad7c4293d7fd ] The maximum number of retransmission should be returned when querying QP, not the value of retransmission counter. Fixes: 99fcf82521d9 ("RDMA/hns: Fix the wrong value of rnr_retry when querying qp") Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC") Link: https://lore.kernel.org/r/1606382977-21431-1-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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index cee140920c579..ccbe12de8e59b 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4771,11 +4771,11 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, V2_QPC_BYTE_28_AT_M, V2_QPC_BYTE_28_AT_S); 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); + V2_QPC_BYTE_212_RETRY_NUM_INIT_M, + V2_QPC_BYTE_212_RETRY_NUM_INIT_S); 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); + V2_QPC_BYTE_244_RNR_NUM_INIT_M, + V2_QPC_BYTE_244_RNR_NUM_INIT_S); done: qp_attr->cur_qp_state = qp_attr->qp_state; -- 2.27.0