From patchwork Fri May 20 18:37:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12857237 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C38EBC433EF for ; Fri, 20 May 2022 18:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347361AbiETShM (ORCPT ); Fri, 20 May 2022 14:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352899AbiETShK (ORCPT ); Fri, 20 May 2022 14:37:10 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20721.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::721]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B84460AA8 for ; Fri, 20 May 2022 11:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cet7R4ksC6ddEh8HzSuxR2x2cCKkaTMVWZmoh6i0IJdmNLsG2MQgaK1XjEfgijeTRC5XcVsSiDa3MR64FrnqNOyVfMQi9yComYjNdMgdUinguVTNM/pLx625UOJUfjh5mjUTW/F26PCvz2S2uhHOmLF+O9TFibbmrR+TgfJ7fe9Ip8v0qhInF1Vvee4HX7BE+Wf6MCz++M8/hnAY0nLpvqU/lVv9zzf486A9E96WnvK/OmtBh7N5YmMlTcmo0xvzV8s8YrLlvgUhlLFdzyeAEhCp1kGGS8gvepGoza30NmDJeb2ycFZKkXiKawwekUsWXPczHS0zqSDy9BlH4xOL0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ga6RdUjO5jHNUnPNuMY5df46N1Qy550vtzRuJQfGEsA=; b=IK9neEl04DPZJ79VA7EC2LutZtMBQ/9fQuIo0VE3nBVqHyouwTDJy6Y+PNzT+eU9HIx5sZgkfzm+EORDbhgGGyOmdZU6pCUuOgCEfzyB39ThMoAh2wOkZk9iKmEY6kqntuaNQOB+Wok6FdqKev6XOJnEEuVv2NiDL7MVhhpX4gAZ4LFHNmbneJ8cRCQufMgiVl7rwrcx6iispqzuZTgZbuuzpCzjdq85xaAH8L+X1jx2cmMz5ranIWAPFgvnPfInwUkr17HbtTHsyKHlTuFSl8vXWMEo39qyy2lXBl9W4BvRmJMUydYd7qc7thscEuKpFz8vybe/yWtfmGbCLUtkDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 208.255.156.42) smtp.rcpttodomain=nvidia.com smtp.mailfrom=cornelisnetworks.com; dmarc=bestguesspass action=none header.from=cornelisnetworks.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ga6RdUjO5jHNUnPNuMY5df46N1Qy550vtzRuJQfGEsA=; b=PaRGNk6ai66BpZkKZEI+dO596mTpbK5ZQ3JBEiAfB7CH43hLgB3Uzf+mvqnzwlKruT+k8HXq8mHB6S6rMzghVsxN6E5UtEKHTI2oSB2h/BUfCcGWspsWFXOV6xZ2yLe616mbLanIam6lFtNzwL/n2ckKxlz+ESr5PBkoI077F+cZsCYv7yz+ZbstzZA1fcRlGl1JB5ydd/xoznFwG1LKvEFDHW/hI0JdoH+WEfZQrLLh29k3tB5JtCSd2x3T1OfLShK21UJBocZimFqu3YZU0QU3v4X8+no3kubWu9qScfwJbo4bNdII7TsGod6s+LI4kV+XT4Yj5dmqMdEvTUmrHg== Received: from MW4PR03CA0068.namprd03.prod.outlook.com (2603:10b6:303:b6::13) by SA1PR01MB6573.prod.exchangelabs.com (2603:10b6:806:1a2::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Fri, 20 May 2022 18:37:03 +0000 Received: from CO1NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::d7) by MW4PR03CA0068.outlook.office365.com (2603:10b6:303:b6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16 via Frontend Transport; Fri, 20 May 2022 18:37:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 208.255.156.42) smtp.mailfrom=cornelisnetworks.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cornelisnetworks.com; Received-SPF: Pass (protection.outlook.com: domain of cornelisnetworks.com designates 208.255.156.42 as permitted sender) receiver=protection.outlook.com; client-ip=208.255.156.42; helo=awfm-01.cornelisnetworks.com; pr=C Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by CO1NAM11FT055.mail.protection.outlook.com (10.13.175.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:02 +0000 Received: from awfm-01.cornelisnetworks.com (localhost [127.0.0.1]) by awfm-01.cornelisnetworks.com (8.14.7/8.14.7) with ESMTP id 24KIb1W7055107; Fri, 20 May 2022 14:37:01 -0400 Subject: [PATCH for-next 1/6] RDMA/hfi1: Prevent use of lock before it is initialized From: Dennis Dalessandro To: leonro@nvidia.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org, Zheyu Ma , Douglas Miller Date: Fri, 20 May 2022 14:37:01 -0400 Message-ID: <20220520183701.48973.72434.stgit@awfm-01.cornelisnetworks.com> In-Reply-To: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> References: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4947066d-526d-4138-6a9a-08da3a8fbb8f X-MS-TrafficTypeDiagnostic: SA1PR01MB6573:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aJYSL6TH4tRIAq5RYQcD7nwhj32WyR3xCvqogjywz47ZsEHdQZ4XVKWusyY9bnrfW2UPcoaL4rOFL+4f3buu9KXvoMJ8BBUcT1NEFkcKo+qoW9Gb8NazKX0B7P/QMvU03Jbzeios8wyhklDlGal4TGpiETbVmzRxGBCm/yDk4glqAaMV2l80x8HrpDpljGiLzRIZVgYFAd161VjZWHK+eYosPgNO+DVjjNrkxPlRZgAAUIK3aYjLKegKpfXgLJzOCB1WA9W5lfYwCTCENN0QC8QcERA1/8LDikVH/9qmBbQW3jPLepk70YyjiBEmfZGxuwSRljzLP/sQswiVb+AQxAe2VI7f1CQ5NpYmGAPPQz1sIFS7E2BvG1+IM71ANYKiydavQ09FpMSVxX8CzuiZwOBYQQi+qBrypahOHn0tPFTG1Af+za8BR49zTtNPOdfoXB0khZHSdXASkYISnEsgwr4XFuD+dG+YQoqwD3bx83DrUea+f0ZXks73IJO9jbF45TvlXH3y0yYjJhY5i1/A6ErU19HW14wUEi96FchyZkKTuwhqh5Pym5aSHbNMWMK276pgqijS5SkaGP973FM1KI56uZPFZpz8PpfrpvdJZGB0iWtZR3Rjpv/EeIyu3itIeuhRBpSXJ+EQ3I2Zw5U4nG0g8Lt9ohhMM3Q18wGB3h2/z5N1Emp7n6AHQv6s95oYFp97uMa8yS+999vh8wTt+Q== X-Forefront-Antispam-Report: CIP:208.255.156.42;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:awfm-01.cornelisnetworks.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(136003)(346002)(376002)(39840400004)(396003)(46966006)(36840700001)(47076005)(426003)(336012)(54906003)(1076003)(55016003)(83380400001)(8676002)(41300700001)(186003)(508600001)(70206006)(4326008)(107886003)(44832011)(70586007)(7126003)(36860700001)(40480700001)(316002)(356005)(103116003)(26005)(5660300002)(81166007)(86362001)(8936002)(7696005)(2906002)(82310400005)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 18:37:02.6100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4947066d-526d-4138-6a9a-08da3a8fbb8f X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a;Ip=[208.255.156.42];Helo=[awfm-01.cornelisnetworks.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR01MB6573 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Douglas Miller If there is a failure during probe of hfi1 before the sdma_map_lock is initialized, the call to hfi1_free_devdata() will attempt to use a lock that has not been initialized. If the locking correctness validator is on then an INFO message and stack trace resembling the following may be seen: INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. Call Trace: register_lock_class+0x11b/0x880 __lock_acquire+0xf3/0x7930 lock_acquire+0xff/0x2d0 _raw_spin_lock_irq+0x46/0x60 sdma_clean+0x42a/0x660 [hfi1] hfi1_free_devdata+0x3a7/0x420 [hfi1] init_one+0x867/0x11a0 [hfi1] pci_device_probe+0x40e/0x8d0 The use of sdma_map_lock in sdma_clean() is for freeing the sdma_map memory, and sdma_map is not allocated/initialized until after sdma_map_lock has been initialized. This code only needs to be run if sdma_map is not NULL, and so checking for that condition will avoid trying to use the lock before it is initialized. Fixes: 473291b3ea0e1 ("IB/hfi1: Fix for early release of sdma context") Fixes: 7724105686e71 ("IB/hfi1: add driver files") Reported-by: Zheyu Ma Signed-off-by: Douglas Miller Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/sdma.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index f07d328..a95b654 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c @@ -1288,11 +1288,13 @@ void sdma_clean(struct hfi1_devdata *dd, size_t num_engines) kvfree(sde->tx_ring); sde->tx_ring = NULL; } - spin_lock_irq(&dd->sde_map_lock); - sdma_map_free(rcu_access_pointer(dd->sdma_map)); - RCU_INIT_POINTER(dd->sdma_map, NULL); - spin_unlock_irq(&dd->sde_map_lock); - synchronize_rcu(); + if (rcu_access_pointer(dd->sdma_map)) { + spin_lock_irq(&dd->sde_map_lock); + sdma_map_free(rcu_access_pointer(dd->sdma_map)); + RCU_INIT_POINTER(dd->sdma_map, NULL); + spin_unlock_irq(&dd->sde_map_lock); + synchronize_rcu(); + } kfree(dd->per_sdma); dd->per_sdma = NULL; From patchwork Fri May 20 18:37:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12857238 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E857C433F5 for ; Fri, 20 May 2022 18:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352914AbiETShQ (ORCPT ); Fri, 20 May 2022 14:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352917AbiETShO (ORCPT ); Fri, 20 May 2022 14:37:14 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2135.outbound.protection.outlook.com [40.107.100.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CED86AA61 for ; Fri, 20 May 2022 11:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HQ32t8gi6fZ2hPq/dWeECQLVafsU/C3YMrjLCKyaL3NfmIRlyq7C7GuXPdjYwW88fi+1py0ye98EGGtRZsxZ62h6mBBdqMiUtNuSs70FTy151fiRv4ClqtuR7lF8vBeS6vNsWsEecuKXzpPPW7s6ttZYSSzue4bnNY/Y25AFqnLj5HyRLvozqBhvkY2TRI7EEJ8jueR2qnL+4nCGF/KzKsqD+ueK0pAr1wZgCiiif49Uj+32hUWLnUNyDEcZbVdjx0jJ+xzGgwvizHyRy6tFk7HEQTqqMKIEj6cMlc+GbEh3UmZuiMOqZ5OjwZVUYJzSr3laj5rhCZRJ5R8WSR83kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aykMwosWzNSiUIwhU8Moz0uN3rzW7qCsx009eetH4P8=; b=FbmOQWwKuFRfFiVM6dgXZXPNmsbbpfmmrVRTc5P8Y/5J+2xipGXnzpfHXq6wHVMsFLLrsgWTdB4HA4PiCvTok2Gzm6z7nWaQGllGTAS3Gs+/DVGUDbO1WrmswkG1hfypmMW3sjumuyRLO+/U8qQ86SrnWdSVsJvltcONGUbFiPottMkgWvlBloSbJh5HjDuMGzkPww9nUWdwPWUo6bpZ092di5BHyhwcnjgnGg5ow0O6U6o1JLBdrNEJo5xzyaXBcFklqiBG9DIrB02MyumH6NrcXjDypqteiYWhEp6FmfS0Y8gcG8P/8WNUjY6Ud0FSzL7EEm0ox6IsYHoxIJw4Vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 208.255.156.42) smtp.rcpttodomain=nvidia.com smtp.mailfrom=cornelisnetworks.com; dmarc=bestguesspass action=none header.from=cornelisnetworks.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aykMwosWzNSiUIwhU8Moz0uN3rzW7qCsx009eetH4P8=; b=GsBB1m2PFFDkYIPSZS3gDoUOEDIjaVN7DujDBPXRzaWRyAUAIOgm6sed301gp6/RWhSp+b+NUkuVBFwQgTKZkW1mKID4ll6Cfy9r0bKpys5MDur+pleTMLq1UgMTWeASlbtBZKtXufY2IJ91EgeBeudSIpCFFOQlsYyauwpuawnu2Q1n0ZQ5BP5LkYaWiwOrS5unGl1Djt/VCvEFUUXwYDZhoujWxIWfWWq9pDDxfWPAVCXg65K7hGYpQrzBmL5dejujXaHJFV+0TWmdC1PMew3I1dhw657xNZEp8E+bDnjhE5+dpGypLEykR5XNZ7T2etGVjqmgaIgCaQCQwUcsCg== Received: from MWHPR10CA0022.namprd10.prod.outlook.com (2603:10b6:301::32) by CY4PR01MB2533.prod.exchangelabs.com (2603:10b6:903:75::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Fri, 20 May 2022 18:37:08 +0000 Received: from CO1NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:301:0:cafe::67) by MWHPR10CA0022.outlook.office365.com (2603:10b6:301::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17 via Frontend Transport; Fri, 20 May 2022 18:37:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 208.255.156.42) smtp.mailfrom=cornelisnetworks.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cornelisnetworks.com; Received-SPF: Pass (protection.outlook.com: domain of cornelisnetworks.com designates 208.255.156.42 as permitted sender) receiver=protection.outlook.com; client-ip=208.255.156.42; helo=awfm-01.cornelisnetworks.com; pr=C Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by CO1NAM11FT016.mail.protection.outlook.com (10.13.175.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:07 +0000 Received: from awfm-01.cornelisnetworks.com (localhost [127.0.0.1]) by awfm-01.cornelisnetworks.com (8.14.7/8.14.7) with ESMTP id 24KIb66t055428; Fri, 20 May 2022 14:37:06 -0400 Subject: [PATCH for-next 2/6] RDMA/hfi1: Prevent panic when SDMA is disabled From: Dennis Dalessandro To: leonro@nvidia.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org, Douglas Miller Date: Fri, 20 May 2022 14:37:06 -0400 Message-ID: <20220520183706.48973.79803.stgit@awfm-01.cornelisnetworks.com> In-Reply-To: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> References: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed582c3e-b845-4854-0a99-08da3a8fbeb0 X-MS-TrafficTypeDiagnostic: CY4PR01MB2533:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QmYs+OXEhm0wlV4PlqG/ZcpVBdnA1QpOg6mC+wbXW0LMzNPBFbu5F0ZdRw4WoWIo3ijS+sJVQnS5+bK/ViuwHV9OmTL4rMSa0y0mGItgahEBeyljYy1B5tjInCJqOb3lhJXfH39Uaamly6m0XXFUWJ9yjpemwrSCl7eZAl/GKFIHsaYHdq9CCceEgoNrALkGgC+FIkcyZ4h+j6swnyRpA01I08R4vdOklfGixqhQL6DAWHgIRG6LdOqkOW4k7xfsH9wntWDuodIOZqlSTizcQKjIMLE6TeLCwFfWb7/lOu4exSg7Op7J1wxcNEuDeFD58yqOjQRzW/ykTtZdqMfqrnDQOpTvPpf6oCrzuTqLpkAnCSTAbKV19DS1DhBeGD2GlET4L9GMGEUxa4/pOBhSLSJ83NtJET/APE7WdHIfoUlXANgi1h3etuaEQOQZlmNdeaqT6tUUKKS726DMhUk+nJ4c3yb8+CA4Ayw05CMogtppz3ii7dbVNewHAtNQibl3GmQKPdcmAZD5vn7HFsyjsw3SIexW95ydC86dX9ayXDv0MJcp4R1rzRFmw2BciFdFYSSzyahvNejZbxegME/Ehyu7cYAWDyzaznjskpfrvQ6dzaD8VvkHMbduJooZ0LWY4PkKE/dhzavWfrXJAvlt2ZB2utr7gSfRIRhKfDbqCWigcPAGNElHrl9UEUcQW0M71Ah+aRXLtjKIFauuAyVEBQ== X-Forefront-Antispam-Report: CIP:208.255.156.42;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:awfm-01.cornelisnetworks.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(346002)(136003)(396003)(376002)(39840400004)(36840700001)(46966006)(8676002)(70206006)(81166007)(7126003)(4326008)(7696005)(44832011)(86362001)(26005)(508600001)(103116003)(8936002)(2906002)(83380400001)(5660300002)(70586007)(316002)(186003)(55016003)(107886003)(82310400005)(36860700001)(41300700001)(356005)(336012)(47076005)(426003)(40480700001)(1076003)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 18:37:07.8570 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed582c3e-b845-4854-0a99-08da3a8fbeb0 X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a;Ip=[208.255.156.42];Helo=[awfm-01.cornelisnetworks.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR01MB2533 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Douglas Miller If the hfi1 module is loaded with HFI1_CAP_SDMA off, a call to hfi1_write_iter() will dereference a NULL pointer and panic. A typical stack frame is: sdma_select_user_engine [hfi1] hfi1_user_sdma_process_request [hfi1] hfi1_write_iter [hfi1] do_iter_readv_writev do_iter_write vfs_writev do_writev do_syscall_64 The fix is to test for SDMA in hfi1_write_iter() and fail the I/O with EINVAL. Signed-off-by: Douglas Miller Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/file_ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c index 1783a6e..cb65f31 100644 --- a/drivers/infiniband/hw/hfi1/file_ops.c +++ b/drivers/infiniband/hw/hfi1/file_ops.c @@ -265,6 +265,9 @@ static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from) unsigned long dim = from->nr_segs; int idx; + if (!HFI1_CAP_IS_KSET(SDMA)) { + return -EINVAL; + } idx = srcu_read_lock(&fd->pq_srcu); pq = srcu_dereference(fd->pq, &fd->pq_srcu); if (!cq || !pq) { From patchwork Fri May 20 18:37:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12857239 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C1EEC433EF for ; Fri, 20 May 2022 18:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349439AbiETShU (ORCPT ); Fri, 20 May 2022 14:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352912AbiETShS (ORCPT ); Fri, 20 May 2022 14:37:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2112.outbound.protection.outlook.com [40.107.244.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E1096620E; Fri, 20 May 2022 11:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1EbJmz/4JkFzD4awedT8cxr5654CQS5d8E4xGfcqj5EGw86tQyxh4kB0zzPOyYd+q8ViNHUDU41ihTppjpkBgJSTGtQQY/Osesb8KTBejmQ1W1OgwiPuhkOZOOHKmZpFQvGeO9Bd3wQ9cEHpm8hMv8xP63IgsxER7dNAzhUlaCf//vGIUb2R9S1snNDvKmi9oxkzsZEcV1QnYDy1gwNj9hfLk0UmF50rhL437HRRNvMzKsW/zTQp0lMBl6YFwBVfL5BOhk/a5ylDzltx9pLVmdrdtyAzIHrlp//AQK4mn2r7NAdaQgbEM4l+uFoLsV/ae1SRlJSrdNgeTErErCKxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oba2kjB8KuG6MMG1wDq9qjXc2rlurAIxQNSb1MyYjXI=; b=UJm/spcVupT5sTDGXHzd2deRu5bZo7z+uurUrk++pbl18Bu+5p5gNWGCtpfg+6lXOQ77huaJlcM3fnU7h3juL9Q/tzxAnv7ZZWNI1Pj1wPxopoABtQhPvP9MwTfoccME6pebpIWdWGQb9+WEuPQi8XeP/Dn1gJksc5MlYPf5p3Jni/xgT7lgV5ZKzeqVx3mGTZfg7L5dDfFcl9LWROKLMX7UWo/vyLMUr37O55CIUOeCdcJoQFvYci1vph6595+3QXGTII2Xl09ArpXwzMNUmZbiW1SoRbTm1yxnrd5FEFKFRTYUevHFmLkOyGtVRuMoa4QSaPeFeFLEJgCIyVPaqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 208.255.156.42) smtp.rcpttodomain=nvidia.com smtp.mailfrom=cornelisnetworks.com; dmarc=bestguesspass action=none header.from=cornelisnetworks.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oba2kjB8KuG6MMG1wDq9qjXc2rlurAIxQNSb1MyYjXI=; b=LQV+zNKgcWimN/Jfk50uWXq/ozhaCLbyBujrgIZ2QCB0x1Z0z0MN5O1RN5pOWpiKWOCOuj0lB2tDf7+rXPAFh5Ys8560v/xpYiuMkXkOiHETrwYpHRVMkvydaJZixsDrBKwzuOLF/rAF3cIbnQJOt2c+ePpYE7dfl/p/vwFAlmfBzNo93OIZ9ysKXRokBx0eQp0lfz9eoIEjRHNq4ZJozpTxiXqkjyEa23KWOLP9Qbh9KIXvJ9F2DAqo785bnZKw9LJG2p4lLWJYXLtIgJzXGWK8w+kcyK1fH+a6x4kmGX6ol7+fyFB1RP54Z8Amzwi44Go1aAEXIzgskG943CG7rw== Received: from MW4PR03CA0111.namprd03.prod.outlook.com (2603:10b6:303:b7::26) by BN6PR01MB3298.prod.exchangelabs.com (2603:10b6:404:da::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Fri, 20 May 2022 18:37:14 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::f9) by MW4PR03CA0111.outlook.office365.com (2603:10b6:303:b7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13 via Frontend Transport; Fri, 20 May 2022 18:37:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 208.255.156.42) smtp.mailfrom=cornelisnetworks.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cornelisnetworks.com; Received-SPF: Pass (protection.outlook.com: domain of cornelisnetworks.com designates 208.255.156.42 as permitted sender) receiver=protection.outlook.com; client-ip=208.255.156.42; helo=awfm-01.cornelisnetworks.com; pr=C Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:13 +0000 Received: from awfm-01.cornelisnetworks.com (localhost [127.0.0.1]) by awfm-01.cornelisnetworks.com (8.14.7/8.14.7) with ESMTP id 24KIbCAk055738; Fri, 20 May 2022 14:37:12 -0400 Subject: [PATCH for-next 3/6] RDMA/hfi1: Fix potential integer multiplication overflow errors From: Dennis Dalessandro To: leonro@nvidia.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , stable@vger.kernel.org Date: Fri, 20 May 2022 14:37:12 -0400 Message-ID: <20220520183712.48973.29855.stgit@awfm-01.cornelisnetworks.com> In-Reply-To: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> References: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb1237c7-f868-45cf-f3d3-08da3a8fc214 X-MS-TrafficTypeDiagnostic: BN6PR01MB3298:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IFTJCa8UybvUJDgGUlOdmTUfCKHGqjg9G0zHV2399p5R4gVLRd0/Vhnlf5W9hdw3poYK+ai9ov7WNqs3PiRtyYMMGKGsAOj95tHXZj+KA2YjQzezteSvLawDwC34yp5/3SwbAMQpnDBK0X+rynJ9lhc6psSI1+xl4XuA1EUzpS5BDCDnZhtEv1GP+wEU0NuSyKAefJmgcINRV9ES9KcEml2RAz62f79ZJIFKf8BSbQlMOmcoMzTg/ucJnog/TKTn1hxSZH1+Rb0da4kiwGeQLsKzmFSygD/u+2bEiEHHxiOK1Wple6BopA6a22biujvs1BfV5+S0OQnttGgIZFzP2Uz5K82tfEYD9mOwhPPGkcN/3sSteqQA7UjclQdqc/hxJScth3/lbc4wbqLfY79KRWjUI+49VyJ61ZGIme7mCAp7X4zByrQ6TROqIg4vsi+xIJrO2y60EKEj6cZaKqR4iF9imfq4zBaQqH4p8RmPffWfKF1XS/CIP563MCFhek1WJElPAyiDMvUXFOIGsq+FacMrRECRcS2mx8urY2zRdqKMkPYMHUC3RVUuMeVh6+fiYb7JyQfCqhFOR4B6Tp9qF7pGFxLvsNbEtkk5kguVNFrIkG7aYmr8avU8DBgjo62b5kcan7HKnk/bjYPPtMm+PbcDc5G/8b2AwZqp6tisTuIzLiWeqhztRhFzIFHBn+Ze8v0rmIMyFuC6bdFVQXJkhg== X-Forefront-Antispam-Report: CIP:208.255.156.42;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:awfm-01.cornelisnetworks.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(396003)(346002)(39840400004)(136003)(376002)(36840700001)(46966006)(426003)(336012)(316002)(186003)(86362001)(36860700001)(44832011)(5660300002)(83380400001)(103116003)(70586007)(4326008)(70206006)(47076005)(7126003)(81166007)(1076003)(8676002)(8936002)(2906002)(41300700001)(508600001)(55016003)(356005)(7696005)(26005)(40480700001)(82310400005)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 18:37:13.5671 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb1237c7-f868-45cf-f3d3-08da3a8fc214 X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a;Ip=[208.255.156.42];Helo=[awfm-01.cornelisnetworks.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR01MB3298 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org When multiplying of different types, an overflow is possible even when storing the result in a larger type. This is because the conversion is done after the multiplication. So arithmetic overflow and thus in incorrect value is possible. Correct an instance of this in the inter packet delay calculation. Fix by ensuring one of the operands is u64 which will promote the other to u64 as well ensuring no overflow. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Cc: stable@vger.kernel.org Reviewed-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 4436ed4..436372b 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -489,7 +489,7 @@ void set_link_ipg(struct hfi1_pportdata *ppd) u16 shift, mult; u64 src; u32 current_egress_rate; /* Mbits /sec */ - u32 max_pkt_time; + u64 max_pkt_time; /* * max_pkt_time is the maximum packet egress time in units * of the fabric clock period 1/(805 MHz). From patchwork Fri May 20 18:37:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12857240 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4ADDC433FE for ; Fri, 20 May 2022 18:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232431AbiETSh0 (ORCPT ); Fri, 20 May 2022 14:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352899AbiETShX (ORCPT ); Fri, 20 May 2022 14:37:23 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2136.outbound.protection.outlook.com [40.107.92.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE6CF8AE49 for ; Fri, 20 May 2022 11:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UXTzxuFpVX5c2iJTZBq60Ab0mkUqRfjmyVT6UngMszjBRUQvPjqBOo0oLFxcJ3hTZLcxKr0sRNToGbBcKenfbDBNppRt4qYIJJ0NvxeJX9wQRfDhQvuJ2wvPl9JM5SErP25Gsk1yi8Gpoog64xC2BhK3xCaq6YaHmcADfvNg8/LRpY9hz3IrBlgECrQhSOFRUq2NaShAvdt6Ihxu7NLe0KZTKf1IGbDhWB1UTBRdUZBPF8zt2c3SflCdMYKlXQvjYUw0xUuk1H7pCJDiamAwb73d0eouSSmkfWxTHflkTMr2CVxe3voOntTBW+3yTTSJkxH3VBPPkCHi36kb7XOYOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Hf9+oQy0Ie3S1PD4EEnLbTbYp1mFiwKnJ4pVQh3tw/0=; b=lMeqel/VHa3fF0ohKRwlnri/SOHsyHy1y1pxfGMP+/NhqNbXwEBrCa00udbcDCy4gSEhW4FYR8I20ETOtEuEugQy8KwqAtTCl7dTxg4KKa06HkhVQZkvkDmDpDxNSEiSvomB+wlMvF73cZqoF8sD6XKh1OyT7poOJClssaSGNalGII/2NeJCguk6nYIqwP4P8MPHso6OX92oR0il4GUdqfDHz9DEauB7pLfmMqWmo1lQYzMiuaa/dHS6LmR/Nz76v5n55xA+1rLb9caHc502UBXXHWIIbE6QDPc7DtK0ud/zBrhwbY9mlMY7QaftvmYdxgLhUpidYB66leR3qp4y9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 208.255.156.42) smtp.rcpttodomain=nvidia.com smtp.mailfrom=cornelisnetworks.com; dmarc=bestguesspass action=none header.from=cornelisnetworks.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hf9+oQy0Ie3S1PD4EEnLbTbYp1mFiwKnJ4pVQh3tw/0=; b=Aav3z4K9BuRTU6W/2EFCYZAMy+wr/SCU+MznJUULPlf4MoFnkJyr9gZTsn3kj7N7FtumlCbUNJs23NbdEVei5YDF+YVdKVW5KZYAqjiHFCgohPyF3oAkW7A5fUPzd5Z833rmV2fgYSY1cblj4GdLTLJNk/0kQEIIgANP/kQa1bHhMjEROe4rXqQqZ+nph/YoQ/ukenvZm7/sZTlLjFzaEpwumlmt7mJSxahuj7VHL1kaKxptTjb9r6MM06ZKAA92VfU4ubs5GKjEEWygWRCDiZM3Ln7NR+ivGrXeH9P9km4TFLzGWLBvy+rqbnk5GyU7OqwkV9kbXmnCH3uuSRbyhA== Received: from MW2PR16CA0065.namprd16.prod.outlook.com (2603:10b6:907:1::42) by SA1PR01MB7360.prod.exchangelabs.com (2603:10b6:806:1fb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Fri, 20 May 2022 18:37:19 +0000 Received: from CO1NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1::4) by MW2PR16CA0065.outlook.office365.com (2603:10b6:907:1::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17 via Frontend Transport; Fri, 20 May 2022 18:37:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 208.255.156.42) smtp.mailfrom=cornelisnetworks.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cornelisnetworks.com; Received-SPF: Pass (protection.outlook.com: domain of cornelisnetworks.com designates 208.255.156.42 as permitted sender) receiver=protection.outlook.com; client-ip=208.255.156.42; helo=awfm-01.cornelisnetworks.com; pr=C Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by CO1NAM11FT057.mail.protection.outlook.com (10.13.174.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:18 +0000 Received: from awfm-01.cornelisnetworks.com (localhost [127.0.0.1]) by awfm-01.cornelisnetworks.com (8.14.7/8.14.7) with ESMTP id 24KIbHV8056069; Fri, 20 May 2022 14:37:17 -0400 Subject: [PATCH for-next 4/6] RDMA/hfi1: Remove pointless driver version From: Dennis Dalessandro To: leonro@nvidia.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org Date: Fri, 20 May 2022 14:37:17 -0400 Message-ID: <20220520183717.48973.17418.stgit@awfm-01.cornelisnetworks.com> In-Reply-To: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> References: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f3d5c0e-9f70-459d-ba60-08da3a8fc4e6 X-MS-TrafficTypeDiagnostic: SA1PR01MB7360:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oC13PeSFePqzEWUkuuF+/cDfl1aWKFqTzIaxtiI4oM55Sjb2ImnfnS97uv1kxgW43a5vsXpwjTd/dJAaiAfhTpSA7RLHH58iKDEaDcLDzQhUCsi/BHgVg0sogeqp063PDIfAkG/kv3yEIy6NAguBfbnOb5eJWKpl9b7gG7oN7WUicq4fJfZWGSNM+/nFdIHC9CV0EOznfD8sic3RUMQQKktISey9uFgWlKNFf6/mC+QbcsWCbQx40IGitg1Ab/Qhplp+jomks5bGTs0ZWqCGzSHIB/OaZ2ojf5hhbWAH6OVoM2lpS8CUe0/Ac25wAHPsDCtDAtESSX3ZIS6wBUh/eECghSCgwOQwyzBAt32DSPetIp6g7uEjimCfcYr8ad1a4Gqp8Ci5XFJ5QZ8ykg8Gp1kz8n+N3huknKem3I8Wcnf0cS3mBsZMpDzOl2WJJyAryq2vJDuxMcar9kyhT0pCwDgouz5Re+wBSgMmFMagUGwdc0IA4DTtKaYcvsjLpHUinJ+3z2MOMo+ICn9z9I1WyYNghKxxGoqjrQ7S8LJ3hAQ5gh154hKZ5oeN6APMtaun3judjiAK9T4ALKT2OKANi7DbYCtUdEARAn2zbfWGfMVUQPCAoqJP0OnJVxGCQ31DtVo4hEaX4PUQ1jiip2BBZ3+Ep6SKLd5GIgD48oaTYT4dYyugztwhzke1Xp96eYMTC1qjoS9KrhFp4dpabIxXUw== X-Forefront-Antispam-Report: CIP:208.255.156.42;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:awfm-01.cornelisnetworks.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(396003)(376002)(39840400004)(346002)(136003)(36840700001)(46966006)(82310400005)(186003)(1076003)(36860700001)(7126003)(44832011)(5660300002)(41300700001)(83380400001)(2906002)(8936002)(103116003)(40480700001)(508600001)(55016003)(336012)(426003)(47076005)(7696005)(70206006)(86362001)(8676002)(26005)(4326008)(70586007)(316002)(356005)(81166007)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 18:37:18.2817 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f3d5c0e-9f70-459d-ba60-08da3a8fc4e6 X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a;Ip=[208.255.156.42];Helo=[awfm-01.cornelisnetworks.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR01MB7360 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Driver versions have long been forbidden in the RDMA subsystem. We removed most of the code relating to them and have been very strict about not allowing. However there is some leftover versioning that we do not need. Get rid of that. Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/common.h | 15 --------------- drivers/infiniband/hw/hfi1/driver.c | 6 ------ 2 files changed, 21 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/common.h b/drivers/infiniband/hw/hfi1/common.h index 995991d..73a2f13 100644 --- a/drivers/infiniband/hw/hfi1/common.h +++ b/drivers/infiniband/hw/hfi1/common.h @@ -155,21 +155,6 @@ #define HFI1_KERN_SWVERSION ((HFI1_KERN_TYPE << 31) | HFI1_USER_SWVERSION) /* - * Define the driver version number. This is something that refers only - * to the driver itself, not the software interfaces it supports. - */ -#ifndef HFI1_DRIVER_VERSION_BASE -#define HFI1_DRIVER_VERSION_BASE "0.9-294" -#endif - -/* create the final driver version string */ -#ifdef HFI1_IDSTR -#define HFI1_DRIVER_VERSION HFI1_DRIVER_VERSION_BASE " " HFI1_IDSTR -#else -#define HFI1_DRIVER_VERSION HFI1_DRIVER_VERSION_BASE -#endif - -/* * Diagnostics can send a packet by writing the following * struct to the diag packet special file. * diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index e2c634a..8e71bef 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c @@ -29,12 +29,6 @@ #undef pr_fmt #define pr_fmt(fmt) DRIVER_NAME ": " fmt -/* - * The size has to be longer than this string, so we can append - * board/chip information to it in the initialization code. - */ -const char ib_hfi1_version[] = HFI1_DRIVER_VERSION "\n"; - DEFINE_MUTEX(hfi1_mutex); /* general driver use */ unsigned int hfi1_max_mtu = HFI1_DEFAULT_MAX_MTU; From patchwork Fri May 20 18:37:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12857241 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43833C4332F for ; Fri, 20 May 2022 18:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352805AbiETSh3 (ORCPT ); Fri, 20 May 2022 14:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352884AbiETSh2 (ORCPT ); Fri, 20 May 2022 14:37:28 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2099.outbound.protection.outlook.com [40.107.237.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37C616F900 for ; Fri, 20 May 2022 11:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vs34c3UAul+kx81O0fuj8NyEodQfidAy8H9HTxWeeNYjA93bUq672OeXTc59Ej/yDMxo17zri/FQa8dep58Y7H5wqBquho1rHIDzqmYTB8JAKsw9acgj6xWppuCuUZ02btycllZYnBA/DAyHDMGlTWF4wvT4xTN8cZ20BSs9hSGLONDHd92wmfu8ku4doyLKyXL1q0hCT0K9BDl8AaqxeRhvI/rr2IUhDbNQZvs36BvJWRInjg+quxMlJJ2xNhcnKEXaotIQPlIv7Ngx0nNSSMgeJ3/nlvK0WuLCF143bNyPUALJNlSAUojQXwtFWD1BQMYeieL+DTBOa97QMC9Iuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a8hIRO73NeizVSu6xGoS+41/WiSEhzM/7pbOt/W2QNU=; b=YWiN4bw4Vyclxesf6mr5EtsG1ckIWJSwH7/xoortdpGSsqqQyqdGFq/D5iFhP2P7o9SIgfBzWdimy+zqvoDORWYH1hsOYZcUNtBDWCAEEZC4z6r61XXNvnMq8c8N1jSrDYsf1pBUEg4VV6EHrBYe/QPBbM0IbM9w10JEQgOBjAncItFn0UYL7cOMDPo6iWaMpK6yVGtC0Cje/JCNJk1M3T/WwTrdeho/EDjY+XMYFtCGRyG02sc7Mj3VoJLSuEqxdQ7MJL8dvj0F6bFIgsNahiSg5oISsZsQ6diuZ5sHmT3afzJDSN5vl1QrM0physBxwDe+CQ6evhpWgTqzQf5mNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 208.255.156.42) smtp.rcpttodomain=nvidia.com smtp.mailfrom=cornelisnetworks.com; dmarc=bestguesspass action=none header.from=cornelisnetworks.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a8hIRO73NeizVSu6xGoS+41/WiSEhzM/7pbOt/W2QNU=; b=dBPEMtueAltv+0r7AVysAkQg4r0YvlvPNDuOLVHhSbe11CWwxGnhOnKakAAMZyc7ltDywt36N7zV1SH+Hu4aM5MMIZzIZN5VuDJCDi8lA8QSXtJMR4dOsrgNQlEylwho42tvhO007DWzQaluLR1ZSydsr2Xba6FwfQtcB7c/6H+RXPxHqx2wRyZHtAhQRq2qQ9SzWtHyK5kAbUYSCcE967sMFCm5uDXTd9ejCaZEn1zcEw/rxCuiWdhjE49D7SF02sZrGmZUpgZyr8AWewQzbpgchyYq/p17d9vHjnPRI3XznvH8UaIITEAXZIozOvFEhzOfuC5j/YzfoI7sCr4KKw== Received: from MWHPR14CA0038.namprd14.prod.outlook.com (2603:10b6:300:12b::24) by DM8PR01MB7205.prod.exchangelabs.com (2603:10b6:8:f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15; Fri, 20 May 2022 18:37:24 +0000 Received: from CO1NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:300:12b:cafe::f2) by MWHPR14CA0038.outlook.office365.com (2603:10b6:300:12b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17 via Frontend Transport; Fri, 20 May 2022 18:37:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 208.255.156.42) smtp.mailfrom=cornelisnetworks.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cornelisnetworks.com; Received-SPF: Pass (protection.outlook.com: domain of cornelisnetworks.com designates 208.255.156.42 as permitted sender) receiver=protection.outlook.com; client-ip=208.255.156.42; helo=awfm-01.cornelisnetworks.com; pr=C Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by CO1NAM11FT040.mail.protection.outlook.com (10.13.174.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:23 +0000 Received: from awfm-01.cornelisnetworks.com (localhost [127.0.0.1]) by awfm-01.cornelisnetworks.com (8.14.7/8.14.7) with ESMTP id 24KIbMLU056385; Fri, 20 May 2022 14:37:22 -0400 Subject: [PATCH for-next 5/6] RDMA/hfi1: Consolidate software versions From: Dennis Dalessandro To: leonro@nvidia.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org Date: Fri, 20 May 2022 14:37:22 -0400 Message-ID: <20220520183722.48973.60262.stgit@awfm-01.cornelisnetworks.com> In-Reply-To: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> References: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a2c60b8-8699-4cf2-cca1-08da3a8fc80f X-MS-TrafficTypeDiagnostic: DM8PR01MB7205:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JOym7kU43J4Ts4ISzZkUelfAjUs8nEacul9290GrPCEEtC2dXbk41kZ1naEQIcDFi8g31hOkxFqBQrII8W5Pm6O9RyxG16FZjkNE4WPaNrOODk9s8Hb54Zt1IwT0qEcmJOHxLo7CvVh/kL7GiVTLOxEvXjltxGnP/Dik8U6SzSb9gEQMMCZHqkEpikxAiv51d7ZMDmBJue3pTvCEcgBLW/KW8bdrb3i+tZbRdH0Ut6Ea4Vy228yGwbOKbhkekApncGmd9uh8+IuBfThvDKFTZ8+6aMmGaXLg4UEuE+gxuWuyAb/pevv2Gptz68W8NK/g1liMO/3jXLMR+GJKSP0aKp3la/qjTi0iYkTyu3AmihNQ+rkV53Quc/vWGUtqiJHcwAwEIsmSXAwf5MtCGBFIuhl+M6LoZdvWMYJA129GwRImSyV6IXabm1/NISxwPYc1/GUdB2awfNc2pwiNObJR6LdHLnAv99NZDNr7ABCVp12bMi31ydiNvJoxgmXjKUz6Aq/9TzMHbuyTkDNgMrqtmDo7Nr8/BOvqCuh1f4Z+Y06roI3vVGTum0PEzUxwo64j1ef4Qx77uqUl7MaP7nlJHWfjhUghRijuXksbwzF4HON8RBuqqXMmmLbELjc53alaOLR3x3KT5ceiGrj3W6hEXWO9mF999s4gF5KqQSkIWprPRBzBdJJgGFJ5+aey2e0fJxVjguajyCjr8dIT6mO7pw== X-Forefront-Antispam-Report: CIP:208.255.156.42;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:awfm-01.cornelisnetworks.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(136003)(39840400004)(396003)(346002)(376002)(46966006)(36840700001)(81166007)(186003)(36860700001)(2906002)(508600001)(356005)(103116003)(83380400001)(316002)(7696005)(26005)(41300700001)(86362001)(70206006)(40480700001)(70586007)(8936002)(5660300002)(336012)(426003)(47076005)(1076003)(7126003)(55016003)(8676002)(82310400005)(44832011)(4326008)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 18:37:23.5997 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a2c60b8-8699-4cf2-cca1-08da3a8fc80f X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a;Ip=[208.255.156.42];Helo=[awfm-01.cornelisnetworks.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB7205 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org There is no need to have separate user and kernel software versions. There is a single software that the kernel is compatible with. Also remove the notion of a "kernel type" that is long since deprecated. Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/common.h | 17 ----------------- drivers/infiniband/hw/hfi1/file_ops.c | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/common.h b/drivers/infiniband/hw/hfi1/common.h index 73a2f13..f32f858 100644 --- a/drivers/infiniband/hw/hfi1/common.h +++ b/drivers/infiniband/hw/hfi1/common.h @@ -137,23 +137,6 @@ #define HFI1_USER_SWVERSION ((HFI1_USER_SWMAJOR << HFI1_SWMAJOR_SHIFT) | \ HFI1_USER_SWMINOR) -#ifndef HFI1_KERN_TYPE -#define HFI1_KERN_TYPE 0 -#endif - -/* - * Similarly, this is the kernel version going back to the user. It's - * slightly different, in that we want to tell if the driver was built as - * part of a Intel release, or from the driver from openfabrics.org, - * kernel.org, or a standard distribution, for support reasons. - * The high bit is 0 for non-Intel and 1 for Intel-built/supplied. - * - * It's returned by the driver to the user code during initialization in the - * spi_sw_version field of hfi1_base_info, so the user code can in turn - * check for compatibility with the kernel. -*/ -#define HFI1_KERN_SWVERSION ((HFI1_KERN_TYPE << 31) | HFI1_USER_SWVERSION) - /* * Diagnostics can send a packet by writing the following * struct to the diag packet special file. diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c index cb65f31..231cced 100644 --- a/drivers/infiniband/hw/hfi1/file_ops.c +++ b/drivers/infiniband/hw/hfi1/file_ops.c @@ -1223,7 +1223,7 @@ static int get_base_info(struct hfi1_filedata *fd, unsigned long arg, u32 len) memset(&binfo, 0, sizeof(binfo)); binfo.hw_version = dd->revision; - binfo.sw_version = HFI1_KERN_SWVERSION; + binfo.sw_version = HFI1_USER_SWVERSION; binfo.bthqp = RVT_KDETH_QP_PREFIX; binfo.jkey = uctxt->jkey; /* From patchwork Fri May 20 18:37:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12857242 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADCE8C433FE for ; Fri, 20 May 2022 18:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352957AbiETShh (ORCPT ); Fri, 20 May 2022 14:37:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352946AbiETShf (ORCPT ); Fri, 20 May 2022 14:37:35 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2096.outbound.protection.outlook.com [40.107.223.96]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B1F1195934 for ; Fri, 20 May 2022 11:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bPn+8mpA3n6RBrmvf9/xtsolNH45SaEg0gDcUuibuEOy7bGnuW0Ita1w2bfhJdt014tm1gTcGwsZwvwYydA+9WWeq6a7uZHAMtXjiZ+eXIhO4lcnzuhOdBZghVGtNTGMsUfwg8m9LZAeYI+GP6rZzdWkOGIp+o5R+mIL+Sm7xDCVsxy5IbwR3QLOBRpOU1uM5K59tX+EbihE6Ok3umXnY+pMHqYG5HIpL5Yz+SSz4znJ5/PLycktBvwhS0xVl9yuNW3A7Iz0EGLkfzEBy+QZo+70jOBFgg0nA6KYxLIEPFUo6+DIMM0KXPQ0Z+IA+kT522QeI5jKk95O9ayofR2LvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=35+qFFoJMGLSyuqUYFOf1FhMq8V1FHvskPvODH76Osk=; b=TEPPJkR6T/SG2qXj0mfj9W2rZlck29YcrSSPQlrC5ueALIS4MMKPM4Rr0RlUeebrDwANaefexS/gca9ezu7lBFJ3jt3Q9QPSGsPSw6dn0NdVNP0/708MLhXA1OiD0qwXJq1m95K0KWkxnsXiGCnGK91HewiR038eJq+wnASGeiFxwgqwLpHkKA4tqQqIX6NWa4vvthZPWVXxVULWlyi/rvnHwbEGizhXjUUyVwhTaizmPStZMVsNcGBISkCVm0RAOckKMnK3R2cJ2thD2kAkz9nmoy/E+SAq2SYV3dzzZc7E9Ges8Wje6eWiFsPiCk/pz9sDgY87DxfGybBAaQbEmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 208.255.156.42) smtp.rcpttodomain=nvidia.com smtp.mailfrom=cornelisnetworks.com; dmarc=bestguesspass action=none header.from=cornelisnetworks.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=35+qFFoJMGLSyuqUYFOf1FhMq8V1FHvskPvODH76Osk=; b=WwOdBS/J5KZTTv4cAo3pRzPEPMcJO+uZXFiZX6Kyl7TzLP1htnw7eKcVc3+BIOWgD93SM7wiivNgs6Oejkk295EOM6qPWjjCfDqaUl3UinXTvPXt2vNHAXIggO8yrVsqJWUZyDPIDfR0UtO2sNBED5b0XJffWAm2kDOwZJlzL7Ao8NL2wRvUIwQ8phsd5Kn9UacHNBHTB3FuZe4yMdtNoOlEGzutsM4fkIiiXfF6+ci63AUcKlYKeFcioEVp0xQbzIHiztD+Jcoh3IgZdMISsQfhNSr9Ry63jjnsimUilOknxkuQIdvEn2Y+IcWtgRniz3q01vxIta9NOHo1PKy8oA== Received: from MW4PR03CA0058.namprd03.prod.outlook.com (2603:10b6:303:8e::33) by DM8PR01MB7046.prod.exchangelabs.com (2603:10b6:8:1b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Fri, 20 May 2022 18:37:29 +0000 Received: from CO1NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::ff) by MW4PR03CA0058.outlook.office365.com (2603:10b6:303:8e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 208.255.156.42) smtp.mailfrom=cornelisnetworks.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cornelisnetworks.com; Received-SPF: Pass (protection.outlook.com: domain of cornelisnetworks.com designates 208.255.156.42 as permitted sender) receiver=protection.outlook.com; client-ip=208.255.156.42; helo=awfm-01.cornelisnetworks.com; pr=C Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by CO1NAM11FT068.mail.protection.outlook.com (10.13.175.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Fri, 20 May 2022 18:37:28 +0000 Received: from awfm-01.cornelisnetworks.com (localhost [127.0.0.1]) by awfm-01.cornelisnetworks.com (8.14.7/8.14.7) with ESMTP id 24KIbRMO056711; Fri, 20 May 2022 14:37:27 -0400 Subject: [PATCH for-next 6/6] RDMA/hfi1: Remove all traces of diagpkt support From: Dennis Dalessandro To: leonro@nvidia.com, jgg@nvidia.com Cc: linux-rdma@vger.kernel.org Date: Fri, 20 May 2022 14:37:27 -0400 Message-ID: <20220520183727.48973.93587.stgit@awfm-01.cornelisnetworks.com> In-Reply-To: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> References: <20220520183516.48973.565.stgit@awfm-01.cornelisnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e95671fe-e976-4d52-3d78-08da3a8fcb35 X-MS-TrafficTypeDiagnostic: DM8PR01MB7046:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7Z0HTdb2TvUQxboTjDgr9e1Cu9vUPLTQQg1772uhichq8sSa0YB7W8iwcTzb32bg8CBoG13tQRCTbEyBvkQu58os8hAWAWhCzFN1KiccoiXhV+QyhFZTlXRyWLLMnGDVYUuAj+mFQ7w9GL3r+4MWyrJOdX8qJwG3bu42ZTiP68q86IA4Ws5OHRHuQj0sB/eptR/5aNEqYukCz0zG+ICdgk4eD5ghFjFLBstkvwypjq4ZBjHGgdx8WJAd1LwAuhenjMBJb9w+XnLUnDJf4oqRT+l4vVY9zUB2zU9Ofapf0e+bfB1zXwaeiJ1VhAspb8ZKhuN/Cj8TOElF2DqQ35QSEXaSrybC8RCR97+WjVh7THefZ/micBZ5KsWkRapxhhMgk0ZEsoYNT6az4VX3hQ2YOvg1RJFJT9hbHmSSCdNHZ2M3AysSFo9xtMcphVVQAdlkw4G5d2ry2FSflSjUMuYETS8MScmxnKcsThwPEQt5kJ2F1J/M6YzwJnlMCIL7cLmvSInYcwPFbDyd1AmAoaiVxi1sX19e2d8+lMI5qcrwL+vGNfSdG3MhLniuzPtgaUi7RvhBAzo21S+f7iZrM7Z0JGv5e/Cdwfl6HXZOW5faNcZkxlocmWCgzHiChoYb0KxTFRC5CdzANiWKfuV9Xqh9zCg1LAvJ5K4RIZfEjY+qcydleC4L9y3YlD/cEmtRzuGFS4sCA6JA7dYXoIM8JvWTjw== X-Forefront-Antispam-Report: CIP:208.255.156.42;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:awfm-01.cornelisnetworks.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(39840400004)(376002)(396003)(346002)(136003)(46966006)(36840700001)(44832011)(47076005)(5660300002)(70586007)(81166007)(8676002)(356005)(4326008)(8936002)(70206006)(103116003)(82310400005)(26005)(36860700001)(336012)(426003)(86362001)(7696005)(316002)(41300700001)(2906002)(40480700001)(1076003)(83380400001)(7126003)(55016003)(186003)(508600001)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 18:37:28.8782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e95671fe-e976-4d52-3d78-08da3a8fcb35 X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a;Ip=[208.255.156.42];Helo=[awfm-01.cornelisnetworks.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB7046 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org One of the concessions we made to get our driver upstream was to remove the diagnostic packet support. There is however still some cruft that was left over. Remove it. Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/common.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/common.h b/drivers/infiniband/hw/hfi1/common.h index f32f858..166ad6b 100644 --- a/drivers/infiniband/hw/hfi1/common.h +++ b/drivers/infiniband/hw/hfi1/common.h @@ -138,29 +138,6 @@ HFI1_USER_SWMINOR) /* - * Diagnostics can send a packet by writing the following - * struct to the diag packet special file. - * - * This allows a custom PBC qword, so that special modes and deliberate - * changes to CRCs can be used. - */ -#define _DIAG_PKT_VERS 1 -struct diag_pkt { - __u16 version; /* structure version */ - __u16 unit; /* which device */ - __u16 sw_index; /* send sw index to use */ - __u16 len; /* data length, in bytes */ - __u16 port; /* port number */ - __u16 unused; - __u32 flags; /* call flags */ - __u64 data; /* user data pointer */ - __u64 pbc; /* PBC for the packet */ -}; - -/* diag_pkt flags */ -#define F_DIAGPKT_WAIT 0x1 /* wait until packet is sent */ - -/* * The next set of defines are for packet headers, and chip register * and memory bits that are visible to and/or used by user-mode software. */