From patchwork Tue May 18 09:54:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Markus_Bl=C3=B6chl?= X-Patchwork-Id: 441705 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=-15.8 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 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 41B0AC433B4 for ; Tue, 18 May 2021 09:54:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AAD6610A1 for ; Tue, 18 May 2021 09:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347821AbhERJzf (ORCPT ); Tue, 18 May 2021 05:55:35 -0400 Received: from mail-vi1eur05on2079.outbound.protection.outlook.com ([40.107.21.79]:13665 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241006AbhERJzd (ORCPT ); Tue, 18 May 2021 05:55:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bzty9kL/qPu4vYKLcHGc1UCpGHFoD7D5pxcCCMU7JKWoqm8JvOyl4kQPHUWnJ8jzr6TOVHQyHvWxd5bZKhPn1PbYMxBr0tyybSiWhgfforlpEQNPwmjj2+tBE7Uwt4jNROBTTwMVCFlw7Af65+GIsw6lt1issFc9tZmcRCRiPVPuDefROg15YVsoAwePhZHvoNE5mX5RpOBjv78FjJ2hfQKj1xfutUx1lzOQ+Dp8jb6mhPcTUVUvgfhp1tOP2wZJr5//q9x2INN2XkEJYPDoSYNjA8WAXs5PUVfJ+XPNOGaCH3HZuB9m3omwRe2OYzZW7YqDeIcI6i1PxiovUt609Q== 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=dHV1G0arD6LNHZBH9aCDSe2Lty9O7IIiW6TGq6igs4A=; b=iw43MsFFhaK0ZQw4DfMaNRkfuWU0v0/jJs38OA/Tjgxdwc3PNUUnM4qDsH0qO7DpiX3mIBX1Au4vX/dWMnG6TrAnS1GfIXQG8PJfPvctjP5nRDsGmfTP+JAlgnCXCTjhGy9sVmMTuJZ7Tf7dp5CyLzV94xfcTEFFdimvCWu3qsCFNA84CXjVYFYX5SV9ZKkrgZBmZRZi9vvWCb1gvZbWGTRwppVPnjb04zI6lJHMRY9LFIxnKEm0GRZfaVNQIhc5yi1s9lx6gtO1eBLMKjeouST3NirxHiG72UJdyhokgZroWEVad2866BQ44Kz319XXeTWDa9noU8x0FgenIkaBMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ipetronik.com; dmarc=pass action=none header.from=ipetronik.com; dkim=pass header.d=ipetronik.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipetronik.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dHV1G0arD6LNHZBH9aCDSe2Lty9O7IIiW6TGq6igs4A=; b=OuMoqq1w581NgPjd95TjWszuQjwbeutqhsyt1BaDZH/FdfO3xSwCiPcfJ0d3QwI7SfVeH69Cy3BDSsOqrKdcLSZIpAZ5d/lxPLx975uwgwAo6ZA0sxcnl8UrKhiz5OMjuJZtbzauOmR1Hj9nKrFsGfePziLSmnqRpeJqU1nq4ikjmb+rco3avBS8ihAnxK4YnnjDA+R9HE8Qn5ObyRbhKEbpAe1UhdZok5alMMnbSB9Nxk59pSFYub/Bk+C9xJ5Goij3B+Kk+rhgVm9K6cX1SOQ0OqkfFXs6AmtbsOimkTefaSlbAaTSI77HoEDlKg5jfc3FSENwjV19Hoakq+DDJA== Authentication-Results: microchip.com; dkim=none (message not signed) header.d=none;microchip.com; dmarc=none action=none header.from=ipetronik.com; Received: from AM9P193MB1572.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:307::12) by AM8P193MB0980.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:1c9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Tue, 18 May 2021 09:54:14 +0000 Received: from AM9P193MB1572.EURP193.PROD.OUTLOOK.COM ([fe80::61dd:f44:3cc1:6126]) by AM9P193MB1572.EURP193.PROD.OUTLOOK.COM ([fe80::61dd:f44:3cc1:6126%7]) with mapi id 15.20.4129.032; Tue, 18 May 2021 09:54:14 +0000 Date: Tue, 18 May 2021 11:54:11 +0200 From: Markus Bloechl To: Woojung Huh , Jakub Kicinski , "David S. Miller" Cc: UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, markus@blochl.de Subject: [PATCH net] net: lan78xx: advertise tx software timestamping support Message-ID: <20210511161300.3zsn4ufutgwzvst2@ipetronik.com> Content-Disposition: inline X-Originating-IP: [2001:16b8:2d18:e300:228:f8ff:feed:2952] X-ClientProxiedBy: AM3PR03CA0065.eurprd03.prod.outlook.com (2603:10a6:207:5::23) To AM9P193MB1572.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:307::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ipetronik.com (2001:16b8:2d18:e300:228:f8ff:feed:2952) by AM3PR03CA0065.eurprd03.prod.outlook.com (2603:10a6:207:5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.32 via Frontend Transport; Tue, 18 May 2021 09:54:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8802749-715f-458e-22ae-08d919e2e4c2 X-MS-TrafficTypeDiagnostic: AM8P193MB0980: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zifY0FZOdE9atCWVwZRZYTpPHvfWfSXU9rz4yoqaVndu17hjs0CjhEcrzKj607gQFx3elPeSCplytu3IG554SnQ81IE12tGrdkCSFj5W1ikXRUtFVpK/aL8rnOvpaQVW5Pq+WJCxRd6STvG3dzkBvOh3i1ZPUr4HFLdCy7nL48D3NNkcjQYoROc5T7N3Myq5/mVCUHQfYOihE4C+gOcplZnVrPuPSXAIg9MCg3lEiZ8hbJ0enlm2SBh75YSAeo2CYTNf9xv/58zy7UVm5PwDI05r7EZCDbcFWlChCM5BsmWtpxu7RkEh8qOqKDTVLAiv5F9Vmv/avNLlXNRAg3U7B+V16qdXfn/w12zx8axD6b0ZZDk2KU7vny7rSuY/yYkf9Gz94mo3lOxyKkBo/L4vUWSaGXoA2rUHw3ZkYm0D7DNL/JF3ZRt58joihzwpwfpgFzeL3hQ0vPOriKs5MHNod9EUXjKTRdM4OBbhy75icj8OQ/Hgqi21kNbQ/UU7SNN8Yz/nlwjaHeWGIQDwhzn6TaESuaA/zVqqtj6w1qJzBtl92pNm5Pg6sc0I39Q+w4aHUPzIUyt3/Rf+OABqEzw6/RuXlmm7y1XmvGaTvXrk6Hc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9P193MB1572.EURP193.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(366004)(396003)(39830400003)(136003)(376002)(346002)(5660300002)(38100700002)(16526019)(86362001)(36756003)(2906002)(55016002)(2616005)(8936002)(8676002)(8886007)(66946007)(66476007)(66556008)(7696005)(52116002)(1076003)(186003)(478600001)(110136005)(316002)(4326008)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?W9ta8MRbKOSIoRRuZltqalmWUk6?= =?utf-8?q?kLd9OJ8ZcASJ4jdtZUpMty/NkVnAn+qADrEF/xtvSwQD2RWpYTgCpNzL?= =?utf-8?q?D7gtzfc8fZsEgS720AVEzWnQ9r9EVzNjXXIfaxXo+VE9fA1wYtlBeEpe?= =?utf-8?q?OCtN3ZRRun9gsUZg9M29VH6ZQZ287kuE18pBHaqNKiEGxgrBd47CGYSP?= =?utf-8?q?al261xKcgv+1K+C1gU9qzsFhORXCtVJ0ouDAWkw0vLtrDwzVBhUukysa?= =?utf-8?q?b5h45baXMmOM5njHqoHhKx4TLWSwEKFH2n6+UlQrBEsXg85Uiz8W3HF0?= =?utf-8?q?Q+MbrqGl7Q9B5PJcpV6qV5BJiFENGdzRIaNwsd9vHMZRFaR8j/4hCxa4?= =?utf-8?q?w1RXFVJhfYZ1bgh+R3d7iu9G7Uwr77wENPO5sYF5ougANV1GOVwBLc/1?= =?utf-8?q?YdqMZxnuGtY1IU+gnu3CIXTpjbSPh1uIaNNc8ONPUelPSEee1HqdY/g8?= =?utf-8?q?AOGdEd9KlyGEtx3GqD9FxJqGny3hq7J0lM79DFvoFYd6j7M48sJygEYy?= =?utf-8?q?FO0NfL5OPt7xMWgnpR1Xp3T6A9GJIjDdZS3V60IEyjQQENf3JmuEM7d/?= =?utf-8?q?CtYgv2R2NcKahxJBXheW/zo4ICACiCbRlV74tZU+fhfnLK7hT20G8+6S?= =?utf-8?q?i3ZojYsRtqOqvb3vKbiJWVYPDfiY93INC6BEnprZFK5zCP9wDB5h9t85?= =?utf-8?q?XIj7nCXq9wVJKOX4ZL/Wdhtb23CHx2rAdliu/ppaqp5BaE1lK6W9vlSw?= =?utf-8?q?my2v+ljRRKXzYAWbbDmAjARH7gC18wCF/at6i0dg9g02rOg+UfgPbUFU?= =?utf-8?q?h0VI5Np7VKNr1MIC2TTz3qlZMhD416vLdniI+nLX5SbQewAkCuljFgV4?= =?utf-8?q?zis8JbqNC5bxG3hq9Wd7heQU+OZLkdsO/3scC7GOftkxB/RZM2W92ku2?= =?utf-8?q?MKUUPFruuWW1epU5fXT7L3xaKVgj5Xj6Awd0J7/0F4p2BWJs+jiQd/PD?= =?utf-8?q?I7JuR1F02NlR6tO5Kj6RkEnIcnwIE8+2CEtGm3nilyvTaUukUFyY67Gi?= =?utf-8?q?CrOzgZ2uFFu+JENits4P/SiiTaTilmVSYg2OvWpVTvSnHjeDVLg/CCb8?= =?utf-8?q?NgpThoa0X1S6Zw3Y+sFRktg0wOPsDP+/eHScpxecVxMktGmvygLzYJkP?= =?utf-8?q?unH9VwNrSHHl0eScWffstP3ck3U3K++VjjqpxmD0lHLf4xr9um6CX19t?= =?utf-8?q?ZD+tIijXlyME5j6MHouUVlobKZvHlGdH7P1HZdG+Rej8uR24/mNHnI+h?= =?utf-8?q?eKUsDkbBCds58kq6xyd2qQwTeVMF6/uT9Fpe11ZrnYshSa4k+zgf0x0f?= =?utf-8?q?+Jtz+Hb1XsP3zCLHrgb6egx0im119f5lrVd+6pn+VT9xyMh0qzaIT3sw?= =?utf-8?q?m5lTlhvsMlaWzfQQSNtjb/2/7fXkg9jhlGIDi?= X-OriginatorOrg: ipetronik.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8802749-715f-458e-22ae-08d919e2e4c2 X-MS-Exchange-CrossTenant-AuthSource: AM9P193MB1572.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2021 09:54:14.1633 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 982fe058-7d80-4936-bdfa-9bed4f9ae127 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gdPtC87PxxqnnkOQLK7bUKxmThdgIMa0AtLMlrvFh6s8yMSejbZA7Lvm7fmbxUQPVhxDrqy8nhvrs8Zmk4fjmNr+u0wNAIgGJBfjwSaO2tg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P193MB0980 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org lan78xx already calls skb_tx_timestamp() in its lan78xx_start_xmit(). Override .get_ts_info to also advertise this capability (SOF_TIMESTAMPING_TX_SOFTWARE) via ethtool. Signed-off-by: Markus Blöchl --- Notes: The main motivation for this patch was that e.g. linuxptp refuses to start if the driver lacks support for the required timestamping features. I also recognized that many usb ethernet drivers which use the usbnet infrastructure do not override .get_ts_info accordingly, despite calling skb_tx_timestamp() indirectly in their .ndo_start_xmit handler via usbnet_start_xmit(). For most of them the .get_ts_info override from usbnet is lost when they override .ethtool_ops again. Should they all receive a similar patch? drivers/net/usb/lan78xx.c | 1 + 1 file changed, 1 insertion(+) base-commit: a6f8ee58a8e35f7e4380a5efce312e2a5bc27497 diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 6acc5e904518..02bce40a67e5 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1645,6 +1645,7 @@ static const struct ethtool_ops lan78xx_ethtool_ops = { .get_strings = lan78xx_get_strings, .get_wol = lan78xx_get_wol, .set_wol = lan78xx_set_wol, + .get_ts_info = ethtool_op_get_ts_info, .get_eee = lan78xx_get_eee, .set_eee = lan78xx_set_eee, .get_pauseparam = lan78xx_get_pause,