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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6C62C6FA99 for ; Sat, 4 Mar 2023 15:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbjCDPn5 (ORCPT ); Sat, 4 Mar 2023 10:43:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjCDPnz (ORCPT ); Sat, 4 Mar 2023 10:43:55 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CD27FF34; Sat, 4 Mar 2023 07:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=WlHItfDe2+GVbkKB85wB9pJreJVbUkzc7e8si1p2OT8=; b=qW fr/uZxICOV4UQXlqV2gON+WQQo6vX/Wo4LeMEYqkLSbrbllTHcA0+EaWnBDmIcTQexi1ybMemJyFz WwKQe4z6u0fdA+UDzRCYPJ0DOWeo2MnZqN2xpy3YKnIOfP7zYdjsT/efTT4DV36UAHygulzU9Namf fxjk7hWl/kW3268=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pYU31-006SBw-3w; Sat, 04 Mar 2023 16:43:47 +0100 Date: Sat, 4 Mar 2023 16:43:47 +0100 From: Andrew Lunn To: =?iso-8859-1?Q?K=F6ry?= Maincent Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-omap@vger.kernel.org, Michael Walle , Richard Cochran , thomas.petazzoni@bootlin.com, Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Joakim Zhang , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Grygorii Strashko , Heiner Kallweit , Russell King , Minghao Chi , Jie Wang , Guangbin Huang , Wolfram Sang , Wang Yufen , Alexandru Tachici , Oleksij Rempel Subject: Re: [PATCH v2 3/4] net: Let the active time stamping layer be selectable. Message-ID: <011d63c3-e3ff-4b67-8ab7-d39f541c7b31@lunn.ch> References: <20230303164248.499286-1-kory.maincent@bootlin.com> <20230303164248.499286-4-kory.maincent@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230303164248.499286-4-kory.maincent@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 03, 2023 at 05:42:40PM +0100, K?ry Maincent wrote: > From: Richard Cochran > > Make the sysfs knob writable, and add checks in the ioctl and time > stamping paths to respect the currently selected time stamping layer. Although it probably works, i think the ioctl code is ugly. I think it would be better to pull the IOCTL code into the PTP object interface. Add an ioctl member to struct ptp_clock_info. The PTP core can then directly call into the PTP object. You now have a rather odd semantic that calling the .ndo_eth_ioctl means operate on the MAC PTP. If you look at net_device_ops, i don't think any of the other members have this semantic. They all look at the netdev as a whole, and ask the netdev to do something, without caring what level it operates at. So a PTP ioctl should operate on 'the' PTP of the netdev, whichever that might be, MAC or PHY. Clearly, it is a bigger change, you need to touch every MAC driver with PTP support, but at the end, you have a cleaner architecture. Andrew