From patchwork Sun Sep 24 09:09:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9967853 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 01793602CB for ; Sun, 24 Sep 2017 09:11:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E476128C5D for ; Sun, 24 Sep 2017 09:11:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3B1628E02; Sun, 24 Sep 2017 09:11:19 +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 204D828DE1 for ; Sun, 24 Sep 2017 09:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdIXJKd (ORCPT ); Sun, 24 Sep 2017 05:10:33 -0400 Received: from mail-by2nam01on0082.outbound.protection.outlook.com ([104.47.34.82]:53345 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751630AbdIXJK3 (ORCPT ); Sun, 24 Sep 2017 05:10:29 -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=tOf2r2lxMX9k2m5Cjn35+fQKX/OvrZeM0UyP50F4SZk=; b=Hkd7fMuY07xacqOvsSQH12WoVh4K2MqRpTr2lV3onjw9xg8RVrXAvb1o7ZsV5k9QgteDO1pe3jaLlm2KpMRGPXj+IBYecoKaXHTa7XxooSLx8ASLC1MmLFo5YudDWqBrIoU6LyFW5muKfgKoiOPqnIh7x+m4vQvgnO59ph/XThk= Received: from DM5PR07CA0045.namprd07.prod.outlook.com (10.168.109.31) by BLUPR0701MB2082.namprd07.prod.outlook.com (10.163.122.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 24 Sep 2017 09:10:27 +0000 Received: from BN1AFFO11FD008.protection.gbl (2a01:111:f400:7c10::102) by DM5PR07CA0045.outlook.office365.com (2603:10b6:3:16::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Sun, 24 Sep 2017 09:10:27 +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 BN1AFFO11FD008.mail.protection.outlook.com (10.58.52.68) 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; Sun, 24 Sep 2017 09:10:26 +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; Sun, 24 Sep 2017 02:10:24 -0700 From: Michal Kalderon To: , , CC: , , Michal Kalderon , Ariel Elior Subject: [PATCH v2 net-next 3/4] qed: Fix maximum number of CQs for iWARP Date: Sun, 24 Sep 2017 12:09:44 +0300 Message-ID: <1506244185-2129-4-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1506244185-2129-1-git-send-email-Michal.Kalderon@cavium.com> References: <1506244185-2129-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)(376002)(346002)(2980300002)(428002)(199003)(189002)(110136005)(86362001)(2950100002)(69596002)(356003)(189998001)(4326008)(77096006)(8936002)(2201001)(16586007)(72206003)(50466002)(316002)(81156014)(104016004)(47776003)(81166006)(8676002)(54906003)(305945005)(50986999)(5003940100001)(101416001)(48376002)(5660300001)(50226002)(36756003)(478600001)(105586002)(6666003)(106466001)(107886003)(76176999)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2082; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD008; 1:9lB3vZPNJy+ZmeTIOjKGhPEvcBYYzUNpbHClYOmINYoKJDaBhw31KRAxru/JOMJjK5K2r3LTvw3TASaCFfK1ICnAl6ysdZlZgcXfHDBR/ZfdipSwf12zFIeoN2biBNXu X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3bdab1b7-26d8-4a1d-1a51-08d5032c18a6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR0701MB2082; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2082; 3:pEeI2kbwj8Ue4+zSPqFS39xA2pO1nzHOg3Xi0FOuwv0vUXks4bk/k5SzC3/wWajMuntMgJApBHy+6Ml5ybo2hwa11S86oinsWVQszOJpOi7f6tc3GxpYxj15e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DCQ56VZvMffomHsEL7MeqQXoaS3icxjCRkuigNqTmk3SO2xgDpdJlrmlgHSKkioMUk9dM0ZKuQ+tSTsRD6j5K4cKx9Ce9CDjVB/iHqZbMDhXss7B+JAzHOb85DETonHyasmx3x7vKDRM6MNvb7cQfR0coUEZrrU8QU+tQOtn8HNZErAT7qDRGsBzyC0Su1lsz2Ngh834E7BSKCbHXmifh2FxM4UctTvsiv3N0L0I/gX4tM4T3uF+rh5puWGh1Yq26R67Ff/YvSp5jT7ehv3tGU8qX3P4vW4NODildb6mAbAX1PZrkvMuLQSgG98RlBNPnU; 4:cV/O3JJc7pSMU4dg8feniGuU/lljynHTGVgz+4/v36o+lgRl4hPD76l5EhtQbxkG7yLiP08eY8JM57tSHLroH6/cHhhkf8wp0r8CDzi6Q+a/C1/mMs57hskboIeTGcyTp4MCnPxQNE12sUBOQNPg0X1wafQxkvAiEQB8MBgtcWlVRZatwDdzEdorw84jozaC3XfaTAL4/tiorjyUE4taa+lBVxnD665x124DEBQTAd5Y2Wfgtw9L+4ZYM2YPNHyA 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)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB2082; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB2082; X-Forefront-PRVS: 0440AC9990 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB2082; 23:XX6jxa+PVpcAz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iagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2017 09:10:26.6188 (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: BLUPR0701MB2082 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. Fixes: 67b40dccc45 ("qed: Implement iWARP initialization, teardown and qp operations") Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Reviewed-by: Leon Romanovsky --- 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);