From patchwork Sun Dec 6 23:59:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11954635 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=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 53FCFC433FE 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 19BB822D08 for ; Mon, 7 Dec 2020 00:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728561AbgLGAAs (ORCPT ); Sun, 6 Dec 2020 19:00:48 -0500 Received: from mail-eopbgr80058.outbound.protection.outlook.com ([40.107.8.58]:53705 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727661AbgLGAAs (ORCPT ); Sun, 6 Dec 2020 19:00:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0GD9odS1BqzHlzfNu7/pfjUBfbcQhvXo1vmvLoGKor9oSrxXoUXcxGE5YzNQKVxx5acfR3uqZVXhrqAjCRCRdAUsFCCDlXuHRuNVpLnDLtRMRoFUYAQS8274jvkGrKAw/Tn1ynjw0M4RJYNJmnXMXJiHzU9cNNa2ddwBtnVI7FlvdTtykcFlAR+dP02Bmj9Pi/U/ZxJ+Rk4fkhnkX9DTjgHN3yF/nU552aOS/9o58x0mk3paqSK9kWj1+STfAuvDdC9p43vd9KXVN+icoDbUaP4QvsHnLvu6yHT69TsZfBfqneJEYfNkE12xzpDvh5drMQvPSUhKN7DxePYNEE0wQ== 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=DzSc2uXk+B9rny00uQrPtEptdCy/bXPB1Qa8fZNCU/c=; b=dfsKDeemTmqshChoas4AgKCspi2MZUI+1nI6LUHmRzW8MGtVAyjuFgoaZe/og4BeNzThz+t4NaWjgmcS1xRWhT99NIhOoIES427VdhZfADElba/slbtR/EtAdRxfHFOyzDKjkAbq8hVZmL9KdWHgtG7C2N+/LuGm2dKC2ipeM+RmfL4KHvIRBJSj3PAqTFYXRSYLlrGsC8pwTzkokwm/90rJ9fRmnDdoHMoarA6sGi6/uZNTyAh3UH8qRiwC0fesEyWo4Kgalr0QToup/JcHhb4K/Jy31W6EWbeCQFfpuJUlxwWIPKtAEJ1bw+460ky+hynO3FtWkvlKQA4IUKeofg== 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=DzSc2uXk+B9rny00uQrPtEptdCy/bXPB1Qa8fZNCU/c=; b=kB209zSesDKpe5jBELUp+gBaHcWGUeSW8dbV2YRW7gsolh7zbtSxNWdGdDHbXV7Uf5/uNspZmvYMJaXFaopwexd4jdesMKVGToiLHPylVF8eOGKJdHcgg3f8FvJnpCRGLwevAEClNWZPTa4ehtt01tVswb3nqqnCQjDmekvqEXY= 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:58 +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:58 +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 , Heiko Carstens , Vasily Gorbik , linux-s390@vger.kernel.org, Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Sridhar Samudrala , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Christian Brauner Subject: [RFC PATCH net-next 00/13] Make .ndo_get_stats64 sleepable Date: Mon, 7 Dec 2020 01:59:06 +0200 Message-Id: <20201206235919.393158-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 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:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7e91e613-46eb-46c7-7b1b-08d89a43093c X-MS-TrafficTypeDiagnostic: VE1PR04MB6637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: seMWeIR1jjklbH6woYYKLWxNRnChfwvvi5pEW1T4eotQHZK3U/d/p33XOgOAOLpSGjRuRotPffPQIqvuTzKAJznBc1lEQy22Mj+VG1OWHMDo5RfCcAuVrUU66OqCtZo43bfHX4EYEvfZm2oRrB0n08cmNT2K9rKftVmkVoTKhuP+6MyL2Eh9903Sm56vMC71CF2hCaNN78pMUe+DL0tquyjVmuwJOlTZ5XDz/5DdMI6zzVnCP1VAkripTpULRn74x3H7kWP4ebuvWy3T4tg1DCkcrMKx5+lkaiV49+YJwedGUlratFZUtG3rINuwsFVtFLJr6kqQhstWaZee0sxXQsCFh9hP/VQQi5fTrvWW1M69HfPcelxx4MLY2n/ZJzExt9+Woi4wjXVmNpd8l0yLn73TFhctn3xMue31r84XhuE= 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)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GAfUBujZF/Aycxau8T0RDvJL7pijGPPa9eNQe2DakdYCNwDvcIQjkIekpJm2M0mDnZuvva9it7K3vz0YpwlSX4wXVZMfQLF6L9XJjhZpUB0fQzf66UZ2vJz5bboaceCMCblr9MASWBOf0bvGU9HoxBxluc7m+gXCX1Gx7n3ZSdHU66AAM0HUXyX8b8Rx4Soj5frCyxtWL2HHDllaA1HkYM3ay+QgEvprQwTNS/faKplKHB9c79qUpmiU2r49BEDTeebVVery1P0j/1rie0ZjgCTZJZMDkRwfqPB7u7VrvNetTRkCuven2YYu6ULF30cwJNXPHm467Dc9pZLpKQkLknyCtVgcNKoxwsnQ+D1ITjTbObgJICj5AMv0znUzQ5XlTtJXDnopc484NOKZDmBdowA559aOVH4MT9n8j2TmQ8t0x/duIiqa3RFc/XGTYPgqUIuM7E1GUyXaM7CpUY//zFIjhUZXknQN3ArlIkuA7q9W9wisEIrRlLjzwaBCSbHuRy9fPrrnEuzlyt5WL7zIQb/7rTIiq28ygFQAXdXmej/RILDLCpLn1Ut3HFhn1IjdJxCbuQtYutJYOIcmq+jXWXaZlA4xZrMx8DVR+02sqDaCaKDMqtUw31CoPawHRmLdkdTHK8VQbCy4hjou52UjneJRjlaCHarHuNhBfH4sm42ybvJxkz4yKbR3XqT5pNx/P98ONhrQg5wsuAyt6bFSB6qfOYtyaLOaujcad8T6HphC4KolqUTpwaOTGbxWdV2VOwtMBKkADRIxXyRhDSv9dqJUlje3PDr19iIBdTIpLl5j85CgpEispJxQxuVJmP6Ue5ZzeYH+0kAer8MO9/7wnH2FmDv7DggK07q48HzdeciU/2ssW1paxY7ETP2oAPNUvO1+OpbQoKofILPaCNOZulP1M/PZWk/ftLEMvg4MwyHyn1c7Rlq8xNQSwSzQMqoEjHer2eU+fcRgO+UKHDmd4BXmQy7gzD67aTEBSaySrSOUTB2CVdFw6a6B7zaxS7YC X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e91e613-46eb-46c7-7b1b-08d89a43093c 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:58.4038 (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: hLlxJ183ZUAf1s7qpnluVZXJenbSX7tztGCvXO3PPY7Klf3/NFWApugEHd4X5bKf/lRGZLIIuuie4TLwrAuvEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This series converts all callers of dev_get_stats() to be in sleepable context, so that we can do more work in the .ndo_get_stats64 method. The situation today is that if we have hardware that needs to be accessed through a slow bus like SPI, or through a firmware, we cannot do that directly in .ndo_get_stats64, so we have to poll counters periodically and return a cached (not up to date) copy in the atomic NDO callback. This is undesirable on both ends: more work than strictly needed is being done, and the end result is also worse (not guaranteed to be up to date). So converting the code paths to be compatible with sleeping seems to make more sense. Cc: Leon Romanovsky Cc: Heiko Carstens Cc: Vasily Gorbik Cc: linux-s390@vger.kernel.org Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Cc: Sridhar Samudrala Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: Christian Brauner Vladimir Oltean (13): RDMA/mlx4: remove bogus dev_base_lock usage net: mark dev_base_lock for deprecation net: introduce a mutex for the netns interface lists s390/appldata_net_sum: hold the netdev lists lock when retrieving device statistics net: bonding: hold the netdev lists lock when retrieving device statistics net_failover: hold the netdev lists lock when retrieving device statistics parisc/led: remove trailing whitespaces parisc/led: reindent the code that gathers device statistics parisc/led: hold the netdev lists lock when retrieving device statistics net: procfs: hold the netdev lists lock when retrieving device statistics net: sysfs: don't hold dev_base_lock while retrieving device statistics net: mark ndo_get_stats64 as being able to sleep net: remove obsolete comments about ndo_get_stats64 context from eth drivers Documentation/networking/netdevices.rst | 4 +- Documentation/networking/statistics.rst | 9 +- arch/s390/appldata/appldata_net_sum.c | 8 +- drivers/infiniband/hw/mlx4/main.c | 3 - drivers/net/bonding/bond_main.c | 16 +- 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 - drivers/net/net_failover.c | 15 +- drivers/parisc/led.c | 164 ++++++++++---------- include/net/bonding.h | 1 - include/net/net_failover.h | 3 - include/net/net_namespace.h | 5 + net/core/dev.c | 63 +++++--- net/core/net-procfs.c | 13 +- net/core/net-sysfs.c | 3 +- 17 files changed, 162 insertions(+), 150 deletions(-)