Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2206403iof; Tue, 7 Jun 2022 23:11:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ3fhy2W10NMQbY4nMZtR2IIdKp1e9j7gWj9H02uLiFzsA6I39AP+Dfqu9Md36Itgoxyaj X-Received: by 2002:a17:902:ce02:b0:153:bd65:5c0e with SMTP id k2-20020a170902ce0200b00153bd655c0emr32194507plg.160.1654668693936; Tue, 07 Jun 2022 23:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668693; cv=none; d=google.com; s=arc-20160816; b=Nqg2wwymJtcwvv84TFlBoTr3nbJcu69kHQuMQ+uKPLP9c3abOGG2T3CV9hVZ4OZHYm qhgKL9VpZbmcl1ZMAdTxFxpJxqFPZE+Wu4Oc4zbz8aavtBPvM5pf/YYPsvWGFrF1B5b+ TS7NGzZEE4CnXtYBffWoFGvqI90YWvlRgRhPd3xHTnw20aJOdMV4NRW6r59Ddaygitzc Z02yYBckD2Gp82ioP6H+6a2OGUzVxqkf5YiTZdnAFD4jm2S/P5uWsQy+nW2XU4dZMKxq R9EGA6lU9/Cf1ZvVUyo9HfZA4jSb7xWggNMIWGbeEGju5N8r09mlKdtMQcD41jhtPnAd szag== 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=LTJdIdvWC1/Zy8Zdn3x+mhAdwV6goV3VFSu8EhRVLZQ=; b=y1nxLxLUZOhTkwr+f1U/zTMtvUTe1nhctCYceBCiCSNF8v41EM96ZxnQcB944jMjFG 0I8kYCQQ/M5jluNTIUtu97Xkr9ZMaWRzFv/XcrUBmF30AK9ktRRGRl0ijiDNmddAGa6C Rz1NTKFWKjfxmHXdk2QEOJJBln4YDLwWj1lf2Go36fvDFSZ2gQdTHqrbDCglXHs94b/s Fc4AUB1wvtlNP3Yf3EzRuXHNmIHlCJjUE9x6Lzl331E69dVSezR6AC4Yxl3mzNtBaGJ1 Pa4t73WSFaSNNc3QTaSor9IEYLnJxJbM2tsQnc46X07qFnVTBrsg9ia3PsK1ZLI/EcXj kaXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rb8GIgED; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 137-20020a63028f000000b003fc9d61c76dsi11979807pgc.718.2022.06.07.23.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:11:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rb8GIgED; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6AC4B2BBBF8; Tue, 7 Jun 2022 22:33:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389293AbiFHBqA (ORCPT + 99 others); Tue, 7 Jun 2022 21:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380886AbiFGWcT (ORCPT ); Tue, 7 Jun 2022 18:32:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B17E027C255; Tue, 7 Jun 2022 12:25:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A765608CD; Tue, 7 Jun 2022 19:25:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36075C385A2; Tue, 7 Jun 2022 19:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629932; bh=1ZsatgNjEVp8upoppveFDyy7kk+zXJJA7FqcCTOQW7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rb8GIgED2YmryeMvBquPlutVwj3M3JzcJwd3rz5ht7pLO83ZCbNiXoqzGISjbHqE+ FaoqIRmm+IMt3wiNEHOxNL7TtKmzasOJd9K5nLdZFWWVPdXaYAl/x37H0HeY5Nurw1 YpRxhlKFxeGnm8fnIOhqyWVNsN1xlkRFVZpiXdhs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yixing Liu , Wenpeng Liang , Jason Gunthorpe Subject: [PATCH 5.18 869/879] RDMA/hns: Remove the num_cqc_timer variable Date: Tue, 7 Jun 2022 19:06:27 +0200 Message-Id: <20220607165028.077895193@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Yixing Liu commit db5dfbf5b201df65c1f5332c4d9d5e7c2f42396b upstream. The bt number of cqc_timer of HIP09 increases compared with that of HIP08. Therefore, cqc_timer_bt_num and num_cqc_timer do not match. As a result, the driver may fail to allocate cqc_timer. So the driver needs to uniquely uses cqc_timer_bt_num to represent the bt number of cqc_timer. Fixes: 0e40dc2f70cd ("RDMA/hns: Add timer allocation support for hip08") Link: https://lore.kernel.org/r/20220429093545.58070-1-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/hns/hns_roce_device.h | 1 - drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +-- drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 2 +- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) --- a/drivers/infiniband/hw/hns/hns_roce_device.h +++ b/drivers/infiniband/hw/hns/hns_roce_device.h @@ -731,7 +731,6 @@ struct hns_roce_caps { u32 num_pi_qps; u32 reserved_qps; int num_qpc_timer; - int num_cqc_timer; u32 num_srqs; u32 max_wqes; u32 max_srq_wrs; --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -1965,7 +1965,7 @@ static void set_default_caps(struct hns_ caps->num_mtpts = HNS_ROCE_V2_MAX_MTPT_NUM; caps->num_pds = HNS_ROCE_V2_MAX_PD_NUM; caps->num_qpc_timer = HNS_ROCE_V2_MAX_QPC_TIMER_NUM; - caps->num_cqc_timer = HNS_ROCE_V2_MAX_CQC_TIMER_NUM; + caps->cqc_timer_bt_num = HNS_ROCE_V2_MAX_CQC_TIMER_BT_NUM; caps->max_qp_init_rdma = HNS_ROCE_V2_MAX_QP_INIT_RDMA; caps->max_qp_dest_rdma = HNS_ROCE_V2_MAX_QP_DEST_RDMA; @@ -2261,7 +2261,6 @@ static int hns_roce_query_pf_caps(struct caps->max_rq_sg = roundup_pow_of_two(caps->max_rq_sg); caps->max_extend_sg = le32_to_cpu(resp_a->max_extend_sg); caps->num_qpc_timer = le16_to_cpu(resp_a->num_qpc_timer); - caps->num_cqc_timer = le16_to_cpu(resp_a->num_cqc_timer); caps->max_srq_sges = le16_to_cpu(resp_a->max_srq_sges); caps->max_srq_sges = roundup_pow_of_two(caps->max_srq_sges); caps->num_aeq_vectors = resp_a->num_aeq_vectors; --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h @@ -41,7 +41,7 @@ #define HNS_ROCE_V2_MAX_SRQ_WR 0x8000 #define HNS_ROCE_V2_MAX_SRQ_SGE 64 #define HNS_ROCE_V2_MAX_CQ_NUM 0x100000 -#define HNS_ROCE_V2_MAX_CQC_TIMER_NUM 0x100 +#define HNS_ROCE_V2_MAX_CQC_TIMER_BT_NUM 0x100 #define HNS_ROCE_V2_MAX_SRQ_NUM 0x100000 #define HNS_ROCE_V2_MAX_CQE_NUM 0x400000 #define HNS_ROCE_V2_MAX_RQ_SGE_NUM 64 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -737,7 +737,7 @@ static int hns_roce_init_hem(struct hns_ ret = hns_roce_init_hem_table(hr_dev, &hr_dev->cqc_timer_table, HEM_TYPE_CQC_TIMER, hr_dev->caps.cqc_timer_entry_sz, - hr_dev->caps.num_cqc_timer, 1); + hr_dev->caps.cqc_timer_bt_num, 1); if (ret) { dev_err(dev, "Failed to init CQC timer memory, aborting.\n");