From patchwork Tue Aug 1 14:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13336822 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F3A3C001DF for ; Tue, 1 Aug 2023 14:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mUGfZInw1vKkUao7zt8gYAhNyYTwXt1NGPyleLQ71U4=; b=yojKNI/0FJbPkp UtEIem/QmLEUZH2PD99fiFg7p3lO3iVDlQYR+icYXP3L7M6sMXvBKZggbhwWQ0FOL4iQf8DdIgcbH 5DrBijzBVX5vxZiuTV8xeg+8Mkp6Sz1r8eN+WulkOd97/qCn68u7Oq1CdmvMcS3l70Gb/TvChb7bg SyPsJ4gtmrPS3UYANFgdGZVUH3O9w8gVPjXKmB3pFcUcFFmYP2d5u8fsqFiQIO6VqUTY6w7/wc5r1 Y8/dL5DY06jTiIj6kCO7s+VQ6bJMYORIJyHMH+06oJ1I9GNgDRv2S2Vbgo43GOr4uKQLSaptQrtVy mKKiETsgwxRH0bamJ1jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQqNR-002aFT-1S; Tue, 01 Aug 2023 14:29:33 +0000 Received: from mail-db8eur05on20604.outbound.protection.outlook.com ([2a01:111:f400:7e1a::604] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQqNO-002aEd-2e for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 14:29:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EeH3gfvCIzSB6c821hzUF0BTM0uNt53MbxIWMXm7biKJKf9qLrHGakNALa4x8IXYySzHTN3gaV70723CVOoSe1hdFCPPGfAqu/3KBmvVxyVgIkuPFfRsyBmFVcmP0KYbJdafmnjGz8OKo79+ZmHhQHpgw23JCB4QV+Wznc8wCn3xKqWo9DISLvst91c9Npk7/fp2vKjlGf4h0O22tqUqZ6js7Xl+o1hleMAkvlo5e+yOiM3ts6/otsz4WS0cNI3OHtd1LiiliclJA8lFzdNWbF6EB59u4Li3dscNmjKWPp7+czocgaqnEQL9tBdXOylT013Q4tGrjDSLQ6f8wnGyuw== 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=N7CaCgW++x2o1ikUVe9VmdwmQ+wB1Lh+l4tNTTufkIM=; b=kZED/gAppBmhqVZ1Vo8f/yzO+VCcZ2bNMeOz3Mfmzzq7p0SsKgzL+mwvWfB/o9xLN2n8rpllVsUS3pviFpHyJgQxUiELk+8SnBSlWyCtNJCPFwUfmak6o9jqkbsAVamUu0S0+5x+FPkZEITadncxZzlTYuYZ9IUbowzeImr7JVa7E3+Up26pNoOZIs9mXJX1uLmoFRreUf9muzMds3GGLA/CG4mlDHhLbdKmh7R1lGKqiQR1P51e1dfPzrSDABLE24NXG0X1hZlbR7TgrII0aLBbQB0cA3TPv35BmB7U6erlLZtvXNcnsXJF4F/yW9eStqZYVhTeO93ODCnUuw9yIQ== 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=N7CaCgW++x2o1ikUVe9VmdwmQ+wB1Lh+l4tNTTufkIM=; b=ZMUQzCk+dqBiPgnarC0uUs+qd0IR0W2APYLC5gZAgEuuJi/rg6zSnJp3OHrwZXwyJVxPPqgnNrUZjYrWE6oLjyQmY1q+bZvgYU+VvR/QWE66c6cXkgQUX4TmFekrmKwKq9ZOMunNnImxF/ChtP+DZ6KN3QNfH3byug/oaFUF/Bk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by VI1PR04MB10028.eurprd04.prod.outlook.com (2603:10a6:800:1db::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Tue, 1 Aug 2023 14:29:22 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194%4]) with mapi id 15.20.6631.043; Tue, 1 Aug 2023 14:29:22 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Florian Fainelli , Maxim Georgiev , Horatiu Vultur , =?utf-8?q?K=C3=B6ry_Maincent?= , Maxime Chevallier , Richard Cochran , Vadim Fedorenko , Gerhard Engleder , Hangbin Liu , Russell King , Heiner Kallweit , Jacob Keller , Jay Vosburgh , Andy Gospodarek , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , UNGLinuxDriver@microchip.com, Lars Povlsen , Steen Hegelund , Daniel Machon , Simon Horman , Casper Andersson , Sergey Organov , Michal Kubecek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 net-next 00/12] Introduce ndo_hwtstamp_get() and ndo_hwtstamp_set() Date: Tue, 1 Aug 2023 17:28:12 +0300 Message-Id: <20230801142824.1772134-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR04CA0027.eurprd04.prod.outlook.com (2603:10a6:208:122::40) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VI1PR04MB10028:EE_ X-MS-Office365-Filtering-Correlation-Id: e5a4e6f7-42ba-4423-3372-08db929bb2bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2EaQuigIV7pbzNfMAIIpF1x/OjxUtwuhDGJ+46gi/A1FqVJAfEXiCevlXp1pamqdDXfYNFOiKPWatWqD/SEw3nfDhURkkpq4BJFV79GHIKEMKgYOS+j+7N0F/MYu3+Rv1fCuquzKkFSbKuLQvyMN1HxMcG9nJJU8PAMXg17ao0d4P6Q5LAw6L60bPmh4HQVboxPz20vZqiwKvq90pY0NaWNWZK4a00jtFCGriaaegjM0Q0/nrlPePtPC8gHQDHI1ncGazIkslqjPmQEWufQuNoxvlZ/Llx+P36OLehNEXHg18TlgKOA8UGZVt/nKpguSWB2XN1QWxCIbXbuO5MMmmtLdf8Hlfj4YYr9JhKHC772zkebni7mA5Ybta2ZNqqo3Bs+cMLeWy3CNxtWfx6DqMijogeQPUbDogeCNBhGYPBtQGXSbhtB9YpyCKutF1Us6DUBqeI4UJI76xzVvAPjAPhm8p1FP0TnZ5tyzWRZk6gmPKLp0xT3Hj5KV3HTq3GKNzeuSD/wjydCP+x3hOp5ld6FbJP8N7LLEk1rhUfVNPjZGmFeVh0oznNWM1VpBNw9yReWpSPIfLcdDovGHdcNAJBRrVwG1KRFHTNIp01nhtrf1oypatYRGEJt43AQk84Vc2nI3jr6f45RD/e7cKKc0KA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(451199021)(66476007)(66946007)(6916009)(66556008)(2906002)(4326008)(44832011)(5660300002)(7406005)(54906003)(41300700001)(316002)(7416002)(2616005)(52116002)(6486002)(6666004)(26005)(8936002)(6506007)(1076003)(8676002)(186003)(66574015)(83380400001)(478600001)(36756003)(38100700002)(38350700002)(6512007)(86362001)(966005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?AWBOimrRIUts+XVRJYvQ5dQnNrz+?= =?utf-8?q?gWcYZqt9IOupg0vnXRh88ZhAEYlsg56covs/P2nUret6DciJP9z/LSDGVKRY7q22H?= =?utf-8?q?XRocoJovp2xepzsmwrHbPzGsYqorSTmvQzen/go37hZyis4ASXlK7Ug02bI4rwgX0?= =?utf-8?q?jC8uvDgkuXPRqVy4gA2TINfKDNBnQJVG5O82FuhXlbejwltFig8SgHdf4OqjKV15x?= =?utf-8?q?c1MyM8BQMvz5Q1N7sip37DZVFIQ45mWFXSg1Lo3v6AwgW77NHMhQDEF43Gv+u6VkS?= =?utf-8?q?iKN524KwcBhAHBwmrkyNj9JtXWL44paeCWG+582yy+JSlRX6//tQZHMguX+6kC7Y0?= =?utf-8?q?jeJciq6ezk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fLzNjeM8a7chcBc6K4l9rYieds67KY1JJDqvGOZBo/QxLOierQGim?= =?utf-8?q?vT3yFWy5Atc/lzjzuNGob8gRX7taQjOGjW7uUN/oDfb1XyVffKCfIID0H8isBbGrb?= =?utf-8?q?5vPfway3HySzsxa3jP5dI1RiBl1yJh8SNyL5G3+OvKpp98FwsK58MYHHVh1gakWf+?= =?utf-8?q?YMBgO738tNKh3pZqTveghndtu48/8yAf3KqByzvb6c0EfX2LOZTwf8UwvtQ/eM/qh?= =?utf-8?q?kb7xfInJHMFGEJ5kgozVzStZlpHPzXBx2lf1r1fcAXKWo9CNy2joywzyVpAvKZjZn?= =?utf-8?q?tyRERvahYcO5FvngQos8sbBNOcuGD9b0Yw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5a4e6f7-42ba-4423-3372-08db929bb2bf X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2023 14:29:22.1452 (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: gbnhoR0PHW6kruJ74pM2/BjQe6+apQIXPr3dzTB9YBeYOyIWmXx9d0LEOkFcoh1EKzWMfHPiqo0Jdz2iaEgmvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10028 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_072930_947221_63B97B3B X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Based on previous RFCs from Maxim Georgiev: https://lore.kernel.org/netdev/20230502043150.17097-1-glipus@gmail.com/ this series attempts to introduce new API for the hardware timestamping control path (SIOCGHWTSTAMP and SIOCSHWTSTAMP handling). I don't have any board with phylib hardware timestamping, so I would appreciate testing (especially on lan966x, the most intricate conversion). I was, however, able to test netdev level timestamping, because I also have some more unsubmitted conversions in progress: https://github.com/vladimiroltean/linux/commits/ndo-hwtstamp-v9 I hope that the concerns expressed in the comments of previous series were addressed, and that Köry Maincent's series: https://lore.kernel.org/netdev/20230406173308.401924-1-kory.maincent@bootlin.com/ can make progress in parallel with the conversion of the rest of drivers. Maxim Georgiev (5): net: add NDOs for configuring hardware timestamping net: add hwtstamping helpers for stackable net devices net: vlan: convert to ndo_hwtstamp_get() / ndo_hwtstamp_set() net: macvlan: convert to ndo_hwtstamp_get() / ndo_hwtstamp_set() net: bonding: convert to ndo_hwtstamp_get() / ndo_hwtstamp_set() Vladimir Oltean (7): net: fec: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() net: fec: delete fec_ptp_disable_hwts() net: sparx5: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() net: lan966x: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() net: transfer rtnl_lock() requirement from ethtool_set_ethtool_phy_ops() to caller net: phy: provide phylib stubs for hardware timestamping operations net: remove phy_has_hwtstamp() -> phy_mii_ioctl() decision from converted drivers MAINTAINERS | 1 + drivers/net/bonding/bond_main.c | 105 ++++++---- drivers/net/ethernet/freescale/fec.h | 6 +- drivers/net/ethernet/freescale/fec_main.c | 62 +++--- drivers/net/ethernet/freescale/fec_ptp.c | 43 ++-- .../ethernet/microchip/lan966x/lan966x_main.c | 58 +++--- .../ethernet/microchip/lan966x/lan966x_main.h | 12 +- .../ethernet/microchip/lan966x/lan966x_ptp.c | 34 ++-- .../ethernet/microchip/sparx5/sparx5_main.h | 9 +- .../ethernet/microchip/sparx5/sparx5_netdev.c | 35 ++-- .../ethernet/microchip/sparx5/sparx5_ptp.c | 24 ++- drivers/net/macvlan.c | 34 ++-- drivers/net/phy/Makefile | 2 + drivers/net/phy/phy.c | 34 ++++ drivers/net/phy/phy_device.c | 26 +++ drivers/net/phy/stubs.c | 10 + include/linux/net_tstamp.h | 30 +++ include/linux/netdevice.h | 25 +++ include/linux/phy.h | 7 + include/linux/phylib_stubs.h | 68 +++++++ net/8021q/vlan_dev.c | 27 ++- net/core/dev_ioctl.c | 184 +++++++++++++++++- net/ethtool/common.c | 3 +- 23 files changed, 630 insertions(+), 209 deletions(-) create mode 100644 drivers/net/phy/stubs.c create mode 100644 include/linux/phylib_stubs.h