From patchwork Thu Jul 13 12:18:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13311942 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B4F911CA3 for ; Thu, 13 Jul 2023 12:19:38 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2075.outbound.protection.outlook.com [40.107.14.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1A302706; Thu, 13 Jul 2023 05:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ROCa0DarMt3sv8UUjrTGWWrTN1olq0X6150GwQiKsn0RpMpo4l2UR9OQtZfqt6iARsgFXsWsX/7uwSf7YjqDThI+mLOVmGdqhv9rh6GSUQ3Am2ahzXoLjSb1meiTdoy+p27XboeIDxlMaW1ndjDXFSxZlOPJrhnF9bHcqKpw481TF+M+j06rxLcWCOK71iq1gRAJXhO4dRkDLFotpr1WWyiFxWPmkL/cS98R7WNWTOGcIQMhIhgKN5SoD0Gk2uczJzxU204JEq0IV6+NyQDWt3V/7St6vvAGaPOK9fa0d6kKmLrfRix2ugRsvWWw1Aw98nvb20BQLAxP5FNu+kd0QQ== 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=eIdP5O4JigGuuPyoOYxAGk4KKsGKBGJHukSXxI6GkxU=; b=FrfTDi6vNS0ieTAPg2938HmiqkAIC5r074RdEkORDNy6Zuv662eixtI8T3GYljRyATPREiXXIci3Y15M3+FmLo24EzJWZBT0kzGwBXCFr8YE2rNFswZtIPpZzTJQb/JK5kgNA0KTZ5CLN4/dFNfZ7xNK/NmQNMdbWXOh/w7ZYYZ4R20Ps/Dy4j3l/UvnZHfwGC0OH+l9Uc9Em1naq0oILztAFv0vT0ZJAsKbBxWFV1BFjK0X6V+o5K0CzFiRqDbmpB171jYJoQ4q1khJQq83LDMgbfPM+y6IccScBaBhnkRLn/JJClgQwGwmq2ab+tPZWWptfWrPM1c62NPTbCPvtQ== 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=eIdP5O4JigGuuPyoOYxAGk4KKsGKBGJHukSXxI6GkxU=; b=E80aB2ROItEkpLtShuNr1VNcRmd/ZA92cKj2pU806ijNVKw3GlUcAdzRlxOr7QWXaaly1MzjGUOki9gK4UfxAPeDss6iYZvUhqx3HQpgscT5dIHDEsa+rq2vcpRCuOMM+xY9TcHZZXxXQFvDsZk0GSdNQYEpm3ceAaIN++KaNfM= 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 DB8PR04MB6971.eurprd04.prod.outlook.com (2603:10a6:10:113::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul 2023 12:19:30 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::cc2a:5d80:9dbd:d850]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::cc2a:5d80:9dbd:d850%7]) with mapi id 15.20.6588.017; Thu, 13 Jul 2023 12:19:29 +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 , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 net-next 00/10] Introduce ndo_hwtstamp_get() and ndo_hwtstamp_set() Date: Thu, 13 Jul 2023 15:18:57 +0300 Message-Id: <20230713121907.3249291-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: FR2P281CA0157.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:99::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DB8PR04MB6971:EE_ X-MS-Office365-Filtering-Correlation-Id: dce14071-d807-4a0b-6cd7-08db839b6864 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wws0bIpOCWnvsCbRydkhqJFRSgUqbJMzVBVOqybZDvJBrEiPUwYA7cpthEJddp50ncQH8DI29FDvjiTj3aQ/JraXx121e9rtrr9jpL9E8Wb/INYPuBQJPFw/puDLKJ7ew5gsGFjCPFi7HOcWXCeREvYo/H7dTuAmZnZBy5vU1vmR/7DF67+/vF2Seie4oaNdqHI4vT/W9xOAze5mEd5pgVzdRvFR7seV8TcdXnYFDtV9APSQ4mJFGcupyaLazD74wkkkyJLrfNiQT800fsMEUE+zo9iYBlUpdbXafEhmoPa2xjnQvqr6QGcYP8SsFYeZTWfvhz5ZRieA/9BxCcqiNLejslvDJZo6x72/ZUDtawdw49PjC+MLU1o/LEdFVlrLfY2FVZqQeAjRLqsHW2LxIwA/S0Emg181FpgEBqvHV4xb+gzdf6rMm6D9giwQH3rfIp6UJWEBA4diByUp21CTovdr2fYixA6Y0/UArH89fCDSLO82algpTET2VUhm+X56Spajr1+uD5BiIAvWWS7cAJCRq/G0vNSnjfAXv6i3YMZr//MAyVoAAP6yxxsShJ3dtewScss107OZ7dZ97Ikqxcb5LP2nTkQfcHVWCyvDSXgEydtMMvV2NwFEohWpGVasgItj1f5c126narrrZT8pDw== 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)(346002)(396003)(136003)(366004)(39860400002)(376002)(451199021)(54906003)(316002)(6666004)(52116002)(186003)(66946007)(6916009)(4326008)(6486002)(66556008)(66476007)(478600001)(966005)(41300700001)(6512007)(8676002)(8936002)(7416002)(86362001)(1076003)(6506007)(26005)(5660300002)(44832011)(83380400001)(2616005)(36756003)(66574015)(2906002)(38350700002)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KLqfoRnbiveM6gnFSSqXznNyZLjh?= =?utf-8?q?j6H8X06ihhWOJNH0DTJvimiUomLVJP0oy8czyrcuur3ZFWkMMvt3SDKIWujtpIT6v?= =?utf-8?q?ucl6SHtu+t5zLUzuV5U5n1z40J9vMihksOWud9grIOqvRujWbvPLH4D5kAbAczGbM?= =?utf-8?q?g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uZZU/aXvrIFbxVQgAR9dnIfP2rd92xWuweq7txYLYgfmqriik3SOvg?= =?utf-8?q?ruym/sDIeFUV9ln1aM/djuFmIV29nVT+pzv//pZCgjqaUdKN/nNGdM0QvJBNoyuNT?= =?utf-8?q?GSb49isGmDgHEhoSrt54owES3i+ManrXyMKGpHI7rm6qSBXb0kXhsfZwkMLmaX3HR?= =?utf-8?q?z/lteqobCJ4qwZ4zIzwlcc7fiSeZaVhfbwgw4/1B3zRn7l10ASAKSU+hhVHks32wC?= =?utf-8?q?7o/jgSt6ILjKQGKXzWJfCuEwRZu2k55JXhLDzbjY8dRw3Cg0ADlVZ3z12s+yfUraQ?= =?utf-8?q?AX5mi2f4HSTVF/iIebyXPLrmNDqWOZHVJGj5hX4wYBhKpICEOl1YithzpMoElHeVm?= =?utf-8?q?wfsrCFkWKhsQyLzEyPsDjNZCKI646tT4N5Ai5iGOb9WDCfRI1w6kY5ozrV9bhpW02?= =?utf-8?q?kdd8gtgYGyUCM1PZHpaXuu7cOdzvvsYS85QfOLKdR4d07Auq0IZASxDx4CkDLljmY?= =?utf-8?q?bdZg8i//Oxvrx1uSD/x3SfBW6fSh/hpidw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dce14071-d807-4a0b-6cd7-08db839b6864 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 12:19:29.9316 (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: x4G1CqvrOFY0Ryq6u7JTpQltPRXD+kOZUCBIFEWUrxW5bCRxOBow4JTjw78AZU4TV1I2pM7pTxUqCoxx4M7hhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6971 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.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-v7 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 (5): 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: remove phy_has_hwtstamp() -> phy_mii_ioctl() decision from converted drivers drivers/net/bonding/bond_main.c | 105 ++++++---- drivers/net/ethernet/freescale/fec.h | 6 +- drivers/net/ethernet/freescale/fec_main.c | 41 ++-- drivers/net/ethernet/freescale/fec_ptp.c | 43 ++-- .../ethernet/microchip/lan966x/lan966x_main.c | 61 ++++-- .../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 ++-- include/linux/net_tstamp.h | 28 +++ include/linux/netdevice.h | 25 +++ net/8021q/vlan_dev.c | 27 ++- net/core/dev_ioctl.c | 183 +++++++++++++++++- 15 files changed, 480 insertions(+), 187 deletions(-) Reviewed-by: Jacob Keller Tested-by: Horatiu Vultur