From patchwork Tue Sep 19 17:26:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9959773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4ED7F60568 for ; Tue, 19 Sep 2017 17:27:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3627728ED5 for ; Tue, 19 Sep 2017 17:27:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A5F828ED9; Tue, 19 Sep 2017 17:27:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 871D928ED5 for ; Tue, 19 Sep 2017 17:27:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751378AbdISR1g (ORCPT ); Tue, 19 Sep 2017 13:27:36 -0400 Received: from mail-sn1nam01on0062.outbound.protection.outlook.com ([104.47.32.62]:63168 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751471AbdISR1e (ORCPT ); Tue, 19 Sep 2017 13:27:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1njQ5fCLNCWauzvgm+SG/3Zdq2/zH+gzw04gM086odM=; b=jmUL+DzLjXuM1+S8tkCVmKslT7kRfMfffBg8AtXlHVijB2bj521I3mZ7kPXLJzkih2LhsWHh0igRtvxCdG2A6TDYq0BsNS6/2lQQHS33JbvYKxIHkWtDfrXTeIUurhlMQXRQHh7C9ybOLOIBvRgEWArFuMutRtqpB9NUtUJV5h4= Received: from SN1PR0701CA0063.namprd07.prod.outlook.com (10.163.126.31) by BLUPR0701MB2083.namprd07.prod.outlook.com (10.163.122.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 19 Sep 2017 17:27:32 +0000 Received: from BL2FFO11OLC013.protection.gbl (2a01:111:f400:7c09::111) by SN1PR0701CA0063.outlook.office365.com (2a01:111:e400:52fd::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Tue, 19 Sep 2017 17:27:31 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BL2FFO11OLC013.mail.protection.outlook.com (10.173.160.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 17:27:31 +0000 Received: from lb-tlvb-michal.il.qlogic.com.com (10.185.6.89) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 19 Sep 2017 10:27:28 -0700 From: Michal Kalderon To: , CC: , , Michal Kalderon , Ariel Elior Subject: [PATCH net-next 3/4] qed: Fix maximum number of CQs for iWARP Date: Tue, 19 Sep 2017 20:26:18 +0300 Message-ID: <1505841979-26365-4-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1505841979-26365-1-git-send-email-Michal.Kalderon@cavium.com> References: <1505841979-26365-1-git-send-email-Michal.Kalderon@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(2980300002)(428002)(189002)(199003)(72206003)(5003940100001)(47776003)(478600001)(2906002)(107886003)(54906002)(5660300001)(16586007)(110136005)(36756003)(69596002)(356003)(77096006)(305945005)(4326008)(316002)(81166006)(8676002)(50226002)(101416001)(106466001)(105586002)(86362001)(81156014)(189998001)(2950100002)(50986999)(104016004)(6666003)(76176999)(8936002)(48376002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2083; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC013; 1:5GNn7dg3YJvtkqKYRXErUB1g+dGAr/UNZvKsFDcNnSPZkJgCHbExFis0R3CMlkIW0Pat4DeQ9rfQO3qNld+di2jEEXcy0bndQeA0W+zyrG39lwFFzIiTT+8/HaxfQ1bG X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce2d6388-1594-41cd-bb93-08d4ff83b5da X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BLUPR0701MB2083; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2083; 3:wS3gI1WDnIDAm0B69yIAhQYcji2ouO2KxqfkzlBGgMM3LX/+c0Ui27u5biRG3Hp6Us39SXHwTRPtSgLuH2NL+DQeJt+2MipaCob3c7X5n/50qHYZtNMjoFluf+prdC0wN1fsPEPcFhGu5Xipx4X6trw7lqn6zQAOr84o9FtVBmU/bKVH2HNOp442bzJXaNOyNoGiowIGGD6jRRvH5XMhAd/APjLs3cSzexsDePXCGMuURl87IWnyULTd2R9+J1b4hciIL/mk6uh6C1lrNwUAFve8nqknobeTy42PvB49vApYL1ffmdFr6jaDDJuTNXxQ9v9q0+AYXfXvpa30Was8L/pds/g/vnBzszcgnfyom44=; 25:Pb4qsBcEO6wVYdm5F6BpeJFncnFNEH7x8O6gdEcJ2xONP8Qd9AyL7HsXSNHJolqUA1JwEkRmDhrTw35eSHsMC42YihCTln08eGwvvRXfPzHL38l5JG0BpvRN2P9NJgtNqtricCD1JMijwMahm/tkjy1dR0+y7nCh4RUdbfZbD/YFgxtgOmt0/eBT3M78RYnxTLErfsiLP79n3ocY9UA+MBp6zgt61apQ8Oi2pjzDdOQIKJYWdx4Uyd7tVGi7r2lEhHWhFYpBgOi7fEYVJEf3uRwJBOSydfbbuPLVoPFj8kjRO2asP0EMY9eBEjz5/qWaCUsieJvSjDN540AjUl/HTA== X-MS-TrafficTypeDiagnostic: BLUPR0701MB2083: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2083; 31:riPb8/4fIhjYIWpCskSX6nKlFO9XKNSLEUV2Q9OOBq35mcBcgMLTl7ZxFI04OWqLi8laS2aA9i2uoz4COf7903LqpaYeQt2f+VeNRrXBP75I8n4LJNRdnTilkmFZKIkTsWWyEYR0IhUBlbx3bsslG3VY7nVxs/2j2JNK0x0V4kUWTvOV//nQl/DVQapbx4Pl702slZmkYmDusfXClTAa2+OWnaDWhplC0DOtzWsuJZA=; 20:4qdElm0yKoBPzr9gYC6ptKRzUud7KHaW3SOdm1AyxWuOXThYYCvQihY5N8xka3B9RIFUo6NM+38NCCft8DL+7KvcEIGRjrtbZdqq7YT4YZMFUfDxJArk7d/PG8Ux6vtEzIN47oasDIWgkUOGJdF0pEnBxh7uInb6eWtAZM90UdlzxsmgkWVIBV0adXQRnrMlrVz4sjLc5n7Hf4Nt4BPKozQiZe8ooeoBaqt+VwbK9e1ynkOS9ffaVd6A92mC5LnFqowI0l4k3LDzpTPaUjA7qRApkfSxnRaq1Y2FWNib92uu0hXPhxyOXxTlNBJhRbAK/cCUZmrG3UQyO2tIdWhRDqcp5DrYcPnA5aUsZ0NtTx8ClEDGYiLfLsGxW2wKRM1y8s5YuCJIjxIPCYl/JK92ztbLYHBBa2ii92xdGs7oN4BvtL1c6hm54EAIwUmaWqv8Tji9I7Dp9NHS1YMvDfvyuSDF6k+JzEEvEikkzdpucPf+HQOIeuwfzW3M1clOcHMl X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB2083; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB2083; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2083; 4:Y8YZwaUxc4q2epbBw10lEt94AEy+lCUMXXhikNm2R01CBIECA7VtaaMGoHhogm03wCWVtNBu+v5NeYRHCLT+j+giXLff17tWFW2gCO/gsNowwbxhs+6plJDUbysRMFhyr3axIdJsS3C+JLWUsQwHvS/C0yawIjg4itqC4MRwys48e5JFFlNwisAuAt7g22Ja75yRajAWwd0x19VH+KNUMg3tiGf4n3eGBFXpK7shmMl0ilLByhsQP+ofgexdNKF4 X-Forefront-PRVS: 04359FAD81 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB2083; 23:e+2u6WlomqvEY45Ll+9q3wT7tn7asLCF3IUZraU?= =?us-ascii?Q?fVDNLlFIVOqYGPJsAVl5ocDPhYkJLwdgcEm3+ySkOzaCOLz7QjsD+OHXn71m?= =?us-ascii?Q?YgMbzBq3Azsuv1qV6i6n9fTxGN1sejRMflegfZVRLaVGzloUtdgtOSqFg5fC?= =?us-ascii?Q?08XsTvTPgDC5JcnVkUVjWlNR8uBi+S6W/aiH3haWwn2VHvdTw8qthNZZQQPY?= =?us-ascii?Q?vIhL7T8endP6U/hq378/HsvpZ3GJvFIo5+XkS8o6OJQDL+55p/kyr8Mc8uRJ?= =?us-ascii?Q?Uq88Z1XgijllW4KoJtNDR/QANBXB5e7wrMkpwo8y3zd6UDacxr3Rbz1BoTXL?= =?us-ascii?Q?1JEnYC5cRW2xx0w4R4sTdh9ozLPkIs6Vb69ZClHlSeZq9tShJ7MZt/Q00ah6?= =?us-ascii?Q?6XDQhbcclhpe5HA42JFTQD5N7TjfFV9R4fMRjrqddbi2St0Sff8Dh2zbOJ2a?= =?us-ascii?Q?2o0f1Y6qwF5Q7MI5spcduN2yd4QO67utJCu7rgkW9It54IIY+bXjkPrydEkO?= =?us-ascii?Q?qcMBG7t0CMfx93Z5G87cKdO40FfeAsP/w9/+eH8z8xksGqg73kqoc3o1q44A?= =?us-ascii?Q?EcHk+xTIdS7UmS21PAefRYKp/cry+HO4vELrhFun2zrGrqJ4ANUiFPDopY0Z?= =?us-ascii?Q?fa4zjwn86iAXfGpLYzicbjT15zJdLpIE0d2I0foa3+r+d4X6WJeVPOSN09Tx?= =?us-ascii?Q?5+PfiNO0Ukpdni08tirpwC1UKPz+1Pk8REo7FIjD81LGtbwiSTUTHinzSbvt?= =?us-ascii?Q?tIIrCp+03AfHGaaqB3WFECSu/ValFTiGCnG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PzV62WHfepAy1qdin0DBGXkzau1G7RK4JjiJX2WituqSFoqpUl6B54ca+ucPZvnOsPked5BwPCM1pj+Zww= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 17:27:31.9148 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB2083 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The maximum number of CQs supported is bound to the number of connections supported, which differs between RoCE and iWARP. This fixes a crash that occurred in iWARP when running 1000 sessions using perftest. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c index 4f46f28..c8c4b39 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -209,11 +209,11 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn, goto free_pd_map; } - /* Allocate bitmap for cq's. The maximum number of CQs is bounded to - * twice the number of QPs. + /* Allocate bitmap for cq's. The maximum number of CQs is bound to + * the number of connections we support. (num_qps in iWARP or + * num_qps/2 in RoCE). */ - rc = qed_rdma_bmap_alloc(p_hwfn, &p_rdma_info->cq_map, - p_rdma_info->num_qps * 2, "CQ"); + rc = qed_rdma_bmap_alloc(p_hwfn, &p_rdma_info->cq_map, num_cons, "CQ"); if (rc) { DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Failed to allocate cq bitmap, rc = %d\n", rc); @@ -222,10 +222,10 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn, /* Allocate bitmap for toggle bit for cq icids * We toggle the bit every time we create or resize cq for a given icid. - * The maximum number of CQs is bounded to twice the number of QPs. + * Size needs to equal the size of the cq bmap. */ rc = qed_rdma_bmap_alloc(p_hwfn, &p_rdma_info->toggle_bits, - p_rdma_info->num_qps * 2, "Toggle"); + num_cons, "Toggle"); if (rc) { DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Failed to allocate toogle bits, rc = %d\n", rc);