Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp226898pxx; Wed, 28 Oct 2020 03:24:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxO3ubZXV+sfI1mvSkhRKbfjoC9ZLpXZn77/UFK53zGP3ZgVAv1fxG6Z+1GDLDvA+/qARe X-Received: by 2002:aa7:c955:: with SMTP id h21mr7012505edt.315.1603880683042; Wed, 28 Oct 2020 03:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603880683; cv=none; d=google.com; s=arc-20160816; b=gphGcBRICaC0ASJVuUuYMN8eXDA6/dwMIcWfYiXktUXU7JZsFd4WS1tKxaLWCLophh iNYS72yF9+ES7UxFAY0U1f37JKGEVQ4iJqzeVs+S9zdcuZKQeMs/qafnIAsicaFsyU9B Km6PwTV76Yzbw8PmBivyRLAT+JB+7XVL7lui+9zgV9QNn+h/R4Y00jJBRINGOKcKH9vd tJ4Xnm5CqOjjjM3KYRFipJAiMQjurIinDMDjtpkdR9GayoVc/re4V5/ZyKETWofYJvf2 Rlh7l65AY7BrjdjdOexV7lAo2u5wQrtmr5gWf1ML4HpVTfITFdwLDDFXcZv0QzTy3SkD fc/w== 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=dLG08Cl4SX4HtYMVCS2fhF/d18EqJaerRxtEq+sHlow=; b=unVgCVk1KKu1HxEGxVfG0j2IEUWSXIjU1yFBxLmHQ4cnXD9ETV3yU+5BczDFUbrTkD ug8pIMWeISkVp8ousbRkbArmOCzB7K08MHh28o41RBpR4Pff6D1TyovpPS/ADOO+R+Ut OuwVpqiZpQe0kYIyyoYI6vmbnOYvFN/KJ7/2U/lcfsJTNjWQc3jB0WAqHFVvPHkMM8hR AiuGesSOFsT3YU8rtwwysZKSo4+73gR5SYDHlOE2M2UyDvc8XgE7j/cTXifqVVQJZX3f Vx5RNxRAyQ0ZAdE7XHzpT7VAr+JdLSZNG0V6x3GnWYWwh5lrjUiitoNLzIXn5h1UIV3k Ny/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q2CRSiY1; 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 w17si2969573ejk.629.2020.10.28.03.24.21; Wed, 28 Oct 2020 03:24:43 -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=Q2CRSiY1; 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 S1761381AbgJ0OjV (ORCPT + 99 others); Tue, 27 Oct 2020 10:39:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:38462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761371AbgJ0OjM (ORCPT ); Tue, 27 Oct 2020 10:39:12 -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 49A16207BB; Tue, 27 Oct 2020 14:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809551; bh=TD40MBMZ2sX+lcUHuoTWd/myMM6oP2GIizb978InVx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q2CRSiY1+7CgxgPhPcw/zEgGIJ2kaXvDC6XWQPp6I7L/XaALCB4LX6/IjdtWz+/sE ymkLhqM3w7lgAXdpIoKFWhrTg8NrYbHvba95dVdYnc6L/7xfsZqKtIBoK0QebkQzEm NdQRpekMfRQAun5KdlHmDsmRfZwFYDpTi8WpXCoc= 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.4 236/408] RDMA/hns: Fix the wrong value of rnr_retry when querying qp Date: Tue, 27 Oct 2020 14:52:54 +0100 Message-Id: <20201027135506.001607909@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 0502c90c83edd..def266626223a 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4616,7 +4616,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