Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5787460rwp; Mon, 17 Jul 2023 09:23:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgdaoV7e0FnNeIZ6VteoP+QqFdQn4tkuayQMP2iKIPe3TSfTZPl2+aAGiHD4mu+7NoGn9f X-Received: by 2002:a17:902:dac7:b0:1b6:b703:36f8 with SMTP id q7-20020a170902dac700b001b6b70336f8mr14406962plx.25.1689611021681; Mon, 17 Jul 2023 09:23:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689611021; cv=pass; d=google.com; s=arc-20160816; b=jgan7C/stUBO5MgdLd0ue/rKO/iW6xPjZr4pxGA2Wf1d+L4NCSg6JG1N3rpS9f5Qrw OC+QSKwNY9Im34kiU/xUI+eAwOMRAXnaegznRqzgJeUJvs5d1OoFWJjuIx6urb0J4bC2 o5dP9WYj6RACJyB+wZnUsy6NWeSUtRZmrTqqTi6PB5cgS+3jpJNsb+69SAxWbl2P/z5B vL0s0G1Sc40M7k8KKPORD2GQMV1VnSiLruciRpWGIi3PvEsuZu4LZMGyfrsyJKwu6bYQ Liw/j+yPZBmBvKS/vAAIGrZNmISL92OjBqbkqD7uuo1XFV00JXl/qihbtKTCHrIANWQI g4wQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=g2Se2pQxcNMhA0FJ2uTjagYf/L5wMgw7IYmnuLV6n2M=; fh=pB1u9kFmKl/f5bcTUEifHJQa7ZXugffegv3ITfVESik=; b=zDQL/VngYSPd43BC0rUXtm8VqVrcTr/y3oh9ufVJ8LJY0CsGWzkG0gYkBoEuD7ZXpH 5xYODYKgxs387Kg63CFmloQtt3pPkF4vedD+bOrjGA29vnidia0BWEW1DTL/HK75k89u 9oo9cfVIsc5GWvVPi/dE/BFdWxVmnkzcPBMkYDud0HLwM+XDK4Q7BerAmfpoH/Bu/rFE sgc4TOerw9D8ts/2EFMTT6yNBwsScaZUdETrnLiAFhQQCL7SExfmj4k432hQK9eENatl hG6xPUnpAT8rKSdIcJqA02rhsGH4oiRi6gGjMCba4SxD/QMF+nvqyjJjxS9eOyKBvw6Z arHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DS+n1zP1; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a170902a3cb00b001b80500f5b8si75430plb.323.2023.07.17.09.23.28; Mon, 17 Jul 2023 09:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DS+n1zP1; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230373AbjGQP2c (ORCPT + 99 others); Mon, 17 Jul 2023 11:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbjGQP2B (ORCPT ); Mon, 17 Jul 2023 11:28:01 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2040.outbound.protection.outlook.com [40.107.20.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC3022699; Mon, 17 Jul 2023 08:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xz7lrLr/t8ev1UDtvTFrc4zvRfgAllEo6iEaBdCfD8A8OSul+emUnmFrAucHkfpxIRDkM4XhASqnf667/h8AK0eC6ET06D1X+Lv8ZMhb5Iz68N1O+HjNe64P2fRryKcs0o8rdZ7pQR6j6tsAe48CQtXR1wWiwj5QfGVN1U150h4Sr8gM/mcQ1I4Ga39k/MMxbDMVt6EI84QguCkr3vNw5LWHwy7D0JnT+QTVwMFhTqnEmR/cmK5hl25EGBHtwf9kKH6JB2i7qz0jS5keUR4v2al492QuJIdcTRETqWbFwqR+dAuHSx9uLyCIzoX13MjduThiAsfXrgNqIfLwsk3PrA== 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=g2Se2pQxcNMhA0FJ2uTjagYf/L5wMgw7IYmnuLV6n2M=; b=adZ4QiKeyxKqoNwBTqvRYm/UUGvn0fG+GhY+qta0+G7lU6EALDzo+Hch5VM1LK1IMzmu/9JtNFI5Tc1JmQOUDrXR2msmavSooQwKIm+oOhjDXGz72Fs2wo69RooXcSOEy2N9c/Q0rAZwuGKTXbsxR/DRISYKd+ytj1xbdKO3buYWdy4q7hCL6LqaCegHAMYgaehaescEMWZ9ppytw0Ba3kJp2UJUxWxj3MItG8klLsQaAwU/GwE+KGW3536p6YNL22VzV3IhrKso/5kAYWZJHWXWWZhulM4JlN16wwp0qiv2kvejSIc+DPxRdKmiXRKyfJc5c9/PS8e1R348HFDdAQ== 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=g2Se2pQxcNMhA0FJ2uTjagYf/L5wMgw7IYmnuLV6n2M=; b=DS+n1zP1mMgebU8nAyhdQkbYPdJ4nmXeCkE61uQ1wO862ti6/lPx/a5IPhcmM1WSYpIXE0EmSwRUrLbNJ49xFt/VoIV1EKS2Snlbl14xldZJZBzYaRQWho0bORqOjnoKvjtjn9hLEvt5kUUdraaNMuZcF2TkxcaVf7Aaw8zQkwQ= 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 VE1PR04MB7245.eurprd04.prod.outlook.com (2603:10a6:800:1b1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul 2023 15:27:22 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c680:1128:9d53:24ae]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c680:1128:9d53:24ae%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023 15:27: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=20Maincent?= , 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 v8 net-next 00/12] Introduce ndo_hwtstamp_get() and ndo_hwtstamp_set() Date: Mon, 17 Jul 2023 18:26:57 +0300 Message-Id: <20230717152709.574773-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: VE1PR03CA0035.eurprd03.prod.outlook.com (2603:10a6:803:118::24) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VE1PR04MB7245:EE_ X-MS-Office365-Filtering-Correlation-Id: f9654a85-fba2-4198-3b04-08db86da5115 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1zqdtDKxRM6ynKZVRPOh+ClIc4Ke2FvSK0Kmy736GCVTzrM6QzN9J9yVfs7+FnQbF1Xfyckv9UKx92Jwkly8nbhfMYdXTWlp9UdNYtrk5I8w91+WcPnG2eqwUFYjVbKg3O1N35B/xiy9ylHaelZ46j0pjp0zPK3LwRoNhBGxQL6PnVg9Jv3MQccCq9yENI+bCDb6IOrIaQJGjdMyW/SwryDfqr2din9gUMUBEzHvjASg33l03czUxkEdlrW7hcVws4xiqe/tb8LhSkB7CzCQj6H3KjX0uQCy9MxtxArIxcKnQviw41J+3nyZYtdRYVqKYCTL46bMl3G5ksp7MDvskmLfwPws34UEgB4LRlFPz6TjtwrYgkehwSHK7SRNcneN21OgZGeuHXT4RX5BEZ/iXVlrSbAGrCywXFNBbqON1TwmEAo3iY/SOKvnJGtAgezN9p/sbkvH8UI8hKO/YGEQtd36Zt+XfC/FymE9ynNW599sxVeGf8zIuaQltuWOKpYvXsnBZ3/16d3eXnKg69uo/WqmpFBztzXQ9F4HwOsnIQTfTNJfaVtvP6H2a9Km2SG6jrJY5WyHEmEUWE/OPEI1+D4X+LTvyEtCwlZ0JpP69q0MGcrMRQvSFMNefhzbS2Ut71Mx9rO2INSjoch2pXs+1w== 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)(376002)(136003)(39860400002)(346002)(396003)(451199021)(2906002)(38100700002)(86362001)(6512007)(66574015)(83380400001)(2616005)(1076003)(186003)(26005)(6506007)(966005)(38350700002)(5660300002)(36756003)(8676002)(8936002)(7416002)(44832011)(7406005)(66556008)(478600001)(6486002)(54906003)(52116002)(6666004)(316002)(41300700001)(66476007)(6916009)(4326008)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZXhjZWphMHJnc1JwQnl3dld4WkRFY3JHc3dZKzZlN1dZL0xXQjNqZThzdnZv?= =?utf-8?B?T28zdWxadVVzT25PYW1tOFZrUXBXK2FZZHdaWm5LUGZuU3VRSFNYTkpmME1N?= =?utf-8?B?cURCQmk3cWJyRzJneEE2b0c5WnpGZHFObVNkM0d5SE1YYndIcGw4endPT1BD?= =?utf-8?B?MVR0RmFkTG9qdXQvUVgxRWJVSGUrVXIyeEJhcFZYNVBMeCtDcVcwbkFXSUpZ?= =?utf-8?B?RGpTNzRVclhWYlZsSzgzK1ljd0ViNCs0eS9zRGtvc0ZycndtQkZsTVJ3bTVQ?= =?utf-8?B?cEwwY2w0emp0ckJSc1NmT2NCOXJ5V3hnQ2k0Uy92L2s1QVNGZEVlbUtDVlUv?= =?utf-8?B?RHhuNVhtOHlIOVBtck5QelhSU0VPe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OWc9PQ==?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9654a85-fba2-4198-3b04-08db86da5115 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:27:22.6351 (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: qtrNZEPDSpt9SqLgmRNoh9HJX31em1yx8/ZU2h11bSUTW7Lpa6mdgvl8c0x+7yU4nxPToQ5VSiTBoKnZ/KO1Ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7245 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 (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 drivers/net/bonding/bond_main.c | 105 ++++++---- drivers/net/ethernet/freescale/fec.h | 6 +- drivers/net/ethernet/freescale/fec_main.c | 56 +++--- 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 ++- include/linux/net_tstamp.h | 30 +++ include/linux/netdevice.h | 25 +++ include/linux/phy.h | 7 + net/8021q/vlan_dev.c | 27 ++- net/core/dev_ioctl.c | 184 +++++++++++++++++- net/ethtool/common.c | 3 +- 20 files changed, 544 insertions(+), 210 deletions(-) -- 2.34.1