From patchwork Sun Dec 6 23:59:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339014 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69460C4167B for ; Mon, 7 Dec 2020 00:01:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31ABC22E03 for ; Mon, 7 Dec 2020 00:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728659AbgLGAA5 (ORCPT ); Sun, 6 Dec 2020 19:00:57 -0500 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54]:57805 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727661AbgLGAA4 (ORCPT ); Sun, 6 Dec 2020 19:00:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T5kMenTQubz3YtWuXqa/9xqBvgk9EUZguTgfF22nikDfuSM9ltRVvqMBHXgsk/laS9Cfit2dTIfrA6c3ZrcrmbR8Jifh8EQ/ZGO+wCLKp8hhLZkFuP05lHg3/0Gpw3uw3sAJFjpkX54c0huiNLVM1tFgu3CIMzWmR2QrR8hR412EhefrCJytt8q8ib1GOpOXj59ndJ83+DQO9sUbVOlVOVgYMMg+9s1TROCBggY+buSxi08peCAeoW14B5ahNY80+PtcYhQwVoI2ApsAY5dwIPlh95m75tPFD5g8lmjMNkBfirAXv3RzohFzmGGT9mIzoZh9jzLyUlym2M1hmIrpsg== 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-SenderADCheck; bh=Xlyqz3yJ9njuGgQBhsUP396C/6uizMYwO6C+RU7vrhw=; b=oOIWH7C/pt794AsK3N2hWxIfxJ8I2VX4Ilo9Nj+wnU1EwTq6e2PgTSHkYemFNNkZv5IznRIsMtIiAz5J5LW6l5a2FMZGJiB5khMnwCwtle8xib3w3qjtKVTuJU0iGrqfzKq8GCnSdSQfotXISsS5MpetPO76E6f2nE946wMzb2dlaZVkQAe75O9bMCNJ26VbBDuv3bwc4ha8/SYYRdna0cIRvugN0tTUEwZPPCUQb/zP8pvBXB/YPbjU1vyPUqUEvcVYpJIq66lYPzFh441FTL5Lmj+TtqaDgqOoMwE0XD59r33RfKGHSK0HDQ13sTGeO0TNX+5V9e4JS8qEDhIZXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xlyqz3yJ9njuGgQBhsUP396C/6uizMYwO6C+RU7vrhw=; b=C1EmycvCPuskpujXPq/eDecYd4YnLh66xnt/4kk4qTJ+omeHPNP0fwxoOFP0HzKxE4/kzSv7MOEn/sfXBJMoxk4CVQM+RNBWN4VFpge7Jjo0Wq/3csRKUiluvjbIHrocd3F/QuvGKEw7sSPLNx8mHGBCEv9OyN2C44hpH8Eeg2I= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VE1PR04MB6637.eurprd04.prod.outlook.com (2603:10a6:803:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Sun, 6 Dec 2020 23:59:59 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Sun, 6 Dec 2020 23:59:59 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel , Leon Romanovsky Subject: [RFC PATCH net-next 01/13] RDMA/mlx4: remove bogus dev_base_lock usage Date: Mon, 7 Dec 2020 01:59:07 +0200 Message-Id: <20201206235919.393158-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Sun, 6 Dec 2020 23:59:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5cfb7128-4e78-46d4-663a-08d89a4309eb X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A8120M89+dz3pUb6PuMOQ8VegO934esILN2+3kjUb8CecTysNn32g41EjmjohYirkttJoxbYCdoK4ng74xAVE0DrQ7cM+PcEXMIw/C54mHGrt1CmDDoQ4gwVrl8BDFsRrYWslY4TOrVwp41KDGuvLMJpnNfyxh9y4H2bX7KQLiDzmjncIrg8hPstWB+cUXiPgoZP13t1AJUzl8XeEJCkbFwWtI3sFA9Ly6fdcb6nAS1DNN7eKoYZTTLGkXfrByNjzRuG4bc0BwbTx3Qxw31TkhEHKtmsCa4vno+dExmaqnpkICu12S9I4ImKGxaz808yQselNY1JXsfdADBYFy7ybXMReosYfSI1lb6EoLcQQnp1PdY3hNUnzRq4MNVTFbkT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(6506007)(52116002)(5660300002)(66946007)(66556008)(26005)(8676002)(2906002)(8936002)(1076003)(316002)(4744005)(110136005)(54906003)(478600001)(44832011)(7416002)(6512007)(186003)(6486002)(16526019)(6666004)(36756003)(956004)(4326008)(86362001)(66476007)(69590400008)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qv0IIiYZQaBmM/S0e65Tu9ZnE9PleUGzGvs1/lZYu3bohZcJE3k2Jyp2qO7OEHH+tCf6tHAnWpmQUzYoX29DbPhESWzFYan+na8Kx1AdAi6VvQ0+cn7sG03iSnb4Hchk1i3sMuO4HNI82uvfgn75sB8Sxnijj+XAJrnbawIcUJRPY3rDG7aDwgGfVI23Jgoa00lyKVDww0qj8U9QSaMuoqivwxIRxgX92rlEFKqfSTaY4F9O+jf1zLC0MxUxwTPfRol8kgr4hKYeJeh3a6wTQgH/V3qSaeBusFqWx8besG7qxyq1DtF1gwE2sMdWWoDMp0Ez+CSfQLLeLqMFLjOzi5DOHKMfWLCvVgpYnJKAMRJSpR/eVlxgxHYwRi3934j7Yywx7PcsSR7xIG3rSwmCzKCB0if5jfOZ/ju8psYTqjh6hbo47G/ASkG+s6uIuRRX8rDYQRYX9rNYcGBQMFS5xKGRWFVE57ygReNJqIuhJtH/xukjdYYtlplh5nX0R5gHSUESMiUoOt7ccPLmBbT/zM551flVfmWcdkR+E4AGQdSVyvvasY2ERSuXG0fxYimfhu8h7zdrMtAiiiOe/WWNLhHJ3VtkZRH3bKU/2NbFZB6ZTQ6nHqV6AandIQ8dhq0CbGPO4ENAUgQyNyFLT9blhoB9FeGBbUAnhJg/UwG8quMyrukYyEv4LS9j92E6VymiiDddBY1jTf225c1BAo2ltVNlKsCEzX77vHWZU2kQkx5DbrUiMJ1Hz1nE05BrS2m4qJIz0EbEQXiMJga/racZUQzfpr/YiS+whVZxML9ZmuIjh967lvS+maZxqUYWGxjndpXRlG6SX4QOXX3zd6Ef7PTmEGsP9piNP4bDS7cXJOXLRX9gKVHgNuleychr3j2DBK+cJIQ5pIdASpZbQhxs81xIDP27+SXdSK6nkFTuBNYO5l15rUOaTLUljGdy7fCyTWYJ4W5o7JeMpbUeubgMGeM3P0tfcgj7cq2t2fnSCok9lRFnRlQfv9uffd5fmnXs X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cfb7128-4e78-46d4-663a-08d89a4309eb X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2020 23:59:59.6291 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uE8KA1pMOQRM6XqsNez5FZlKPNXDzq+iJ037BRWBfUmjkb78UeSwT3v/7jUm1RcsWEvfaSEkYQzFBesZqYuh+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The dev_base_lock does not protect dev->dev_addr, so it serves no purpose here. Cc: Leon Romanovsky Signed-off-by: Vladimir Oltean Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/mlx4/main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index f0864f40ea1a..e3cd402c079a 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -2265,10 +2265,7 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev, u64 release_mac = MLX4_IB_INVALID_MAC; struct mlx4_ib_qp *qp; - read_lock(&dev_base_lock); new_smac = mlx4_mac_to_u64(dev->dev_addr); - read_unlock(&dev_base_lock); - atomic64_set(&ibdev->iboe.mac[port - 1], new_smac); /* no need for update QP1 and mac registration in non-SRIOV */ From patchwork Sun Dec 6 23:59:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D742C433FE for ; Mon, 7 Dec 2020 00:01:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1620222D07 for ; Mon, 7 Dec 2020 00:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728746AbgLGABT (ORCPT ); Sun, 6 Dec 2020 19:01:19 -0500 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54]:57805 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728715AbgLGABS (ORCPT ); Sun, 6 Dec 2020 19:01:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=btKyS58qJ2XJCirFJ8tDVk6FUDjbeFLjYE51LgZiSO2hrQWEM3gkLlJDjVWxD+RNYqBT6ppiZbUewaWBZfLVZMfmbJ/6Gf8jRGY91glgrJx9pjShqtJG5TYc+VozFXvnHhezPaWIkd4TJjXplc0Qcc4TQcG0UlWczwypSlN8/ePmnUo3zN51Ao4wkMcO1j7v+KiHQik5HirN+E6GslpdlOhLzluq9p1OIKxR8SYeKV9K+0S+xVGxJlAPY75oTdusISEh7H2P+CysYR/N0GljO0tvaFgeUYtpsvPa9ocauxlfXxYKN6P2olMSxAz1Wll10nwUrFds9glj1Hsh7RBq9A== 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-SenderADCheck; bh=ztUyQXrpTPLs63n+922gBTletwutk/pvS5Hm/e4I8+4=; b=l66oXXSz6Hq5AHuxjyRZSEde6In6NURGkedb33sV2Mb2g/htICr7QRCNO4rwxR7KD/+5KRbQPJenOt2/ksKR77rXeH8DhumNB/do4vwnO26BOLXjT3X9Ds5ZPDFXdLohNABiSN0PlEmh0Hmwm5IVDjN2BlHDMYk6Yjy9uaq74eWl74UQsQTSJSRDzoDGICC9ZK/wCsPXSv/BFhOk11WXW/o89DhAR+oMa9T47gZcYA+c90g3yPmSkq9XYpsHq8G5oD9p0Gydjt02LDYeJpC5PUwtW3X1WMeb7+hB25Gxs3A8yVQW8VpD7vSeuAonI8eAxG27zQHbypYYiygly42K5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ztUyQXrpTPLs63n+922gBTletwutk/pvS5Hm/e4I8+4=; b=fJpBvV8+GL+DFya6Ypa769wLjb+KxVtrhMSJRrcpJ5Eac4KaKk8S5+rHciGfW2+J8M0B704EJrbD/KDTniICY6u4sYcwkf+f7or5Qw2lWk4zX73nkNf3dliRaBtxf0OLYMIceOSP2lL7K2Xeb0QP74k3OyF1cMZD4+1r9tgJMBg= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VE1PR04MB6637.eurprd04.prod.outlook.com (2603:10a6:803:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 00:00:04 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 00:00:04 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek Subject: [RFC PATCH net-next 05/13] net: bonding: hold the netdev lists lock when retrieving device statistics Date: Mon, 7 Dec 2020 01:59:11 +0200 Message-Id: <20201206235919.393158-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 00:00:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 850cc018-9e31-4564-d31e-08d89a430c14 X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qUNa3fvCSRvnflBGqTV9Z/cY40zow2iuGcCtMTNh8Fb/LeZ6e6d77A4z0zFKV18/p+a2MFcBhQr8cqQnztwwqAP7Zbw3ITKH1GlfQ0hd7ioY+s5w6gUFV9bIa/7Nhmy5nbAkNNNn7m7y38KHpeHs7hMEOgciab8eb03bsApR8pf0UYgiV1RyFTlGoXFeduWSPJ8KQNbxoLu9JQiFvqNIV4dqKfiJRBaGebERT/32NEa7SKs1SYZclMB1MxWBRh7Eshr5IVvrsTy3Y/2WfkE75EfUFjlIfuM/1WwY59p2OhgSup2dYJgJsdO4TlHxQAK/tA05GUevRyl71ircU7B8ue2YmrUFhssHyZ5QmNYXUB5/R6VWZZMGWFC2uSVI5BSt X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(6506007)(52116002)(5660300002)(66946007)(66556008)(26005)(8676002)(2906002)(8936002)(1076003)(316002)(110136005)(54906003)(478600001)(44832011)(7416002)(6512007)(186003)(6486002)(16526019)(6666004)(36756003)(956004)(4326008)(86362001)(66476007)(69590400008)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MSrM70IKUrCpYRy0VefAEiyr0q+fGg+ibLh0S/dH0XEvmzV2SHyu0E9FAbwdRE6db3i7XUt0ui1Y64i8ZDonC7aPD7155xW3NtYj+zkFPNXGPO7n+b8Daj2Oj3sGXTdpFiT3GMPUy1T1a2le7SiQK/XkuEY65122I8+K/B9ziHGnmqz/Qo6/G09XU13C+Jc4KNFGIlaWx4tgGCT5+mLXSwR3pA3O4847QppNrNs7pWqqjKkEm/vQt8V/gI62Lad/n3JFUS/neyZev4bm4KzG3SKTU557xdbiHNm/rCETsic0VMIWbRzbMGWSRCLVTreTYAiSoV4lWrbNoTVjYpshRi4GTsQKSgspSFN5c1xx0ks1BpB7c10U0jma7oaRUhhVUOzMm5nx1tF+gMxVKI8pIIbywBgU6I6FwA2c6DdKmYO4JxT0enyAvUr2k2YOuVR7XqYvm2Go0nltniZfEpSMNSS8WfdVc8vhCVWOBOfmiTIjqor/utvKW1RRwhPCmc1EfqKDcZdR4xM9sSywuCUWg0MFN+j8+IQ5xRIY12zjOWtQd6GDjCNxjA+9EXiIVd+Xyk+GAQlWE8jDyg8SxuhvMPu7K2meayMc+MfN9bZukbgS10QihZow0OGMY/mWFpwwM15RTD4bLg8gzPsYS8ZYSBnWKja2r8WlcXBoxR7EXo5/2UJdwFoNUClVhhY5L6tfRi3mjJSBXxU/fI2B70JUk/eKCFeT89BGrPD3V/st8y0MjDNfPo2AqXXfE9PImogaGpejViNKgFG5qKx2jtNCpq/aG5uEc++WIIB0lmZplmLtBsUdt08p/IsJbktTeSW99Ofm/V+zcF3y11dzBQ1Ww+Dgiu9DcnDJGkKrrLTqSoFoVfnalv4MYSMYnCKax30x78P61/fSXOsva7YcFcIRR2txrVe7ZoJJYHrjvIkY+muWfFZE9d58YrVmAWaFFJZFSQSp2+pLPlWjEtssqqTHLWU/6EDIbynKUZS80KlJgo8= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 850cc018-9e31-4564-d31e-08d89a430c14 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 00:00:03.0871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pyp7Hbeb9+x3syaL/B9nzlut2X9EbZ0V8+MxDakH0RNTQyDZb78/WjYbi1sYTiI9+JJPmCrJJoIL1KNvkcQPXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In the effort of making .ndo_get_stats64 be able to sleep, we need to ensure the callers of dev_get_stats do not use atomic context. The bonding driver uses an RCU read-side critical section to ensure the integrity of the list of network interfaces, because the driver iterates through all net devices in the netns to find the ones which are its configured slaves. We still need some protection against an interface registering or deregistering, and the writer-side lock, the netns mutex, is fine for that, because it offers sleepable context. This mutex now serves double duty. It offers code serialization, something which the stats_lock already did. So now that serves no purpose, let's remove it. Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Signed-off-by: Vladimir Oltean --- drivers/net/bonding/bond_main.c | 16 +++++----------- include/net/bonding.h | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e0880a3840d7..f788f9fa1858 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3738,21 +3738,16 @@ static void bond_get_stats(struct net_device *bond_dev, struct rtnl_link_stats64 *stats) { struct bonding *bond = netdev_priv(bond_dev); + struct net *net = dev_net(bond_dev); struct rtnl_link_stats64 temp; struct list_head *iter; struct slave *slave; - int nest_level = 0; + mutex_lock(&net->netdev_lists_lock); - rcu_read_lock(); -#ifdef CONFIG_LOCKDEP - nest_level = bond_get_lowest_level_rcu(bond_dev); -#endif - - spin_lock_nested(&bond->stats_lock, nest_level); memcpy(stats, &bond->bond_stats, sizeof(*stats)); - bond_for_each_slave_rcu(bond, slave, iter) { + bond_for_each_slave(bond, slave, iter) { const struct rtnl_link_stats64 *new = dev_get_stats(slave->dev, &temp); @@ -3763,8 +3758,8 @@ static void bond_get_stats(struct net_device *bond_dev, } memcpy(&bond->bond_stats, stats, sizeof(*stats)); - spin_unlock(&bond->stats_lock); - rcu_read_unlock(); + + mutex_unlock(&net->netdev_lists_lock); } static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd) @@ -5192,7 +5187,6 @@ static int bond_init(struct net_device *bond_dev) if (!bond->wq) return -ENOMEM; - spin_lock_init(&bond->stats_lock); netdev_lockdep_set_classes(bond_dev); list_add_tail(&bond->bond_list, &bn->dev_list); diff --git a/include/net/bonding.h b/include/net/bonding.h index d9d0ff3b0ad3..6fbde9713424 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -224,7 +224,6 @@ struct bonding { * ALB mode (6) - to sync the use and modifications of its hash table */ spinlock_t mode_lock; - spinlock_t stats_lock; u8 send_peer_notif; u8 igmp_retrans; #ifdef CONFIG_PROC_FS From patchwork Sun Dec 6 23:59:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339012 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12E8CC4361B for ; Mon, 7 Dec 2020 00:01:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0D7222D07 for ; Mon, 7 Dec 2020 00:01:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728781AbgLGABg (ORCPT ); Sun, 6 Dec 2020 19:01:36 -0500 Received: from mail-eopbgr80049.outbound.protection.outlook.com ([40.107.8.49]:17892 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728687AbgLGABf (ORCPT ); Sun, 6 Dec 2020 19:01:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OWN6i+aeFMVOwQ1PaWmXbJWuVS/EqIvuNh9R9s6J5KlK8ufV6E0AM6dz2CsZl8lEzc0DPPTf1xlCu2mm4410qIpWnRQREqqr2g7xKrmPUddof2pzHAq0m5DGIPTTKKVJVI0Vh6SQq4WEQufrye0O+LBRZpeb/tZhgEWRbZXXsTWywkX+z1rMb1DaIKfYW4hnpgvBWh8Fer4ICG61d6R/NiK34gFq9rdo3vxOFR7Y3G2MRqmQxYNey/w/459Vy7eFPwM7CQEX/kiuUyL3+PerVJfP/RrXQGnfavK0MInZM3LKKvE/N3mOCC/eoasHpCCseXfTIQt9Z2HDfvns6MswOQ== 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-SenderADCheck; bh=RGx2CoCUTnIlmt5iAFFp7CH+wwxPytHnE/PNCdBToSg=; b=aEH9UHjnhiitYUj8pljfo7aFrQY8wJaFtMeubh7m3lAU9pQg4p7jzOa5z9gtEm5+3Z62gM0XYXfgkTRnp+wBfpycuc39CPPB6scBTjPXelQDJOr/5p8K1fhPQ67XpHuTD/NPrYOA/q3qBFRyW3wSWtsOnRCHZkBXogzW8zXM5oNaHQLgdwFbYLmvvt6IN0dvMKvrc19f2u3HxPbZ77MC7PWeL3U4G9sVCj1VYdiUeI+r88clvP0qCJsT9ISwBCuRIz5CJWwQAdBp68Nutr7tFVJSSzUSMHrLp0Bm0HiYkabXUO1ikdtTXvnfNP/UspePCIvS3SjMuQFOR3RVSWJ9sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RGx2CoCUTnIlmt5iAFFp7CH+wwxPytHnE/PNCdBToSg=; b=RxGz0EHcAJjDrKZfRsunRsydQAmSC59rIK6g7BsKTKOP2vr+iyyTOsl6oNTQ7bucwSfhonSJD+e797ORFUwp4PVxcVorvEBaEoHlwapzLU/YRUYj2si0tyXVd+gj9G09ULrlO3NUDB+pNYdZFz4xO7krtwrekeXH6RpQpneCb48= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VE1PR04MB6637.eurprd04.prod.outlook.com (2603:10a6:803:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 00:00:04 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 00:00:04 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel , Sridhar Samudrala Subject: [RFC PATCH net-next 06/13] net_failover: hold the netdev lists lock when retrieving device statistics Date: Mon, 7 Dec 2020 01:59:12 +0200 Message-Id: <20201206235919.393158-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 00:00:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7ae84657-c4c4-4d41-72b8-08d89a430c9f X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4zcZ/ZVJsHFXAtwOIt2JiBtUSLmeSPpa3R0zDHDlSqKi/KniC9jcTcMkTFVCDk2EsLnO/SIhVXFZGZ/NjsKq8PsJmzNkDo0W5q1JZrc6+vKXVKWdwYVt/iM7uJFYwnyaBteBvGYnx25nfgIxKS+5Q5OGD3mQriHpG9HM9HtNHjVLzXPIqFr6wc8zzAzMcAEA0k6ekirN7hmpyfGGjjf6V7kZkjuFutea+W7SxzQPcD+2nN7ul3nu5/0Pb8ihcMadpczOZ1lVR00m3ZNygk9zThdQ4buFl8Ke3uvRfdMVYtswu5TgRYmWsI6XwhLtPM7lo1YNP0ZcABTfk/xHv08uX020QbvAXANKEgw2s3FsiOcMhdlmNAVmwGT2eo0sGBsT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(6506007)(52116002)(5660300002)(66946007)(66556008)(26005)(8676002)(2906002)(8936002)(1076003)(316002)(110136005)(54906003)(478600001)(44832011)(7416002)(6512007)(186003)(6486002)(16526019)(6666004)(36756003)(956004)(4326008)(86362001)(66476007)(69590400008)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CRb8CyLt72hylLvAx6VVtggpLte0lCNWfkFAGSKa+8/bKDlUt4JYCN4qA+Yf2sQWbHJiUygZwD9+W2pp/wlG8u2GAXEcRsGeE6bapKV1kBgpGmAAhcFd2uZwFETudVNgO7VRljoKmfWLvK4bshbOZrAzRdEu+rUtgeIJgjBHytXypKWwQuW6/P3phz5HzTecTt12tuwRTOftyfRpXfonCbqF/NqIG8bTk9RhHfnbMWImEMxF2E579+D+27XFIy9OyMSbvrzmFKD43sAhiP/to9KpNuAik+FZP761mZ8122B/0NqfKx8CpSj1kwHpa4p7mzUJxZm+v0bRlcdWHlcU/kC6S8sJGo25d+b42+O803pKE8UPX3+vZtWMH1Siq3s7wK69EMAh1wTlhUQ4/NW0FsEkq6UmJMOiFjjyWfVMJLWhBMSTjUE0GPVz5MyWVvVdMahw/SuC2aZfnvJrgRbjy6h3un4Mtwo0yhuj/XkS7cGEdiTIwr4ep9vCeisEobxTo+GvO/kku8IsHi2CpOFFl43YSglEWpOsZ100Doe3dTCv7n+uULcA6jgXWFbZ7h07FRgEmCvg+QqFBKVSTqG7h9mu+5iX2G9gemMAsUAlXnpyp56aWUkTiQeP2ifTkAFzFOz1VTek85umIz9ZFP/FEqVxhOUkLb12BPjTvNndBQqV4/2DBqL+QtXg/wqCpZDSelNzevGZx/Dvq1yCpNh+XEImZ6cNYe3kt42YWFHxI5c9UEdMuWPBCTxT8ojI4Vgo+WAJkZ35+2eDWDDu5SMhQTO2SbGpySjGmrezTbX8b/KUcLDC0Oo03hzhWkWIj9pi2CUFukU1oSuK6rwSiCcxhsRLTrJ1zTrxXowtCwdCqTXZspW3VoI0WNOC2bmOQBiteGXpTMZ+uSebz72/CsllNKjFCw3X8w8eHhV1FghIE3XXBumBSXI/zXBuub7OXPyreN3cGUTs6WCJqARjrMXFtMDvJedktLUOfhZVH7zHJNXBbeJrNHRz9VH27UiB54Fy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ae84657-c4c4-4d41-72b8-08d89a430c9f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 00:00:04.1885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: atOLe+QI3JglKynUMxaL0BNtZqihkAc03MkG/da35pF+QtWTNl1otFxXbTgW1sdq2PMS7IpDjQjwrLeHWKKQIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In the effort of making .ndo_get_stats64 be able to sleep, we need to ensure the callers of dev_get_stats do not use atomic context. The net_failover driver makes copious abuse of RCU protection for the slave interfaces, which is probably unnecessary given the fact that it already calls dev_hold on slave interfaces. Nonetheless, to avoid regressions, we still need to offer the same level of protection against unregistering the standby and primary devices. We can achieve this by holding the netns mutex, which gives us the sleepable context that dev_get_stats() wants to see. Holding this mutex also removes the need for a separate lock for statistics. Cc: Sridhar Samudrala Signed-off-by: Vladimir Oltean --- drivers/net/net_failover.c | 15 +++++++-------- include/net/net_failover.h | 3 --- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c index 2a4892402ed8..90db0358bc1d 100644 --- a/drivers/net/net_failover.c +++ b/drivers/net/net_failover.c @@ -184,32 +184,31 @@ static void net_failover_get_stats(struct net_device *dev, { struct net_failover_info *nfo_info = netdev_priv(dev); const struct rtnl_link_stats64 *new; + struct net *net = dev_net(dev); struct rtnl_link_stats64 temp; struct net_device *slave_dev; - spin_lock(&nfo_info->stats_lock); - memcpy(stats, &nfo_info->failover_stats, sizeof(*stats)); + mutex_lock(&net->netdev_lists_lock); - rcu_read_lock(); + memcpy(stats, &nfo_info->failover_stats, sizeof(*stats)); - slave_dev = rcu_dereference(nfo_info->primary_dev); + slave_dev = nfo_info->primary_dev; if (slave_dev) { new = dev_get_stats(slave_dev, &temp); net_failover_fold_stats(stats, new, &nfo_info->primary_stats); memcpy(&nfo_info->primary_stats, new, sizeof(*new)); } - slave_dev = rcu_dereference(nfo_info->standby_dev); + slave_dev = nfo_info->standby_dev; if (slave_dev) { new = dev_get_stats(slave_dev, &temp); net_failover_fold_stats(stats, new, &nfo_info->standby_stats); memcpy(&nfo_info->standby_stats, new, sizeof(*new)); } - rcu_read_unlock(); - memcpy(&nfo_info->failover_stats, stats, sizeof(*stats)); - spin_unlock(&nfo_info->stats_lock); + + mutex_unlock(&net->netdev_lists_lock); } static int net_failover_change_mtu(struct net_device *dev, int new_mtu) diff --git a/include/net/net_failover.h b/include/net/net_failover.h index b12a1c469d1c..1e0089800a28 100644 --- a/include/net/net_failover.h +++ b/include/net/net_failover.h @@ -22,9 +22,6 @@ struct net_failover_info { /* aggregated stats */ struct rtnl_link_stats64 failover_stats; - - /* spinlock while updating stats */ - spinlock_t stats_lock; }; struct failover *net_failover_create(struct net_device *standby_dev); From patchwork Sun Dec 6 23:59:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4E27C4167B for ; Mon, 7 Dec 2020 00:01:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7072122D07 for ; Mon, 7 Dec 2020 00:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728792AbgLGABm (ORCPT ); Sun, 6 Dec 2020 19:01:42 -0500 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54]:57805 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728687AbgLGABl (ORCPT ); Sun, 6 Dec 2020 19:01:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BEQ/4GL3D5CkicJgSmGR+CTyIyT2V/NslYfCKHDWS2edTAltFiz9WKZS8g8jgsVMLvXyjiUJRo8ObDIrCS0NCDBl3rKXxBPs1pTbIec43qpNqPF0mNOQa69Px7grL0jjJV12DdllC8xX3i2UUP9cmTsrYerAjLRHf5pCblJhkskNctid1UgrjTKY/dHh0VueUkXdVh4w/v1oYRFylF9PT7DPc4md6RWTMRiPus67K++WEhCiX6cC+hsoW5/kJFmAb63ctPya98tngeCiIFfBoAdK2qoANLR6+w2A5qWi4aYJkMCV2qwppJ0bM/JjAJDOWM9f9vv8HqP7ZjZGv26j8g== 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-SenderADCheck; bh=YO3y0hndosQW10PzBTQd32CGEWeBUaCxb1xYmAQDgew=; b=bhHlDUojyN60pmYAz0cnqzmgorCT1c1bwA5/Gn04KUuNVFV751QdLVLDUHC0ooKJW66aFsJnYqnqlnNGS97NJq96TOYlw2XnNVjaFQsl+bwap6SBgbhjNf+Rpxbhlp24OPoBjEHecG0OIggWkltCM7xivf01H3P6kunCUSt5UCqk7IG678BrP+L8jRvuk/AnDCsrbSI6ZZf9zP2aDN2JT8/VLDnOvW0lIe0ntUD0Iqgd1FbedAdVVTp/CzdCvlwlLQgUM9i7lRZpYZLXG7a/UdW7bRMeOccjPrpEYJEeyFZbCmwnVv+ylgPFhSOjkQmAUVd7JeWb7FvKN1AwVBqJmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YO3y0hndosQW10PzBTQd32CGEWeBUaCxb1xYmAQDgew=; b=IrtRMzpd/HTTEIkx3HNUT/dBNB4LVbGruWQDGMt7IJ3qHFIOscWwRW9TIdFDIm2DAwyMpGjycdCcAATMgPwb+EMoGSEjWENRx8g1uC0x+cacxykx7oi4L3XDTJUQpovbnMeUVVk4r7fvg0lsz6Y6vF9JUu78E8xbRA9ACbs6gPc= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VE1PR04MB6637.eurprd04.prod.outlook.com (2603:10a6:803:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 00:00:06 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 00:00:06 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org Subject: [RFC PATCH net-next 08/13] parisc/led: reindent the code that gathers device statistics Date: Mon, 7 Dec 2020 01:59:14 +0200 Message-Id: <20201206235919.393158-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 00:00:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 43e97ed3-f231-442a-c99b-08d89a430dd5 X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wYxogD61xYwagRtL9lMNjpMhVPuJVXY4ecJfdq0uB6BCq1MU2N6sZFC1DVhJ79ec/ErxRnEYTAXEiGQtbW+Wioe8zOTv+SeF+2af0illsMde5RsvTYAKcBMCIYRV7M5kpFjDOyKsBhskwTbIALgsY//ogXEqUFikjT/GBgihuI13jAEVOds25ds6LhemBCiWxACd9vAe0V6/IxbRpksmp+yFmBYVaScuvTyyszgBBwUjeLg2dWKzlcmjBYugY5OAha+dXOZBENJBdRp2PjdqPMQkV3ZfYInZbLjDscHZC6l0555O4D6919NfXKr02jUAfaTYPABuIxOfqnpvrgXFQtXOQMSmoJtYHhzZxBPczxx5uwXE7GkUAvxRXPaq4NcR X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(6506007)(52116002)(5660300002)(66946007)(66556008)(26005)(8676002)(2906002)(8936002)(1076003)(316002)(110136005)(54906003)(478600001)(44832011)(7416002)(6512007)(186003)(6486002)(16526019)(6666004)(36756003)(956004)(4326008)(86362001)(66476007)(69590400008)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0OmKOcTf6IeGnCRAo/vgzQHWdsBPLU+40e6xJfUBRvmdjX1C8qajluRcRx2p34vg9UW+TkYdgmghlR2baIT6SiAoPRc4MdXFc9xfn0LHuioJorFqKakgZDsMrgkc1tLNqRKspU3jypjQWq/Lusu4eeWehfxGq5iq8qK8jX7K+2lfQ1XIfSNpOo1LQcvz1jXgUjUKZSRQlu2bcr5SoaTknMg3RmJj7CIZ2vnQl8/3IXewLEmPYkkiLxP/eOr8WUA2fkUPcR+0x1Hwdl9QmflX5k4TXxRrDmEdBHBCtXjzIR4gDA5Yt41/Mm4S3/H8obPf3SPkXmb0DpWdzFfiunz8yJM7Sk8tAvoIA4uPYjySZJFTm8WICPggq4p26DoFKRAGlmiEJht8qXZlgslVePv2yYGBOd5/TGC4aF73OYwIHdVzOHGi4jWTwKCy0+SO81UW371uFGEssOoOlhWXk9GaOh0Jod5/J2ZIVPozpF+OoiX8074sImNS1yaiY/YNKDt4rQQjLaStad/bC02im1crZDWPKo6igRjmdfQocy37w1csaGpP3q0lhZmpOvsUBi5c0Z+arh/1MNoIq8pLDXmhQ2NOw1SRavOQxIvX983xXdcE2KecCVknx6t+LaUI0ihL7IqKewOGfCj1BxybcvhalXL36sbpLvinZReVhJFZZLplB7hRz+olpDxWvLMn9AeDEhh/1FONIRAf0z0BtEbwt8UNvlTMejTXYPIaizHj4VhbkJEfu8uppM36dQ563XFbr7rk5Hpl61I/ccLuD6l4cLyaPUrVVcxVj+pI6Qgvz8nzsWzh+qKcoK+n5JgwkvKvtm5gDHIy8UoODIE60LEqwt2abAWDYv/CZuCllYxVMJzlBdu0cj+JlZWeTzbSgCAdv3M7iNYh/MuyO9Y2TzARTq7pjgD1bNcmXNqp4lwAKteIf2vo8LRwzd/uMwhsVIfxujDSdcZGP6Vy0FnZ1oUqNhkc4DUh0u8RRDsKhZP7X7FbxBtQSo9T8hFnGgknGOPh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43e97ed3-f231-442a-c99b-08d89a430dd5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 00:00:06.0444 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b4zPGyse6yHdrb/7hymJmNg34GCTwr5X4xX3NQ0rZgIvFlJsKzWygzG9Xvr68hNYkgfqA/CSg7A64A4W7Lx8MQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The standard in the Linux kernel is to use one tab character per indentation level. Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Vladimir Oltean --- drivers/parisc/led.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 676a12bb94c9..b7005aaa782b 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -359,16 +359,19 @@ static __inline__ int led_get_net_activity(void) /* we are running as a workqueue task, so we can use an RCU lookup */ rcu_read_lock(); for_each_netdev_rcu(&init_net, dev) { - const struct rtnl_link_stats64 *stats; - struct rtnl_link_stats64 temp; - struct in_device *in_dev = __in_dev_get_rcu(dev); - if (!in_dev || !in_dev->ifa_list) - continue; - if (ipv4_is_loopback(in_dev->ifa_list->ifa_local)) - continue; - stats = dev_get_stats(dev, &temp); - rx_total += stats->rx_packets; - tx_total += stats->tx_packets; + const struct rtnl_link_stats64 *stats; + struct rtnl_link_stats64 temp; + struct in_device *in_dev = __in_dev_get_rcu(dev); + + if (!in_dev || !in_dev->ifa_list) + continue; + + if (ipv4_is_loopback(in_dev->ifa_list->ifa_local)) + continue; + + stats = dev_get_stats(dev, &temp); + rx_total += stats->rx_packets; + tx_total += stats->tx_packets; } rcu_read_unlock(); From patchwork Sun Dec 6 23:59:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 385BCC19437 for ; Mon, 7 Dec 2020 00:02:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBBAB22D08 for ; Mon, 7 Dec 2020 00:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbgLGAB7 (ORCPT ); Sun, 6 Dec 2020 19:01:59 -0500 Received: from mail-eopbgr80049.outbound.protection.outlook.com ([40.107.8.49]:17892 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728683AbgLGAB6 (ORCPT ); Sun, 6 Dec 2020 19:01:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y0XgaJjkReN50lvXF/Hbg0v6+FNQPE8Tpx/NrGj08GiRPDsMsNCWnBPhLxoT8QjRRfgXGnqgtRrG5Y9hDjwox1DN4wVgSfu3sy64DLzb3jsw6/8MpQTE0WxKb2rb0MVHppUsLNsualltVngrzspeDlwfFjEJMFJDbiNUvZcJgtq6f2OQXYQ0UoyImOt8LTe/555GO9J2fmc3feuZJ4k6tK6ePu6qdraNizTphb6h+UdCjtIaplUTwVYhUPaxUkHY8UO0FQsq3OhwMjEM0FlpFodrrZBSpjcQDBV3kDWE8gdNgHu+VQNsLJeeTJJsNauIwZ6UCO9gKmG1GGbziFcZSQ== 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-SenderADCheck; bh=Q1aaSplXW7VCc/5O8O2/UDxdFpNfODNYhSZ9QSiG4wY=; b=HHb7bTaGMZHYzmF7hT3PPnl1GKcSAEGvDBTO/oCLcBQl1oIZFnsKiUqX8g/pgOw6THnupQ/XhhMug2I+ONIYEVKYbCI/5/7Dyje9MAOkwgjUIX6pxSB5pO5Wabi2E+B7M4RuUczbvzmEEeGF6ct7WPxREpzXXYC5PiSGGRMkufjmYwpaBys41IDJwQaaxLdOhjIjxQTKjji92elGpIyI/hZB8/QXqaPNjy3kFIPPfUoZFM1kkygApdFzHHIT2Hp0+W10ht5eQJDYXCrO6clM9yKcQcvlPyFFNOTPBSejx41ITHR0EydxEJUnGbhStuaEyIV4+jeXkUkg9+7IQRDMbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q1aaSplXW7VCc/5O8O2/UDxdFpNfODNYhSZ9QSiG4wY=; b=ZmhrAp8Q0T8f87qbquPxcknhB3AFLgfJNQGSfMXMlDiRi7w1mw3NT+vMQb/hcE/6j2Ztg5aXZRqZNcBmvZBxafvR7MLfvZVivk0vsuyY0s6n/1sQha4QDsz6DsqUMvIOivJfGxqV+O2TqoIwd0oUqxVyfYgSs0UmwiPYeTnoIts= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VE1PR04MB6637.eurprd04.prod.outlook.com (2603:10a6:803:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 00:00:08 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 00:00:08 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel , Christian Brauner Subject: [RFC PATCH net-next 11/13] net: sysfs: don't hold dev_base_lock while retrieving device statistics Date: Mon, 7 Dec 2020 01:59:17 +0200 Message-Id: <20201206235919.393158-12-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 00:00:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 78b2c608-f89f-4387-3117-08d89a430f53 X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T3CC+M575zOEt3IRbw8DalIxCUqL/YSgCNvfh+E3AxHJpiQClHxy9FXZkSkPksGWFcs1GWxTSrSvQ7xTQqdTu9XDXb9Sez6qnwO1Ky40g1hbVyPb4fTh+IHUZnNXl/j9gT0+BbT4lgkkVl2C1fC8nlwImAEAF5LjWd9yZu75JSoagb7MnITsXJaaGiHfZrYP1sjruSriy4wVIzK3Uj2z3U9M806900zaYxLcbjASfM+CCzjjg8uheue5TMqvEczNQiVU5fHGww+pKwrBYC2i1tV/hVG/uAhpwEbWLRlCrkvG+q3r123rEBD0JjmRZMgfso0pYGdt8J73IRbkwdhtgyin1jqEa8ghtkI9vcDT2seIJJ2X19HR2adtcJrrQ7iq X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(6506007)(52116002)(5660300002)(66946007)(66556008)(26005)(8676002)(2906002)(8936002)(1076003)(316002)(110136005)(54906003)(478600001)(44832011)(7416002)(6512007)(186003)(6486002)(16526019)(6666004)(36756003)(956004)(4326008)(86362001)(66476007)(69590400008)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pX0eL/Ayi+cDZft4fn2Dg7PrMoz8i6OZ/XwnZG8osI8/Zd30QySGYcnR/kShrIiC1H/uAvIqaMa3caEEuK0s+TflByYPPfAilHuCVang13D1jdbuCp6Qinmcx3WDSlItgb+Hd0QM4jf6SiFX+C78gR8uqx53sAjpOwGvCF0bWf0Bxnkp0TTwqDQGmwfNF8mTqVTr94wZp/mhTPIBcwKsPMoUiTU2oBg/4VPFcJQ2RMr6EtUnLUONZEU4e3vT+A2ymRTpK4tLNl28Rb3MfxsRoSAZvJCJMBW5tq2uocQuFt03xIy2spuMNeLWVBjdBQnsjMulVbzzf79Y05FtxZ53FcJYzER7SzGCeZZJC1FKYd6Dx99bn4jMxa/xEpqYBdKGOv+MVB05TESDVAhqu5UJogy2Oql3c1Efhn4hjZk3EQWqdrEAQ7PU8mxx65rWAWILyuCXAW990ASvX7U4DNaEfF+CwFY/mB6JWqYAE9AGaJ5LhJ3m7tRNLTWgHRqXuKNsBtj07h8dEJIw4lMFvQ0/167qdqlYtW76enPqd2eg68EtI66B2ech2Q0uXEhM+/AhpY9ru+4L0pMRwUWncoEtL5LLrkZaUnG2EvPdWzu3NUhEhrKG7q1W3FY1/7xJoEHSOgARclQ3/VX54XB57EzZlMbeUfKA+5ogMn7R/ShhfXLerNlfGh+0S2/TdV+2W/Rxh24Tg3gbgAsZqkHq6E8L9NDGGXMwR01RgIcIJvQ21f6OgNsNhlDUlwGi/BGmmMTDzNKgLZXXtE/IchnZYDIwS7bDWK7iooXcwLiKzQ2NG52v11iFGE2PpymBrBAeXjq+n8cqi4JiIctTHMNXZ/uNLczE+QuQf91RzG/2WLnJx2IvHkPqFQYAvRok/7qS1xkJ1tmYk56iuBGd8l0ublcn3UEstYXBytRBo941TMsEFgaDttvZeZAxQCPNT0lON3vaLXiABvXLx9GjP/3n3qOxXN5lss3NG0coEacuSU8k0D3tpvCqYy4Ns8mCnXV3xB1T X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78b2c608-f89f-4387-3117-08d89a430f53 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 00:00:08.5590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1ySFUYTotQGvb7mt0Uohe62aou17atBWu53D8vlPp4KV/T5MC+MEsHs8OYuwTIfkvPv+qoAzERubVsiDPGaowQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In the effort of making .ndo_get_stats64 be able to sleep, we need to ensure the callers of dev_get_stats do not use atomic context. I need to preface this by saying that I have no idea why netstat_show takes the dev_base_lock rwlock. Two things can be observed: (a) it does not appear to be due to dev_isalive requiring it for some reason, because broadcast_show() also calls dev_isalive() and has had no problem existing since the beginning of git. (b) the dev_get_stats function definitely does not need dev_base_lock protection either. In fact, holding the dev_base_lock is the entire problem here, because we want to make dev_get_stats sleepable, and holding a rwlock gives us atomic context. So since no protection seems to be necessary, just run unlocked while retrieving the /sys/class/net/eth0/statistics/* values. Cc: Christian Brauner Cc: Eric Dumazet Signed-off-by: Vladimir Oltean --- net/core/net-sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 999b70c59761..0782a476b424 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -585,14 +585,13 @@ static ssize_t netstat_show(const struct device *d, WARN_ON(offset > sizeof(struct rtnl_link_stats64) || offset % sizeof(u64) != 0); - read_lock(&dev_base_lock); if (dev_isalive(dev)) { struct rtnl_link_stats64 temp; const struct rtnl_link_stats64 *stats = dev_get_stats(dev, &temp); ret = sprintf(buf, fmt_u64, *(u64 *)(((u8 *)stats) + offset)); } - read_unlock(&dev_base_lock); + return ret; } From patchwork Sun Dec 6 23:59:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DC01C19425 for ; Mon, 7 Dec 2020 00:02:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F7E222E03 for ; Mon, 7 Dec 2020 00:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728839AbgLGACE (ORCPT ); Sun, 6 Dec 2020 19:02:04 -0500 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54]:57805 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728632AbgLGACE (ORCPT ); Sun, 6 Dec 2020 19:02:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvYFJ04jeOzHl9YpRAHjkJTXazjl+ZS9mmP1ta88mkK7yl7FTKqcf3Tu03eLtAB2pPbqeS/6HmtWPzGJq2XzAGn/e5WlzU/Mf+BPEJXItY1J7WOugUbcb05lgMBPufcHcHGtcDVrFLUP6eWoVHh9tOWDPy73Os2TxFiKiSIoc9R8bat2LAaN0aMjZYYMDp53rAcRM3++3UwWvT/Erfu+8m+0cydoG9YCVR4E42HeW0kCM0GGTIoaapfvj6eWnF3PA0woiEltW2AjEMWxmS7IEY+dxo0A4Xy3r7M66tOnIZGlpTcNayY4GTYORgURoaHhmrrlgdlfsoIzefuoqMmX2w== 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-SenderADCheck; bh=iwx+FYPRMg3O5R99oiba+alxiCgFfXMdLjcnG53F6xY=; b=j2xu1jqiQZM9pEWpBtX68jVzRIeNIpvsAITkcUZGe9UULBCFuNGXRpo22hde/ivsRqjVJ/fUMscFMWlAswij+yDn5wo9m1CIVQ4cZO4iDpZVCmKwLIa9ILTCNJT8PWlQBSXHO8pzUdT4/XUq+iBe2YFpHGuLOdSZVo31fbTUq6w8f+mYb0uJVB+ytyk5cgbjGrTAwViO3+boa4Y50yujKIUOmTrck0l3qSeAX6phxpdG02gs03ojJhZ/pfJwGxB36Mhu8IWbOgihxybJB+//7dSlyAr5laLoBegA1+zqTkw7P8LKhOYJ/lZT4+EHFSd4oZjrxGHuf3Bpg6ob3btyOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iwx+FYPRMg3O5R99oiba+alxiCgFfXMdLjcnG53F6xY=; b=Z6DwRxjGRtgMwboXMupRdcPFGbfzFoK7JMgm/B5cz2aljVJpbNKBhr77DwJYZXmyizVvPPLyfazhgIEjq1zPudegzYiVcMEMjxdJcvGnUTKPFISBXYUeMxkJ0CemkLcxy1UNN5XOhDDNCws8dNJ1NRU0l6w4ujCJiVqB9nXdGy0= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VE1PR04MB6637.eurprd04.prod.outlook.com (2603:10a6:803:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 00:00:09 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 00:00:09 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel Subject: [RFC PATCH net-next 12/13] net: mark ndo_get_stats64 as being able to sleep Date: Mon, 7 Dec 2020 01:59:18 +0200 Message-Id: <20201206235919.393158-13-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 00:00:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2ee4c55d-41f1-4c22-6991-08d89a430fce X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yOHW0fa4TkDhKns3i6Zia0ZJJ6MidA7o41QQTbn9yXKvJ31uYmNDRfIL/jWMm/7Ex/nicHSvUEzjKZbIYPZvY1Fe4z5qm9ORdpy+x9EbFmj2vX3Q1J9k+0kiULh0NVo+UO2VekhHmSncQPYlTtSHacQRbbx/bdX/P3aRn7T76XjEPgUrLZY3UAL4B3Zu+KRng2oZLluRF5iAmDvBy5zLHsSnblh7SeVIYIy6TZmQHwiJ9q+Nag6Gx/xAtHxclvHEGrHInOZLY2hINZa1eiCZadV6LzNP6RcZvKQEgT0aHo4jInn6HalS4B0mCa49Q3HwGwl3SExMEa5snYfYRr9fkhST4iJXkMBG4xuSk3cNdj8h/QGi1c3U0gdOBTCV0UvQ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(6506007)(52116002)(5660300002)(66946007)(66556008)(26005)(8676002)(2906002)(8936002)(1076003)(316002)(110136005)(54906003)(478600001)(44832011)(7416002)(6512007)(186003)(6486002)(16526019)(6666004)(36756003)(956004)(4326008)(86362001)(66476007)(69590400008)(2616005)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2Lx+rK31YWMlwRgLxSVW0I8oo9epZl0FdZ0c8Xfmf3kW1dZtuDJU94Ui0Bf6wWpv4cJldojLxA/tN0/SFvQeGmmwl179Oo47P0ehHOk+FjdKOmEn2hhEVjQwStCGqLBQeFiM0MTARQ525Oj1xOJmvwFwtpFQXD7Uhf171uEyQM2Pf35gnDCA5O5SxVhua/pKw/dpMHAzJcJIFvxUqkKuOK9Mj22Ad2KkcE24x/ABKKxJCo4Fo4GFTJ08th4X7UXRt6i+c3ogQmLjuOlmRXtNmRF0A4RrkP/mB959yVEyKquAz9LmFIZN+XUc/PODPB9QTG/eYUBtFoCtw2zH/LiOhd/T+CQCUbeOr6HcEDC8+wZdQjG24897mDEIL0L+6oG5A5SuyfbGMgFpGNJNoHnZBeNxXgmK4lkkQxbnTjzaF2cBeibrlgo99WSmKuH4r6nmPVfe0AaTe53H2hkLTGb1o7OwLekIEWCBeeEOLcQbb/1sWONYYtkytqEeYrCSJDCm7qNRq8RbFvRGkIxaliyBetkC1pvaG0wVkX4p65w1Tby6NW0jdc2K8tZ1X47lckeiIhAGAmL9lh44Feo8PRkAxkTF1hv9/t6xIlLUmR5I26P/NhF32+pDCJc8I8PPdCjCr3ny94F6GoaA6Cl2fDlciay3hYwyZcu2ho25EBDjVpSY5D0ZXr98NlIg5x6loAw85RdP/Muk2cNN8Jj2t978iVRZ6VYPmatpDPb7Cht/hp+/Tgs0TUg1sXIyPXja6JTXkzTOLSva0iwLJk2yVZUsWHYMFp/MlNZmNMXSLLDzElmU+PaeRRu+J/59jBn+o1zilMtG25gTRrbdU21QsXLr9VIjbZ7UldhqY1KiJD6iwOaXJRmDywFeYZtaxIGQZF/n39IkXRk6SHmPztsB/bqU+eq5oZtA6PcJR03tho3zLvEifhu0Z1VLSikk7BbhlEVPQ+Jye5Qt5EIwQdWr2szpnE8QC/0N43W8mpkHjoRFSTplbvNJj+dhx5Bjf46QqWfR X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ee4c55d-41f1-4c22-6991-08d89a430fce X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 00:00:09.5474 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6mPyvHZPu8fdBZyjKnzRNhG+ibc8uZ2fFGy7XAo8URTSLvzTBYw0viFfPKEs7ayBfpLlOESIcTo7CuAfUlkL3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that all callers have been converted to not use atomic context when calling dev_get_stats, it is time to update the documentation and put a notice in the function that it expects process context. Signed-off-by: Vladimir Oltean --- Documentation/networking/netdevices.rst | 4 ++-- Documentation/networking/statistics.rst | 9 ++++----- net/core/dev.c | 2 ++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst index 5a85fcc80c76..9d005cbf84f7 100644 --- a/Documentation/networking/netdevices.rst +++ b/Documentation/networking/netdevices.rst @@ -64,8 +64,8 @@ ndo_do_ioctl: Context: process ndo_get_stats: - Synchronization: dev_base_lock rwlock. - Context: nominally process, but don't sleep inside an rwlock + Synchronization: none. rtnl_lock() might be held, but not guaranteed. + Context: process ndo_start_xmit: Synchronization: __netif_tx_lock spinlock. diff --git a/Documentation/networking/statistics.rst b/Documentation/networking/statistics.rst index 234abedc29b2..ad3e353df0dd 100644 --- a/Documentation/networking/statistics.rst +++ b/Documentation/networking/statistics.rst @@ -155,11 +155,10 @@ Drivers must ensure best possible compliance with Please note for example that detailed error statistics must be added into the general `rx_error` / `tx_error` counters. -The `.ndo_get_stats64` callback can not sleep because of accesses -via `/proc/net/dev`. If driver may sleep when retrieving the statistics -from the device it should do so periodically asynchronously and only return -a recent copy from `.ndo_get_stats64`. Ethtool interrupt coalescing interface -allows setting the frequency of refreshing statistics, if needed. +Drivers may sleep when retrieving the statistics from the device, or they might +read the counters periodically and only return in `.ndo_get_stats64` a recent +copy collected asynchronously. In the latter case, the ethtool interrupt +coalescing interface allows setting the frequency of refreshing statistics. Retrieving ethtool statistics is a multi-syscall process, drivers are advised to keep the number of statistics constant to avoid race conditions with diff --git a/net/core/dev.c b/net/core/dev.c index 18904acb7797..45a845526b64 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -10367,6 +10367,8 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, { const struct net_device_ops *ops = dev->netdev_ops; + might_sleep(); + if (ops->ndo_get_stats64) { memset(storage, 0, sizeof(*storage)); ops->ndo_get_stats64(dev, storage); From patchwork Sun Dec 6 23:59:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 339015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7266DC19425 for ; Mon, 7 Dec 2020 00:01:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EEF722D07 for ; Mon, 7 Dec 2020 00:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728692AbgLGABB (ORCPT ); Sun, 6 Dec 2020 19:01:01 -0500 Received: from mail-eopbgr150052.outbound.protection.outlook.com ([40.107.15.52]:29828 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727661AbgLGABA (ORCPT ); Sun, 6 Dec 2020 19:01:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=faHcYrl5Ppt766mLNPP+GaUG/PihURsm+DoP9OcGkFrb1qbbWiiAHAz2LFdejWCeToFP8Sqv588IBhQFr9ml1uubQ5cHqgiBXlY0YQh3uXVXdj2SeoeXC9Ag/lUdL7emU46Re5OBQJmCd8g4e66UWnagliHE7hj9rWi92gNaufjtXVqRJXOlsGCts5d7lBBqCFhCw4ff4DbcEkQWvrUuwjoI1dGCajfoC0gM4sCbhVhAyY38pOtb/5Sq3lCFgOfWTtuJOziw3Nxr8LLyfUoIJhfY/eIHxUNmnomI4IKaN0JCH6supk5Ty7RBkHTgmHUQztdLvy8aPdO4SiYPERZPfQ== 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-SenderADCheck; bh=syJmnDIcP9vPDwvyxxM1qoW4SiyaCBwoBEiboGQQTds=; b=ekdegJsLa4upvcNK9+q8VFECu/6H0nl2QW/s3I1R3FO6WBGAzqaMNy1Z6bD1Vhg9wy9/kFQN65lkGHzC6+XDhP4N15Q9L32RjAySIJ8Qhgm+0LRK0LVsJdXJ33kxWoQgyMGvS5lls83wBR9fHGX50GKnS3fMxU8nHipUts8p80CQjO/MYxVIG6OUhEhSM4ZyxLZZSCVCpQZs3qhePMT7Kh5biyO5v0dEeez55V/4qOWlQjyfl0yJqCRF8vPuirIL4DOu/Z/5mE5lXtftAlj7/fN3myyLjr7bGl2iMpNcUubqB48owVB05wEewwN2WWJfwy4pclBN4SPdFAZ97bOuJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=syJmnDIcP9vPDwvyxxM1qoW4SiyaCBwoBEiboGQQTds=; b=S2ffH4qxcMjhDS2V4oGL1WvMrANH/9vnAuNawradGJNfmNQaDjA70pCmoIRGD88W0GYyPfJboKFGViVS8dwULTPiJ95QHPk697hhoQazvA6HvKJ+IMI1R0CZ53ZSgQJakkHzUB33o2k88SQajJyzxiomUadLGw957lsgNTzXEpI= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5502.eurprd04.prod.outlook.com (2603:10a6:803:c9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 00:00:10 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 00:00:10 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Paul Gortmaker , Pablo Neira Ayuso , Jiri Benc , Cong Wang , Jamal Hadi Salim , Stephen Hemminger , Eric Dumazet , George McCollister , Oleksij Rempel Subject: [RFC PATCH net-next 13/13] net: remove obsolete comments about ndo_get_stats64 context from eth drivers Date: Mon, 7 Dec 2020 01:59:19 +0200 Message-Id: <20201206235919.393158-14-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201206235919.393158-1-vladimir.oltean@nxp.com> References: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VI1PR08CA0156.eurprd08.prod.outlook.com (2603:10a6:800:d5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 00:00:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c9b0d924-4aa9-4486-635c-08d89a431065 X-MS-TrafficTypeDiagnostic: VI1PR04MB5502: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:525; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +wdKwk7xuQJL7Rv2Ax5N9psUtHLioz7yuGyi1tXQdDGShHGQLPIHJdsKEMVINCmPyW51St/uKLeXE9v6qcPp6TUXmD3tnsihK6eLAAXt/pUOV2qegoI+4NPDX5u+v0wgR6fkrjbe4So7C59t6GtAN8I+CccyyQDcXZFQT9Y4fIpoVAQqleStjlNCFwfbrbiqDtHp5VWf6uWv6V5KI+ZzoC8/kOGDYz9GYUMVnuJsjZeqWxDX2QS8SMrS0hIUfb031yDOCOd4OsdcXnCyWPaNWlq7ZziTzS8qnQ838OCv1M+yvcVg66xlN0sUpFCnnS6VqPxTLYEY8P64moRHS4b33Y8Z1XTnfaSesNSB8RNW68/XT1I1E6y0jqrxJMxZMYq8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39860400002)(366004)(396003)(346002)(136003)(26005)(478600001)(8936002)(5660300002)(8676002)(6512007)(6486002)(186003)(36756003)(52116002)(16526019)(4326008)(1076003)(956004)(66476007)(2616005)(110136005)(54906003)(69590400008)(66556008)(2906002)(44832011)(66946007)(86362001)(83380400001)(6506007)(316002)(7416002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: BeHhn+bpVvlaiux1A0c3JfmcO2eOzWDFChJK1Ms9e3koXR3if+/Ziw4CCjavcmAx3wgK3MtArwf5/l0xrw68gsey5jmuEdbnbvr1UZhqoWQ14oav/TrjjPzeyfZTA8hKMvKUHDGw6hLrnUdO2ic2BI2/kSAP708N3e5q2yNKGlur7A4maeyUC1+VG6syII0IdczKMDyiijxJGEWEyxNhzfmKBN1sqyUk+O8GUf/c3EPKKcHqD60phLGsNWhQNgjtDJDkVwV/ZPwb9mo3Q0h53N1SIPyldnpqXy5oecM92HFrMt7qo/GRSxeoiPsdDZTBdy+KxZcfwY5i0ko6tVEZqRml6nmvR5mKBbUOQr3RoiDNw3pxhRmaA0Sfofm7Dif2BOxk05wVJax206TRrC9Z72xYnHhWBapWLwAzJy2C32WZJ8H2iRs06jsrn03idIl62Kb8F3PWbXiMXktJYeaBgnTRbHXbhYRPoPgWV7hMdL/ed0bV4drJ/ZWygBxfO2x+wiUgPM5Kzve15eXbiFMKVYA0xIX7zN63sDYWsxyZ9AQnxgWS+Ot2xnsk0I4M6Z3qF3fCRXHo83CmtLIVO3ZMJRrYFMvua3ivDrA613JdqmNU+cqhrsTW+XBR6Oqo7y+2afvTHx8BDB0AlxckVigoHAJY6mjxi4k6RXlz8uE+JbOHoSKtWoju/Xv7/KXPSh5JpNPzDjob5gm6Fp24CH/edX7mVIg1gdH9QZ2y0kbYXnR69d2FIWypjWLprhhZHJHBO/r76HosuovMpcaowhWpQQor2S21DzPEs5r6C1b6/0GiO3V6oEHV8sVjKLJY0XffUmGn5+b2+gCWXF8vTh7wNpSn2mYl7emOhrZrcckw9uFSLJZD5ivgLkUdtw5SborWfG1a7YVXOq2fFUq3yqhzPu4gciO66t9zQIsMEEi2GehRp4BKV6gBF3Y1ABXf80UP3EUJNHe1q1L7OKlyUG9F+VvRe7iHS+tod3s2RTkmIQDoSP6BdB3UFCWHxF5ccYZq X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9b0d924-4aa9-4486-635c-08d89a431065 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 00:00:10.3930 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5EgklLesF53VFzqXIShzHCiu3fCljxTWZQGePBUOkowS6X5LGXW6GbNATZsVZslKkkYqHIpicJ7Eh+24iJapJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5502 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that we have a good summary in Documentation/networking/netdevices.rst, these comments serve no purpose and are actually distracting/confusing. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/cisco/enic/enic_main.c | 1 - drivers/net/ethernet/nvidia/forcedeth.c | 2 -- drivers/net/ethernet/sfc/efx_common.c | 1 - drivers/net/ethernet/sfc/falcon/efx.c | 1 - 4 files changed, 5 deletions(-) diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index fb269d587b74..7425f94f9091 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -870,7 +870,6 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb, return NETDEV_TX_OK; } -/* dev_base_lock rwlock held, nominally process context */ static void enic_get_stats(struct net_device *netdev, struct rtnl_link_stats64 *net_stats) { diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 8724d6a9ed02..8fa254dc64e9 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -1761,8 +1761,6 @@ static void nv_get_stats(int cpu, struct fe_priv *np, /* * nv_get_stats64: dev->ndo_get_stats64 function * Get latest stats value from the nic. - * Called with read_lock(&dev_base_lock) held for read - - * only synchronized against unregister_netdevice. */ static void nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage) diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c index de797e1ac5a9..4d8047b35fb2 100644 --- a/drivers/net/ethernet/sfc/efx_common.c +++ b/drivers/net/ethernet/sfc/efx_common.c @@ -596,7 +596,6 @@ void efx_stop_all(struct efx_nic *efx) efx_stop_datapath(efx); } -/* Context: process, dev_base_lock or RTNL held, non-blocking. */ void efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats) { struct efx_nic *efx = netdev_priv(net_dev); diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c index f8979991970e..6db2b6583dec 100644 --- a/drivers/net/ethernet/sfc/falcon/efx.c +++ b/drivers/net/ethernet/sfc/falcon/efx.c @@ -2096,7 +2096,6 @@ int ef4_net_stop(struct net_device *net_dev) return 0; } -/* Context: process, dev_base_lock or RTNL held, non-blocking. */ static void ef4_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats) {