From patchwork Wed Mar 21 12:32:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 10299397 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 BF88760385 for ; Wed, 21 Mar 2018 12:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0EB52984C for ; Wed, 21 Mar 2018 12:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A460C29851; Wed, 21 Mar 2018 12:33:37 +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 244292984C for ; Wed, 21 Mar 2018 12:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751801AbeCUMdg (ORCPT ); Wed, 21 Mar 2018 08:33:36 -0400 Received: from mail-sn1nam02on0063.outbound.protection.outlook.com ([104.47.36.63]:61608 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751688AbeCUMde (ORCPT ); Wed, 21 Mar 2018 08:33: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=0Q8aQT7EEyBSSXZIM8znhu3ly7GokgIOtq2X6kHA1e8=; b=WEMFqopliLPKmnN5GKhIyEH5drROg2mGALYU8FYEcRSRtogo8ABufrbHkwaT7PIQl9YwsYSxJuUfN/a4BJ2wRKkWbFLYPj8JeAJY3Z+Mure/xc6T/xwlBwqBK7drdLSdYXKGnWe5iVUvD+XcCRLlS+Mr7RERTce/YOn9MwgXYTg= Received: from SN1PR0701CA0042.namprd07.prod.outlook.com (10.162.96.52) by BY2PR0701MB2086.namprd07.prod.outlook.com (10.163.156.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Wed, 21 Mar 2018 12:33:32 +0000 Received: from BN1BFFO11FD005.protection.gbl (2a01:111:f400:7c10::1:147) by SN1PR0701CA0042.outlook.office365.com (2a01:111:e400:5173::52) 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, 21 Mar 2018 12:33:32 +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 BN1BFFO11FD005.mail.protection.outlook.com (10.58.144.68) 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, 21 Mar 2018 12:33:32 +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, 21 Mar 2018 05:33:30 -0700 From: Michal Kalderon To: , , CC: , , Michal Kalderon , Ariel Elior Subject: [PATCH v2 for-rc 2/3] RDMA/qedr: Fix rc initialization on CNQ allocation failure Date: Wed, 21 Mar 2018 14:32:47 +0200 Message-ID: <1521635568-30143-3-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1521635568-30143-1-git-send-email-Michal.Kalderon@cavium.com> References: <1521635568-30143-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)(39380400002)(396003)(376002)(346002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(85426001)(50466002)(48376002)(2906002)(36756003)(186003)(316002)(336012)(72206003)(305945005)(47776003)(8936002)(2950100002)(105606002)(356003)(51416003)(5660300001)(478600001)(59450400001)(107886003)(110136005)(69596002)(77096007)(86362001)(16586007)(104016004)(106466001)(76176011)(4326008)(8676002)(54906003)(81156014)(50226002)(2201001)(26005)(6666003)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0701MB2086; 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; BN1BFFO11FD005; 1:PllOmdwEU8vWp8gwduqEmMnfldUFgDIN57aJrVrlJR4w/E7DUWblsc8qYML9NdlBg9VqcJ9+KkSLqql6pnY8pVn5mlus14/cl4JK52f/X/JjaqGnrAq7EgH3vLFQHmtV X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78641711-5c3b-4bd2-eafe-08d58f27f555 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BY2PR0701MB2086; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2086; 3:3GFmQ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LnQwreE1+h4P3Z4ZKcTWOulrf0K7AWLVQyJ1dloTB2Ho7cqlQj89+pPV1YpLJZkLW8IemT0/72UwZhoJj+vaLdG8USd75pXhjXqnG6mDhKI6bSSbgy1vitsN89EmB7ffiGTYkH+qNC+NeUsCxsNwWL16CeFtPzSAku5Z4DUruDkRlNv8LWcdJ3PsPrEwDt3/jb8iwUbNm5NG54dhFqf90LiNQI/g1wyv83AdWNoJDI6vhIJGAKywyNMvO6EF1Qvh/HuGMqyw0Mt5xYRusIAjz/pwOAuJqMT3sKqPTQ5r2xZrgaK7YIaR9UgKGMcC9i8GH5AVn8NRs3D2YkCKahjMMoC/LwdAhqzxN7vpa+eIqG2LIyrxios8TEMuRTCJ7TWn2bDgBKBW8xTfyEZNDAwCp2VMFY9ZknpEWOaKXm3Og4x8uQzfMhNxsyn058UqothratTxCJFMta8HpQBboX5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501322)(52105095)(10201501046)(3002001)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:BY2PR0701MB2086; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0701MB2086; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2086; 4:6HhuikraaT+KmM0SgCeMypAraaRj7KijbeMYuOKZBmR8CaVjB9ctpsuRiYZpVkxsMBX03EdkdUUZ3UuReJat0msnlPKGJwBdGssTufv1PIBe7GuGqqDI4RMqA5ZZXIlwtxyNSjh+1bf4l4EXKdEzdiC6JFYMtXoK0xJC9SXMMGry+ZckD8OMLFeqR0oh0bfSvMowMfS1wE68CWIWRdDlYs+26ZkqHB2/2xCmqbxXXAuzv4aqeiwD3IjjDUddvojVLMwpFxXf8qMUmRO1J84wbg== X-Forefront-PRVS: 0618E4E7E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0701MB2086; 23:cwbjVP85jZXHvb4qDYz9csBFHZkjeUw9dC2ZvLm?= =?us-ascii?Q?ZPeZKS8pw1EN+CTj1gnaIA9DGlFBJD8x/XCDCsLfwtDBWe9neOs2yrWPvqCl?= =?us-ascii?Q?zqc4JYWKYNlHBgkZFOcZBmdDQFSodEMUsgzYVyMxG/8gOgFdMl5mla97RSNr?= =?us-ascii?Q?YuVrcxGIZlhHI9qm5A/Iztmyj7BKu2A31z6pcoKe5Hk05bupnq2Gn8ELLI98?= =?us-ascii?Q?USjX8P+5uxMSMNvAcWIiKW5z+InQcpVxIZjOLvMsql4whjdrLpoEL2jjCaG5?= =?us-ascii?Q?Ol/UJ4oikC08hDAobpgEg78wYHA7z1cog1vItNgUeAMcjglDQykHPg0N46Gz?= =?us-ascii?Q?mAwFlbVzLNqEP+xMXDKJR+/skkzSfHvLb9G7vP2kZ82FWeaTOQN+VH8VpW7T?= =?us-ascii?Q?2T0KaNIvztNniopb2b0WbWRrBayoQZcl8kXc0lJl1r/Ri8mruJ5tESC7v7rk?= =?us-ascii?Q?OqjSqu99A8o2XzUb3MPUjtfG0B1XfTugWVEp8ncbHTgQQ8pmGJsVQS6O0J/g?= =?us-ascii?Q?qMuYp+3uRC8JbyZSjJYIcA0RRNl14Yv3Evv7TaNddguzG/4/iNsga/fznP7X?= =?us-ascii?Q?xbQRWWrrdoC9CvGbLeBnRGsjm8MG2po8VXr5LJn4P1dYZZpwLVorvRhNp3NN?= =?us-ascii?Q?bcDtMWKJEWqROEbyHgGYc130/N3nr16Zhm4V2mppn9e9+T6P8l8WqPmBNGu1?= =?us-ascii?Q?VlxdRN9Nx9jbpvm6RSo+UZEu70mP8hHcg3BZPb/pZpcFkpB8tlSmzWVmtuDV?= =?us-ascii?Q?93Fim/byUQBace6QiBLY5zEbnanYBAng1BoeWdYhZyTtJX216pbKDoY+MAWN?= =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VkD0EeE+H9IO3gRerUD8EE+1kPFCCUd/urX0fs2DdccHGMc7UF45nyN/AY7SiqobFMiv/KLxJqvFPMhoZ5lFQIPk1u2yWPvjeTWGsjqOmsZ7g3krw=; 24:8jCKp3hmualh0U6KDcNrBEYT27g2OE0t1XgJxC7V4M8zkmXDMLYymvssKpB39Gl73mzkfQhZtCsI+ugEiN4jvhwW9eS+TrBeY5ARYPc1gSo=; 7:DU6910/jApuK0E7wkieVihz21U04qFu5EDQHuJWLKCSH+Ug1o1WcNqwH/85qpt8/h6Ym/Ds557X7H+fmaeta3TcUqXMaIH0AfmeSUGSKCX6LPEVmFAxPO530scvVYOgEVEYXozuxVrWs2WbFnMU73Wsdd//tCJRU2wrm/f0VG1HW0IHXC5nSfOHVPVyAip42g3vPimqNt+uOdzvMXJ0MFEUAU8an3px1+M7mcgPr/n8THY5R/cnLbRI3KLwXDgaR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 12:33:32.2062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78641711-5c3b-4bd2-eafe-08d58f27f555 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: BY2PR0701MB2086 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. This only affect error message logging, currently user will receive an error message that says the qedr driver load failed with rc '0', instead of ENOMEM 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; }