From patchwork Fri Oct 29 11:29:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12592527 X-Patchwork-Delegate: kuba@kernel.org 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 153A7C433F5 for ; Fri, 29 Oct 2021 11:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE56360E8B for ; Fri, 29 Oct 2021 11:29:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231901AbhJ2Lbv (ORCPT ); Fri, 29 Oct 2021 07:31:51 -0400 Received: from mail-mw2nam10on2134.outbound.protection.outlook.com ([40.107.94.134]:11008 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231807AbhJ2Lbu (ORCPT ); Fri, 29 Oct 2021 07:31:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=leuE0IBIiGqvg4PoQs3gTJn0Xn3y4Wac3eSBYd7Ux+T3+2RS4IJGv1yv0Xdv/Nc4pYfeo5pUrEbHMixwHxfHEJJR1EEljCzWW7vAM1YAiy5O8WR1dBfxODJ54LCeMC85z4hH164htawb2j6/2qHKU3Ei62DV0mXffC3o7ROTldF4J1w8Hia7AgrH5mpC1jbGrmYzceYfgiuUwTqm9Kzc5RJyD7cZskOEMyTCYJVKvbwGhHEMvjNzgLt5dWyH5FS4aDsxJmoFEGEzksAbNg3MODysDSdAbb+M9xNAtbkobykiLxlKLYwDVZP7RKEDW4SP+jjvjsW5EKXFfYh5SCMJHA== 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=CKs1GzUL8/avXPIe8YBkoXOM8GTUHsRLDsBPsZCUDhE=; b=XytlWsfkxpQtZr3G07UYdHhzrCcpPS559uw2VBU8DQK3O+4h8pEOQyk1wPnqVtksMyNLpZjLqyhlk7spI+a69p0Jo/AkQ83iaEsH8GM3v/hTh3ecrPtsyl93m4uDp1vU8pY4Alm1KdX23wgcOve205RXoU1RPirALnBLAhuHkJfvjJ1o4YzH/zNJ46p2dcirz4BP4LxFJlnj4p7VgoLp5554MDRJKd9Kqv5dbVVh2U3FVBjIh8/K5f531kI3kz5cCDZ8kdCBr/es3IjhFLEURGkOlyrzquX3lxAL51qsgZYY6c3lg/l6AUveQgRhTvwTGdCJNtZKnuLkyE1k+1K+tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CKs1GzUL8/avXPIe8YBkoXOM8GTUHsRLDsBPsZCUDhE=; b=dfwYpkA0mXM2gsTj8vXfWGBryCD83QUY8LLE0jPekGRh+dcOE/Use/0EBpCikczzpf7jMpyECIsevv6uMidQg3zK8F16vRpEXKWmKFd8dpC7JhmaeCjjnZByXTDITssegoYIK+HrRsCRDGqf+0yF0nBIzjdn8zqM+Mt+Ib+nebQ= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH0PR13MB4828.namprd13.prod.outlook.com (2603:10b6:510:93::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.12; Fri, 29 Oct 2021 11:29:19 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::e1d9:64d0:cb4f:3e90]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::e1d9:64d0:cb4f:3e90%9]) with mapi id 15.20.4669.005; Fri, 29 Oct 2021 11:29:19 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Yinjun Zhang , Louis Peens , Simon Horman Subject: [PATCH net 1/2] nfp: fix NULL pointer access when scheduling dim work Date: Fri, 29 Oct 2021 13:29:02 +0200 Message-Id: <20211029112903.16806-2-simon.horman@corigine.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211029112903.16806-1-simon.horman@corigine.com> References: <20211029112903.16806-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0PR08CA0015.eurprd08.prod.outlook.com (2603:10a6:208:d2::28) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 Received: from momiji.horms.nl (2001:982:756:703:d63d:7eff:fe99:ac9d) by AM0PR08CA0015.eurprd08.prod.outlook.com (2603:10a6:208:d2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Fri, 29 Oct 2021 11:29:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f57261a5-abf0-4f8c-1900-08d99acf5945 X-MS-TrafficTypeDiagnostic: PH0PR13MB4828: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vs3nvlK2/Ffxc/a88DSFgV8runNN+e4giH/EB6Cv5DQbb/SwfVGgg2AOLpQ+nyzsPXF27gBDC3o+VUIW99WrK5yL+5U6WzYxicgxZpaADYEUgp4I7W6eVSH2Ow1GbohRZhS7fI6DAJJV/a+x8pPloJfand3VIZhl/JTWGX/kctjcXdM6FnqgLJeMT4BdXWSETsFtN77aHQu3tzuNsIxBycehy7SG0g8K1XrdiA17CweT5Uoav/HMa+8QL/zsBTfHJZrGQCsRLuw7Lqw3XXfLV8KK3xCjz+NCaPOGajhSdAZPQl+PnHSdXj5JkcG9VwkRYqhXW2bLZGVg4jZxth3DC4Lj1jjB9BHFqr3yjENjgrK1J6v6hWz9zYr2Q8/uEzKAG48TsKcwHcfeY6lYmOygB4GQ0CLm61A7WKwQ2ZwNL/alXhfcvSUWqK50y3ll0I03rd2l/+mstkaH5ciDm0ivqMasqOHBPcmedtDhjlmRkcrivX1kJET0/+3m43XT/ecHTq2ieeS99UJNv+XDlReHX14ajAu3VFb1u3hKgf9J1+U5g+GnjTLRB4aZTEwrDPTR2Y15N13ISEtyJkoYU2+4c7NNuSNHTYKeYIquH0nbvvECDb1i606cvVsvSwFSHlZQ0RgnOWZWcFvdlcmffn9mKA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(396003)(39830400003)(136003)(366004)(376002)(66476007)(86362001)(4326008)(110136005)(107886003)(54906003)(2906002)(52116002)(6506007)(316002)(508600001)(186003)(36756003)(83380400001)(66946007)(1076003)(2616005)(6512007)(8676002)(6486002)(38100700002)(5660300002)(44832011)(6666004)(8936002)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NmTHEXIppjHNE6HD506x9bGKu+u1iuEs4Y0g1Nd7PGkykug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cF2rZH98Ch/QhkY4w9eJhGfNUoB2Bz8rjK2PvQjq2nFrmEDqwYYLh6DkfQFitg9EZgLBhVKscTDmClDvEKJOXEnnqknnoUvsDs1MiiTid/01jOodgkPME00RyZCenTPJkJze85WcUMnVZRsRWpz6OPuE6X4UrtrUh5Cp5Q8di84YbIswzMSgDl63B22uvzAMb46GkVYflUaO49vdqQ4ihtdpnbAqvDtnB38HEme+glyAzqqg+HiQccxDess6wwuyqtvgWBK/iv0rl7fOpIWcKsCeptGJX/xgC2GQXJpC2Bb0ilzKVkGUSA8oUU4lOhxzuYjjuzseXZpc4YQx3j2cz8OcbXvvtFLF0lQ5uJAnuJ2PkVOB8OM2gRcbuD8A4RsRfacZ6O75LrA/vcn6DKzqQTMPIHHoXr7HtvdVkaS29d/XijdnpwN2TC10xcL8010jMzYIpJgG3dXXL4RPDpo9VammI638hSe4LfaVidLVGnF2W7EgjNiAywQEP4PNgW62dotn8IZmXIP5DgXwYduImYR52UIj/y18PHz49U3mzWe5bOD5ELRYQ2WqVPJj9OLTBYiX0fxyCBZttJRMMVE31/gH+rIYJroKdZ/Vw+dLaILw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: f57261a5-abf0-4f8c-1900-08d99acf5945 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2021 11:29:19.7229 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m9JmGxF9jUrA8E+X5ul32vVYfAlAPN2NBmG2HbgXKMObdqPxybqmNf1VHFldZ/1AVBdJNbMZgPyUyaSt+Kxd1q61rOn5M7g2BwTNrJ5zzps= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB4828 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yinjun Zhang Each rx/tx ring has a related dim work, when rx/tx ring number is decreased by `ethtool -L`, the corresponding rx_ring or tx_ring is assigned NULL, while its related work is not destroyed. When scheduled, the work will access NULL pointer. Fixes: 9d32e4e7e9e1 ("nfp: add support for coalesce adaptive feature") Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 5bfa22accf2c..f8b880c8e514 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -2067,7 +2067,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget) if (napi_complete_done(napi, pkts_polled)) nfp_net_irq_unmask(r_vec->nfp_net, r_vec->irq_entry); - if (r_vec->nfp_net->rx_coalesce_adapt_on) { + if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) { struct dim_sample dim_sample = {}; unsigned int start; u64 pkts, bytes; @@ -2082,7 +2082,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget) net_dim(&r_vec->rx_dim, dim_sample); } - if (r_vec->nfp_net->tx_coalesce_adapt_on) { + if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) { struct dim_sample dim_sample = {}; unsigned int start; u64 pkts, bytes; From patchwork Fri Oct 29 11:29:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12592529 X-Patchwork-Delegate: kuba@kernel.org 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0599BC433EF for ; Fri, 29 Oct 2021 11:29:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFA5A60E8B for ; Fri, 29 Oct 2021 11:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbhJ2Lbz (ORCPT ); Fri, 29 Oct 2021 07:31:55 -0400 Received: from mail-mw2nam10on2134.outbound.protection.outlook.com ([40.107.94.134]:11008 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231897AbhJ2Lbv (ORCPT ); Fri, 29 Oct 2021 07:31:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ehbHNvWU9bHQjHGCOoNJbEd9ESg29SZ8rIzq9OHpaY/bAdKxKAPQRBJ2cGSe4cgZPW0V9GPiEuD8l4IYE0E5f/mKeGsAHMGAp1IOck8jjXd/IcHCUAQAcVE9svbZBBeMuNcxiUojhqYL5KWEnkTJ4qpPJYmIdbJV8WTo9lhfJHsrPDfeFci5VIRnsNRrxvBVj1qvjcL1fK39uzz99ZYKtZP0QV3n+w2ieUfIyocB+uDV9jigG+OeZtcBP5Ex1G7n/SckDfQT0Iv8Gs4S0dfpfyxGnJcRRxPiG1qlb1tdKHErHau6Ma2tmrgG05WDA3NOG0uyx1zRMrHaCkDm9Hv74g== 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=H7PUpcvQHUyLv0ZuaMRqUGNOT7cEW53Xg05WxfsVj3c=; b=PXvNaUvHRkBh7CnGhY/zsBA9mW+itNRHSKdOIk3DkHv4oSVnJFzgV6bkjQG3hKng/nkBgd4fPRXo8HyM9ZGNt6UhIXtkIWjQtjQYDc1z7J5iXwXforsPI59vSzG5AzpzNw0fjnZcFve3y6GXDt46XZSyKGAUWHvsz0vOkVTw8az2avYFhNC+K2HXzJHcXiez81OdsGwwCdIjSsE2XxjngXqsCJCbtJZx0l7xxcHVDnli2OuuwkNm3ejfLEnsdpyQWwIaXOu631dh690waBwYm6Jsal0jdT33uTIcPCw+YM+Yc+7SEbDv0AUZKSejgRxVrjYtWs8Xb8/dLxNjQ51t+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H7PUpcvQHUyLv0ZuaMRqUGNOT7cEW53Xg05WxfsVj3c=; b=muxQKmvOMSy/VFpbgzJWLbOyhzcQ5vZOEPQPR3iBYDtGTfFMRIe/F/uiXEeHoZyXgtJbsBOmgPOxQhf75ZbEAqBxHCp63m2AUrmn+sU24mpDMfRz0OXcRT/NSziYHK5hXTw/5l6qcrZjgaSn8Y83cz28Cl5fRXsize5mD5x5KY4= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH0PR13MB4828.namprd13.prod.outlook.com (2603:10b6:510:93::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.12; Fri, 29 Oct 2021 11:29:21 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::e1d9:64d0:cb4f:3e90]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::e1d9:64d0:cb4f:3e90%9]) with mapi id 15.20.4669.005; Fri, 29 Oct 2021 11:29:21 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Yinjun Zhang , Louis Peens , Simon Horman Subject: [PATCH net 2/2] nfp: fix potential deadlock when canceling dim work Date: Fri, 29 Oct 2021 13:29:03 +0200 Message-Id: <20211029112903.16806-3-simon.horman@corigine.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211029112903.16806-1-simon.horman@corigine.com> References: <20211029112903.16806-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0PR08CA0015.eurprd08.prod.outlook.com (2603:10a6:208:d2::28) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 Received: from momiji.horms.nl (2001:982:756:703:d63d:7eff:fe99:ac9d) by AM0PR08CA0015.eurprd08.prod.outlook.com (2603:10a6:208:d2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Fri, 29 Oct 2021 11:29:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9b84d71-2c3e-4808-a047-08d99acf5a38 X-MS-TrafficTypeDiagnostic: PH0PR13MB4828: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TtLzRHCtPYAEtj5r7p5/ByI5CmaojWyL+Y9WJ1WK0z1mkEe5EgGRJfSK4HspnOXsNiNoUsPWd4W/o5rxnOKuC+qh2jMSVhoo8QbcJNJF4poDG3RESPLjjObF58aSuTr0hGMxJJeFVExG1DqVtjQ/F94oH5+2uLDoJjzhmzThDTJ6Qv6lTdRTi1nDOT8MVWsbTFL8+HtrJyEOsrsGwcpfHvavcktN5GuLp9OpFkR6jDXT/5Ja0f3gusVMtBQ/w66oFJ3miGfE6XyfNM7DiwgbukpRDGPFyCW3gMIjWlRWHm+trlKvd/TPsm28YVdoR+so3NPDOP0gttJsCQdiHN1kKcvVv3XQuAEqCRDccCLc3A7DlDBsNQ3MmzwMI4idIL3YQqzMPcqcwYLUPqJR0NEEVEUcCRhG7+wO8kLeA5Ut+fNtmzHove+YHSJjrMFDrqyF3wRbHnYwVR/4gkKg8Ofvu7ZN6x9Uj2a7heU/epRL4AmyyZXHZnDcn+K1zxf3XcqwLBjsd9syI1zVxo8fCOTZv0Widz9Ha76fzRD1ONG56ZrFjRJQ367rpcZaoAS15PUgTIloOxgNaUgkHQ8dUji+LXdjrPDR7TtV6Vug5zzokoC/p6PlVqP9HdODKAHBwyi/iReXVMHan2PBr6rRVEivyQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(396003)(136003)(366004)(39840400004)(376002)(66476007)(86362001)(4326008)(110136005)(107886003)(54906003)(2906002)(52116002)(6506007)(316002)(508600001)(186003)(36756003)(83380400001)(66946007)(1076003)(2616005)(6512007)(8676002)(6486002)(38100700002)(5660300002)(44832011)(6666004)(8936002)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6jcmMBDsGKMMK478/I7ud0l5daoogODXlN2c7QqXj+txPjXN3X7qw0TJi/e3efIMY3vrptEJtq5eXZTQ26nbM0B1+JDPsPwIMRKgITRzyB8soqTToXqMj5prx5se8LoRW7kCjpjPMSXYrfHleQgewbgmmrrlXnWs9wO+X3EWtdY9TkCju7b/SNFXsMneglnArGdoT+n27tsas3C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XEbqup6soksp+rlTQmzHOh8xGTBokpM5lgFxCDl6c/d0kYF7PwA7vduleXyI0EWq6QWOaSDokoiQHdiN25J5InyfMZUlHQ9IWze4g2m0oI4fR1+owwQd+bNyVCcthB8IoygjoZa8zzu8nNA6bpqdzDhMaN9FH0cSzEH8ADEXpFMByt14BMxVukQuwHErbfljnGyV08Dcy/o383LvjIJa4nin278YxMq2TuteP/Yr6kWOG8o+MriTmcY8L37HTUDKZTStrPiE5AVMZikfGkCBOaaJDAqedfCcq0MlobOjDeAo/BOLBL/2pVHV3jpaIPHAk7fRAX2ExJokbZpaAIWPkDfd56Mix8JnNYtZ2EFgzuXOiH2UnMPJV+Hj+baOUqEksSBjCtx3hL7C/eECXfhpqn8wAe6hVQ6ox3AMS/W1SMTVBxj7+ahNKiONdVzgmQDiXJweMXY4pmlg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9b84d71-2c3e-4808-a047-08d99acf5a38 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2021 11:29:21.2980 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RIPJ/FWll0QSafQqFPziNzOxSltDWRLZSmmrg9BBb3QWDY6+ZDvl5EC+3nGA19fN4zHZThleNmAaf2VeWCeMmSlZxK4hZ9YgUVi/e9z+l14= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB4828 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yinjun Zhang When port is linked down, the process which has acquired rtnl_lock will wait for the in-progress dim work to finish, and the work also acquires rtnl_lock, which may cause deadlock. Currently IRQ_MOD registers can be configured by `ethtool -C` and dim work, and which will take effect depends on the execution order, rtnl_lock is useless here, so remove them. Fixes: 9d32e4e7e9e1 ("nfp: add support for coalesce adaptive feature") Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index f8b880c8e514..850bfdf83d0a 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -3016,10 +3016,8 @@ static void nfp_net_rx_dim_work(struct work_struct *work) /* copy RX interrupt coalesce parameters */ value = (moder.pkts << 16) | (factor * moder.usec); - rtnl_lock(); nn_writel(nn, NFP_NET_CFG_RXR_IRQ_MOD(r_vec->rx_ring->idx), value); (void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD); - rtnl_unlock(); dim->state = DIM_START_MEASURE; } @@ -3047,10 +3045,8 @@ static void nfp_net_tx_dim_work(struct work_struct *work) /* copy TX interrupt coalesce parameters */ value = (moder.pkts << 16) | (factor * moder.usec); - rtnl_lock(); nn_writel(nn, NFP_NET_CFG_TXR_IRQ_MOD(r_vec->tx_ring->idx), value); (void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD); - rtnl_unlock(); dim->state = DIM_START_MEASURE; }