From patchwork Wed Mar 14 13:02:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 10282091 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 7971760211 for ; Wed, 14 Mar 2018 13:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF44328860 for ; Wed, 14 Mar 2018 13:03:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3E3C28881; Wed, 14 Mar 2018 13:03:25 +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 1B78628860 for ; Wed, 14 Mar 2018 13:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbeCNNDW (ORCPT ); Wed, 14 Mar 2018 09:03:22 -0400 Received: from mail-cys01nam02on0063.outbound.protection.outlook.com ([104.47.37.63]:8864 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751961AbeCNNDR (ORCPT ); Wed, 14 Mar 2018 09:03:17 -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=pi09ZT7O+h6m17FgVfg3ZQvPs4K/W0LolbeaABqM+Qo=; b=FCv5ScuXZ03aQcXbbh8XbiAkIc+KX0RNG7UkgNCEb9M8iVDGgZN5+GwrcnPLsrGjGwE1maDu2X9KXqyoovobe4qbE9D4BeNlKiDupnsveEg4hH297bqKofQSa87F9b/sE1hWsrX/F3MxnsJlD79IlEZx45+D9DGr/gMwH6h9kec= Received: from SN4PR0701CA0005.namprd07.prod.outlook.com (2603:10b6:803:28::15) by DM6PR07MB4219.namprd07.prod.outlook.com (2603:10b6:5:bd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 14 Mar 2018 13:03:15 +0000 Received: from BN1BFFO11FD015.protection.gbl (2a01:111:f400:7c10::1:131) by SN4PR0701CA0005.outlook.office365.com (2603:10b6:803:28::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.588.14 via Frontend Transport; Wed, 14 Mar 2018 13:03:15 +0000 Authentication-Results: spf=fail (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: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD015.mail.protection.outlook.com (10.58.144.78) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Wed, 14 Mar 2018 13:03:15 +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; Wed, 14 Mar 2018 06:03:13 -0700 From: Michal Kalderon To: , , CC: , , Michal Kalderon , Ariel Elior Subject: [PATCH for-rc 2/3] RDMA/qedr: Fix rc initialization on CNQ allocation failure Date: Wed, 14 Mar 2018 15:02:34 +0200 Message-ID: <1521032555-19708-3-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1521032555-19708-1-git-send-email-Michal.Kalderon@cavium.com> References: <1521032555-19708-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)(39860400002)(39380400002)(396003)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(50466002)(36756003)(478600001)(51416003)(47776003)(2950100002)(105606002)(186003)(106466001)(85426001)(8936002)(104016004)(48376002)(86362001)(76176011)(8676002)(81156014)(81166006)(6666003)(69596002)(2201001)(72206003)(2906002)(50226002)(110136005)(356003)(4326008)(26005)(5660300001)(107886003)(16586007)(316002)(336012)(54906003)(59450400001)(77096007)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4219; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD015; 1:QEEn60Ly7ylop6nio4vD3HU2ngt1gGKqXL9en7ynlpyqxFl2v4RDZnnvqxqvTNj1wISvybzNS/B/6SLpM+eB2iABeK6OlqZVtAzKs725pcEQLgrVI38sE1AGAunxLZhM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6cef9d6b-04fb-41aa-e909-08d589abf335 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:DM6PR07MB4219; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4219; 3:zX81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e9ZzJFQ5GBYNx5NvtUkG7qgYa/Y4H5H2HgwSu0mWcpsdv5/s39jkgO/Jmd5zE0msUswBpRD/4A8uGIr6KpBU2uuwJqOJQbR++ZFzsDjrPbSBazUhtJaljoCxadF9fu0GzE4e8STGVrYJxm8mh5OIf4FQ0RA7rvYdp7ZcUfvDlWcp+zDohSis0j2KPTnkQm+2kt3bMJpP9j/Hx9oAMhrstfiNCItrfDTGw2g+SZ0EGdZphF80MR/a47xR+Uz2n8dx9lWVZf0+uN08QUWpNMKLVz2gC1LtCXTMdJwcx8sJYc6cV0q8R3/yWZvL7DrKE4dPiAPrR+ywJiQQ08xgFvgTpacQIOVNxBfecQDT+qxP9a814ABgd6ruqiQiV+b+RkXLtfDpc8FPG3ZvJphSmtr0OHcAsvlzHykpNjapJFuAHU3RAMArxrf76F3DtiWHuEA9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501244)(52105095)(93006095)(93001095)(10201501046)(3002001)(6041310)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:DM6PR07MB4219; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4219; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4219; 4:+MeMTauwCs4KG2OL7bhKtv7Kv9q2+y5k+bL9n1StCXety0NaHdqsemqvViR/WQlKHFp0kMDlCAJ/S6cZOjk1m/tebLB7PNv4fw38BBP3WdLxZza+qd831ZdB67YL5Z+pznYoJkcvCTnZS398VL16WeVEZ6ot2NX87hCM+EHd6p/I6f96sh6mGVynHI2IRPnDRxrmqLLhLxgF+DoOEuZ+/Eq/CmpnZxJHFtEoGv1RfB/jOSScujs7/WtSY4+bcW5UC/B9PldaxPgyDqvjEezk5g== X-Forefront-PRVS: 0611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Rn/EDb4YSa4Sl69hyryBAQNVkIGyF4T13v+Rwn1IDt2zARjiG1/bbWcre?= =?us-ascii?Q?RZiGrcDgiaWMf0YrG9493cexjSO3ms+pQtyUG7JQbiadqe6eTwDkJVB7FnfL?= =?us-ascii?Q?Q4wRnWe5/YczGVN39LAJR6y3oTd31x2QTV4kUxTISxCMRDrQwbWnOG18Nz8h?= =?us-ascii?Q?RB1H/qOHtPybaWG2LCfgdwmPYO4Sounj3bAe+o1k2xI6W48/A2jomxLu0ZXv?= =?us-ascii?Q?wnYpOjLyz1ELLza35MRPhuAyfsUi+fWlNmwDR2XHIWW3cU5U//LlnvmhxTA7?= =?us-ascii?Q?8EnKMw01T8=3D?= X-Microsoft-Antispam-Message-Info: Ft+n4UT7T7HAfLCgOhzam73c9izazjzKq3KZk+qMuysHIA4qDUCX4zVB4XiPNtj14TwO9Ua4DobZy5cNKQuJNm2vuEB75Osu2nW3lDWKCpwfwum8BlGAPWfuKRdjvrXe5j9klYm4QKsfWmBOP1Lg77cIQWY3Urm7meYyZFs360h44f57/Qr7r2w4RTDjf+3V X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4219; 6:Y0jIcvwuXCa/y5CJ+7P7DDrzaL/mwzDUxgmZ0QCUNW85XzeU90h0cJh8TXYyxvKVSU27xa/93TIaOjydlGf2GqRzA6+QeStPXlIJug0ogPKYQlyKBt7CFAOaPLjiTVwbrtJ7J10bc+snkuVYj0uqRfxw3hHk0RS+8mkIFCH5yEV9HSLe+8IDEkLoCeQHWD0PB19qQ5l5k/T/x+M1srWKnlO/9UdQaOBW+YlosyjehoXVsM9mGwcMCisw7akbjr14+iw6PkF/4JZokLULzCgak44Wheu1eRy7hx79StKnSL/J0Rzw46OpeACUOvBtIcP8HbYzrGoTE9j3evi47kOh2dZijFD8P9sNkyveXoWKESw=; 5:MWX4DuSgl0TYsaMWygD35zZv6MW2ZtuiAA7C3HCiT3i774gJm/tk5Npde7SjWtwQpM3MKycFdOw1luXdDGEaK0fRKbL+VlZ6AlZPkPgugI7R0oyADqG3Ga7c25CIvulR6Zp7bOOwuDwjNTAqf1S7pDCOXqBAwjVk+WYKHlGKs0o=; 24:5QL/a70Z8CDYX+QIkvChabKVjdw+k3RUF2QXweX6XKhxThSvoAT6Q2tnI1p+mdufw3S3RqT+njq83vCTMVZFCOB6+Nh2Rk2HAWA1rdC9uAw=; 7:A1Rab4MFQgIt45OMH3oCUrO70csrlNiMtaG+pNXea4yUBX4zrETgJtrVWpvzSDRshhIqoaai+9Qk67JRlCtPhAA7JNKIWLbZl1VCVPdMhXxGaDeiZozvrfFck8gI3WoiAuypoEevLYBGQtMxphWG03JHN5NkIVU8KdAvG0Oz3DX3KBtoXoFNu3x9TQRqpi2u9hY+wxwhjE+vA90BC4mVK5mk/8n4l1DGBiENCmT5QgM3QNKhZyHgQt1gOvZi5KD2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 13:03:15.2326 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cef9d6b-04fb-41aa-e909-08d589abf335 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: DM6PR07MB4219 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 Return code wasn't set properly when CNQ allocation failed Fixes: ec72fce4 ("qedr: Add support for RoCE HW init") Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior --- drivers/infiniband/hw/qedr/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index db4bf97..0ffb9b9 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -833,7 +833,8 @@ static struct qedr_dev *qedr_add(struct qed_dev *cdev, struct pci_dev *pdev, dev->num_cnq = dev->ops->rdma_get_min_cnq_msix(cdev); if (!dev->num_cnq) { - DP_ERR(dev, "not enough CNQ resources.\n"); + DP_ERR(dev, "Failed. At least one CNQ is required.\n"); + rc = -ENOMEM; goto init_err; }