Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1840683rdb; Tue, 20 Feb 2024 08:27:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVmwjX9XvZ9q7cy7eLRo5NUkhgmPoJ03qkliRlWrS6QFQxwI5RjF/u7kMVdD6veCaL7V6+mwDXKhuk5KSfH2n+p7F51FeD6jr5m9wZjMg== X-Google-Smtp-Source: AGHT+IHBeKQpnWhlLuv2GCy++A15U9kkFOkGpQlog/knmsqWMa+0Dr0jBUKAZtOSafgdK4DH+ygL X-Received: by 2002:a17:902:780e:b0:1d9:6009:c23d with SMTP id p14-20020a170902780e00b001d96009c23dmr12133223pll.54.1708446464636; Tue, 20 Feb 2024 08:27:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708446464; cv=pass; d=google.com; s=arc-20160816; b=h6dwogSFMm0Dx9J6BSFONBgiPWIlNFgXvqI5TW099xI2GMpvMtGJCMZUlSy+8+I0OC hMElx3ZU19i6uk+C7j3dqSSAMto08GGiibQ2dPAObX4BigCdkltDoBXljQI3QIiDFN+b RNJvqvgkC2+6juqSYhQTFk5Tm9q+MrmIQYeFlbbtCgABZY/4aizj7rpu1sMM0lfN4zJY BZv9g7FUb7UqWSspO7/JhmYYP57wToxUWaNR7CuFFtf6l4l+aqGA7RldxOVcJeeHKCQ1 5NfV5q84+m48q5dybeIDbJ0Q6KM5NRrCvBOfCB8lVzWWALEpiCwtkbZhiNU64mpF0X2Y 49+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=pXos02wI1NevLoKIn6UfDZ/DT2LVCxm0HsQrNIoS9qw=; fh=ZsYBgPsjTWmZe3eQpxcfmhG4JkCcL8QGraDArL9NQck=; b=xCEoHQPqE8gxkLnA3GF7TwlBbF0Gw3rCpqK0jucdytn5qQvpLKfgbk5uX/l64jsK1U tL4Yr9o6l7rA7V/3K5oA66Xt5Sqp/Xo5iJOoLUSfXItjB8BexSkQN8uGKeyvq4oywdiT gYMiwfByDQdE96OSemOMaeZcbU7A+GL+Gh6Kjyni2GEP/0fquD1xKj78CcuUOMT2Baer UD8wNQODAFvoUD33ZSQly0EW8EZz2hkyWlaUIvTcJt5dnXYCXS3bcLfm9KTKIWPcOB0j 0F6l0IfeI/YDO0tFYJjRPKsAGF/0texCuXHvT6AJcglAytCOqyZXlLxMECvA5Q57WjPe uAVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QIRKyTj8; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-73336-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o9-20020a170902d4c900b001db80f8fbefsi6404943plg.526.2024.02.20.08.27.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 08:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73336-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QIRKyTj8; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-73336-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 91621B23998 for ; Tue, 20 Feb 2024 16:23:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25EE47995D; Tue, 20 Feb 2024 16:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QIRKyTj8" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 C5FDE76408; Tue, 20 Feb 2024 16:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708446040; cv=none; b=GomqaNvUapRm6vccni10ZzboKHZ2ABZXw33YY8bb2rbt2RFRLNtMjz6pDF44AMMiNKxSGsp5QYdp6LYSUSOTuoOK1JoXE7eaZQKDzrEvte8BGZbftPJKYCNoQkOTOpxb7FIirbpJWFNpfeHR6hW5GujHuZkzjnm5b5wARA0IelM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708446040; c=relaxed/simple; bh=8YQv7aLTPzzKaJ7jlQ5Sre4GQB/b020Pt6fSgtcM+TE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HGjOrXBGhdwMo5p4715CRlUoPoRVED6XpHlPnfAC2QYeVDaE6Q5G3KJ5kSJDEiqwfAYLKqm2nzdNJpFcUbaYxxQ4CwP9GVEiLhdZlvIT097MqBJWU74xuYAAhzg/qhMqxtwe9RZC3Rd5xmq+C7kgHnDEJTgrwAIM5xHITiIcGdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QIRKyTj8; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 02E04240004; Tue, 20 Feb 2024 16:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708446035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pXos02wI1NevLoKIn6UfDZ/DT2LVCxm0HsQrNIoS9qw=; b=QIRKyTj8c5fpAGiYJiASyDw9WoF4XtF3FZAOmveqKKYIkasIzidfU3JLHPT8/T0CCqli53 s5q+RtSlnAko+igLmKgeVSTe1InW/gAuXXU6osKRWw1D7zjFLjZHBCsaYtt9+iiS2RFNkc XDKrd29uZEvN5CINymsS4Zn1pCw6dvf4VEEW4od3YFhqEvnJdoY62vYj9KMssIr2j5Q0VC NLn6VW/lc6vmI0E+Q3QLLYHwztna+ZFZZ5xVZu3W6WRINwqrbiZcyt94wPc9OIGpg/Qgqk JLLZ0DGExukFlycsPkRXfSLuH+CuGkTrEhhBx0F5FwkovvFw9jfH21NzYhyOUg== Date: Tue, 20 Feb 2024 17:20:33 +0100 From: =?UTF-8?B?S8O2cnk=?= Maincent To: "Russell King (Oracle)" Cc: Rahul Rameshbabu , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier Subject: Re: [PATCH RFC net-next v8 04/13] net: Change the API of PHY default timestamp to MAC Message-ID: <20240220172033.556f321f@kmaincent-XPS-13-7390> In-Reply-To: References: <20240216-feature_ptp_netnext-v8-0-510f42f444fb@bootlin.com> <20240216-feature_ptp_netnext-v8-4-510f42f444fb@bootlin.com> <87jzn4gtlv.fsf@nvidia.com> <20240219142936.62112d34@kmaincent-XPS-13-7390> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com On Mon, 19 Feb 2024 16:11:16 +0000 "Russell King (Oracle)" wrote: > On Mon, Feb 19, 2024 at 02:29:36PM +0100, K=C3=B6ry Maincent wrote: > > On Fri, 16 Feb 2024 10:09:36 -0800 > > Rahul Rameshbabu wrote: > > =20 > > > On Fri, 16 Feb, 2024 16:52:22 +0100 Kory Maincent > > > wrote: =20 > > > > Change the API to select MAC default time stamping instead of the P= HY. > > > > Indeed the PHY is closer to the wire therefore theoretically it has= less > > > > delay than the MAC timestamping but the reality is different. Due to > > > > lower time stamping clock frequency, latency in the MDIO bus and no= PHC > > > > hardware synchronization between different PHY, the PHY PTP is often > > > > less precise than the MAC. The exception is for PHY designed specia= lly > > > > for PTP case but these devices are not very widespread. For not > > > > breaking the compatibility default_timestamp flag has been introduc= ed > > > > in phy_device that is set by the phy driver to know we are using the > > > > old API behavior. > > > > > > > > Signed-off-by: Kory Maincent > > > > --- =20 > > >=20 > > > Overall, I agree with the motivation and reasoning behind the patch. = It > > > takes dedicated effort to build a good phy timestamping mechanism, so > > > this approach is good. I do have a question though. In this patch if = we > > > set the phy as the default timestamp mechanism, does that mean for ev= en > > > non-PTP applications, the phy will be used for timestamping when > > > hardware timestamping is enabled? If so, I think this might need some > > > thought because there are timing applications in general when a > > > timestamp closest to the MAC layer would be best. =20 > >=20 > > This patch comes from a request from Russell due to incompatibility bet= ween > > MAC and PHY timestamping when both were supported. > > https://lore.kernel.org/netdev/Y%2F4DZIDm1d74MuFJ@shell.armlinux.org.uk/ > >=20 > > His point was adding PTP support to a PHY driver would select timestamp > > from it by default even if we had a better timestamp with the MAC which= is > > often the case. This is an unwanted behavior. > > https://lore.kernel.org/netdev/Y%2F6Cxf6EAAg22GOL@shell.armlinux.org.uk/ > >=20 > > In fact, with the new support of NDOs hwtstamp and the > > dev_get/set_hwtstamp_phylib functions, alongside this series which make > > timestamp selectable, changing the default timestamp may be not necessa= ry > > anymore. > >=20 > > Russell any thought about it? =20 >=20 > My position remains: in the case of Marvell PP2 network driver with a > Marvell PHY, when we add PTP support for the Marvell PHYs (I have > patches for it for years) then we must _not_ regress the existing > setup where the PP2 timestamps are the default. Yes, that's what I thought. About the Marvell PHYs PTP support I have a few fixes on it, but we will talk about it when this series gets merged. Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com