Received: by 10.213.65.68 with SMTP id h4csp1615065imn; Mon, 19 Mar 2018 08:48:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELsOHsM+b21BwSwFXA1YMeFc95A993gB6xfF6a2EgkTAzPdrDmsxExoCtqOkCITYXDPUDANV X-Received: by 2002:a17:902:9a0c:: with SMTP id v12-v6mr5840751plp.142.1521474517161; Mon, 19 Mar 2018 08:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521474517; cv=none; d=google.com; s=arc-20160816; b=KiQvYwYzTD7k4CZqJQtQrQcgIEc5acP5OExgnpgvuCq54C6g5GKastDgT4D19TbPTG 83hSCiQuOGwghi8JN/WJWSZKh+YIU6RIvTcLBzgefoIuwQOc8bg73z1TKZ4ZtnE/hqBZ g7nLwzY7CDNiSOshlsmdyv0+6xKOkzAhl9TCF4v2wMSu4V8iTNoIgvUoSwyl0hZe5nm8 pKgeSUHLKEHYEQ5S8gv4Axm+JeACIM3XsRb/GEtap/6T9zulIddWwGvAzOvQEhMaXPsX +/VoIiRtNmq8a7GoDjzLdckwzigqZLQrGcCBGfivoa/yMaUaUsS8gwZ2YohpnKPb3id+ Z3ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=YFkla0tKPJ2YMWfHd77eUUWlmbVBKSDhY64LhMD/R6s=; b=VNNNCTmRCrPKUhmKlkmh3E8x9QZzLONSc3mxnCUo9SozQHh1gdoImzJe/M/4MjUKXS Rct1U/dD4vNeO18Nr24NytGa7Jv5WLC78jThoLGDs56NFQLgmJSL2s32gn72e+iNp6J7 5CM8B8SILANkQl6P8VeslpIx+gzxYBxrLEskwaBZ7BDqR8ZOzE1CmSLlaXq7uwz6FcUQ C4a1xF35L6xszYMSp9UE3+n/BDaBt+ab2LsKjd2Dmr+lDo5OC6LT3dY41LhXS6aj6c06 OZy+nDXN+evXf3o9zgCDd72k49iV9doFUpQUwW5836AKxJ9y/kftTw9xo+2IRJHsNvBN g1UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=joP+KXCA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si132017pgg.390.2018.03.19.08.48.22; Mon, 19 Mar 2018 08:48:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=joP+KXCA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755985AbeCSPrF (ORCPT + 99 others); Mon, 19 Mar 2018 11:47:05 -0400 Received: from mail-by2nam01on0104.outbound.protection.outlook.com ([104.47.34.104]:37074 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755478AbeCSPq6 (ORCPT ); Mon, 19 Mar 2018 11:46:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YFkla0tKPJ2YMWfHd77eUUWlmbVBKSDhY64LhMD/R6s=; b=joP+KXCAoNubfCelqKr9yF63ZzN1C/duPOglPZxQUPbcpi2JsIxp7D/Qk3klbDs7UUofQ1ETeSNRhfStRaw0ylQkgTQHH4D2MVOr9cvQmIHGnn/ScWKKAXdZ2MVlS92HR6BJaWpXFiiIP/lsNz2xHPNS+bmshLIka8b9ZAo2IQM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:46:56 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:46:56 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Shiraz Saleem , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 002/124] i40iw: Correct Q1/XF object count equation Thread-Topic: [PATCH AUTOSEL for 4.15 002/124] i40iw: Correct Q1/XF object count equation Thread-Index: AQHTv5mCGdqHmq6di0e1k7xsAt8QoQ== Date: Mon, 19 Mar 2018 15:46:56 +0000 Message-ID: <20180319154645.11350-2-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1013;7:f72GPZ93f6tRgHucOMtS/zB3RR2khRyMB3RLSD695DsqkGXzgS6Yg2xV1cvQ1Ja/E7aXRuFRH6HxiuXUbA81j/GIt2E4Pnvq6jEvY/80GZZt+JLIG7CM6JLO9w3kJBzpZ6pNTDNTaPAnTRRK4Un+XA4OtSEF1Xu71zaoj+X5oJfuXl1zOc7OZTjWBxALTTuHdVBSWu1wHI3H1PmVFXGQMZt6a8Xm1g35hqm+ACuAJ7Fv42utMVoYTXep/EmrGweC;20:m9NQwiXhJ08mfq9HD/ROlhRujMQsHSHQi7FDZIYm5N/3JHHMsVKiF+IRoPqcMVmIQCc7J5p+Wue0EOic+SDcqi92KgDE4UI03c3qeewbQr6ZKqsSrglxru/qOyXKAUqvdG4T9soALLfZ3ie/puAnK6BRUKcV9stXPt+OBBkxD1U= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3ee79b54-4332-4b4e-355e-08d58db0a50c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1013;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1013; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(346002)(376002)(39380400002)(189003)(199004)(86612001)(316002)(26005)(72206003)(4326008)(25786009)(110136005)(10290500003)(86362001)(575784001)(54906003)(53936002)(36756003)(107886003)(3280700002)(14454004)(22452003)(6506007)(5660300001)(68736007)(99286004)(186003)(478600001)(76176011)(2950100002)(10090500001)(102836004)(6116002)(5250100002)(2501003)(97736004)(3660700001)(106356001)(81156014)(81166006)(8676002)(8936002)(7736002)(305945005)(2900100001)(105586002)(3846002)(1076002)(66066001)(6436002)(2906002)(6512007)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1013;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JA+vUb/2YY7VjPqes9Vm190KJiGvcX6qm3FFbarM/i/sItYxGznhWxBZ3m27jephuDBOFi5fMOFsrbsilcVi2KPJ4ps38ToOd86oPZFhIkwdoGDFkOor3gxoHi6wxIUUDlLPFX4ht3KY4SwHXW7pNoW1mVDlP9Y+GBKM1AjItTl7OO1s3ij7vZKOQbYKykxxnY7e42Qmp8pkhYwdGCYCj8L7GJye+vpcUWQpl9zvrx4AhyStkIHQ7lfJmI4XsKuIS9joDdGEFNWMP5MMmhQzEzGNUu8wFnybZ6GzC7Y3A30B12krjpVh7KNpSOXjpp3ABG2WFAKUVYvEOhrUMwwFKQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ee79b54-4332-4b4e-355e-08d58db0a50c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:46:56.3693 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shiraz Saleem [ Upstream commit fe99afd1febd74e0ef1fed7e3283f09effe1f4f0 ] Lower Inbound RDMA Read Queue (Q1) object count by a factor of 2 as it is incorrectly doubled. Also, round up Q1 and Transmit FIFO (XF) object count to power of 2 to satisfy hardware requirement. Fixes: 86dbcd0f12e9 ("i40iw: add file to handle cqp calls") Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/i40iw/i40iw_ctrl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c b/drivers/infiniband/= hw/i40iw/i40iw_ctrl.c index da9821a10e0d..1b9ca09d3cee 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c +++ b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c @@ -3928,8 +3928,10 @@ enum i40iw_status_code i40iw_config_fpm_values(struc= t i40iw_sc_dev *dev, u32 qp_ hmc_info->hmc_obj[I40IW_HMC_IW_APBVT_ENTRY].cnt =3D 1; hmc_info->hmc_obj[I40IW_HMC_IW_MR].cnt =3D mrwanted; =20 - hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt =3D I40IW_MAX_WQ_ENTRIES * qpwant= ed; - hmc_info->hmc_obj[I40IW_HMC_IW_Q1].cnt =3D 4 * I40IW_MAX_IRD_SIZE * qpwa= nted; + hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt =3D + roundup_pow_of_two(I40IW_MAX_WQ_ENTRIES * qpwanted); + hmc_info->hmc_obj[I40IW_HMC_IW_Q1].cnt =3D + roundup_pow_of_two(2 * I40IW_MAX_IRD_SIZE * qpwanted); hmc_info->hmc_obj[I40IW_HMC_IW_XFFL].cnt =3D hmc_info->hmc_obj[I40IW_HMC_IW_XF].cnt / hmc_fpm_misc->xf_block_size; hmc_info->hmc_obj[I40IW_HMC_IW_Q1FL].cnt =3D --=20 2.14.1