Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1234740rdb; Mon, 19 Feb 2024 08:20:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrEbTSWxUwEEFrwZBer/dFBjh21KkHwcY2CqCFJ93NsQJcszjRYisHYadSWGmf/DnBCINfhGC4iXLwgIRHVMU5QbppQuiVKS64mI2WRw== X-Google-Smtp-Source: AGHT+IEunSNHBLNXDHH7YfP3fBZxIS2RP66i8yBaDeC7JHaVXQoifeXPHOh65hriUVILhJvMFuQw X-Received: by 2002:a05:6a20:7051:b0:19e:48b6:9c43 with SMTP id i17-20020a056a20705100b0019e48b69c43mr9182600pza.58.1708359645449; Mon, 19 Feb 2024 08:20:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708359645; cv=pass; d=google.com; s=arc-20160816; b=eG77QkyIGVEVjO5DifC4T2v5d45BQwTCNih7lOjFC9t1u9isvrRwIT7VF2VOKb5VE3 NMi6yrlzLRh69bXiOgnytSOge8gTF/Bo4PM3+mXdDM6ou8+b+SesOcwiGgRsEEyNm8oK YNW/GRM4alMvKI/iLdUgpmsn6owQ3CBsF+iNZ7hyO7iw1FLm/LNX1rss2R00cIKyWaRI GAMOG6s1rWBOk1xdoC8YJYgRC25mm1S5zT6NQGAiD5vtYjeVbqbiGlQ+mpXdhbZmhtr6 NssnWyy0Ee87MWevOw2B/oEFNWFP5Kv6QFI9vivgZ3vEda3gvwbguTv6C9vNDmR9YzEW bhpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m2nD4Vwza+aDllTk70i73HnQsiQ53xBK6QE6s2gWwMY=; fh=krnmxPTqUOGNvezv4aDCzn3fVt/0iawTPyRMcGaOtLE=; b=J+K8WVRrttvayF1D/ss+q/50xWl1R7aUtmWpmUOQslRw7E5Zz1eHuK74mROE4Fm7GI 9voLfgbgvP3Qr67r00liM97QGXL2Z+RAyA6LdJDqYEm1AY3INc+qZqBchxsksMLJ4oN5 /kAS3QWZzSBi3x05nhEwvZZUy3b63XzEV4LbiphvWsd+dZ+S0GClecAI9uqgn4PI1ZYL UOTIisXKhYs2rY1GMeQD0SxuDqxZdXM388T46W2wGqC2Brz9/CG3rrFiWmvjH/ziWsnA gu0RiYvDe3XfnnRNtQMKY1rXBBymTNRAwx8wWgP08Ti1i5tFbfZib/KsBAdFvw718J8E HLFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=UtWtc1GB; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-71649-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cp11-20020a056a00348b00b006e3f7e38f78si3177083pfb.59.2024.02.19.08.20.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 08:20:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71649-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=UtWtc1GB; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-71649-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B92B9286ACA for ; Mon, 19 Feb 2024 16:12:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C84F53C49D; Mon, 19 Feb 2024 16:12:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="UtWtc1GB" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 0AD8438F96; Mon, 19 Feb 2024 16:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708359124; cv=none; b=JJOdlN9+QCbtjuS2M29xu+pvzdJHcIG7lgrVOiJ6WPeMP7svewbtGcx3fuISBy/yiC4KGZoWAdP7Nj1y99QbtfZ17tcFhP8/MnKoOsvitdhjyHVyj5FmONrA2Go3yktFEwIRCJgwlFvH0lOR8NeXiWhqMR0TtUiJprPsUaGgAwY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708359124; c=relaxed/simple; bh=iq6s+7WKZLZSrLV/9jdqYXS3RZE6PFmDztuMLteg06E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KjysTuDy0QDM7mqbOEbLWfDGMvlNwp8f9SEdrhkjlRvTHW9gQx+8DjRt/1q1uu5c1l5IzvQWiK10o9NfjH8s0XgREfnadPWHWdqAAj304rCqCeGv+poDsha6Iria2jqkW/W29zm+NlcW3xXjo9rXM2R8dCCbpm6zMh0TJ0T//m0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=UtWtc1GB; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m2nD4Vwza+aDllTk70i73HnQsiQ53xBK6QE6s2gWwMY=; b=UtWtc1GBcTmeW9Sgii2wiouPQc 4gEhMxxwzplTX9PRgnnwprVsPBi6GkUOY05K3a+jS24JnB3DvLoSSgLyNj0rlSl1IZWqPT2DpnysI zPV6mUG5Rvw2XJ7qv7+QQyF3hKN3bOCcCWEQ66cqG5CpPOMae7xjLNSZgKv0vAQi+mqw0tGThFxSs LudSLJh9EuSUUmlQ5kQpZPxFn6LD/iEPzr09MvzUZ5e6zsPUQZfEfStUvqgVoKJJHuV5MmY4+nax8 m1e4Re3VoEgATz6u8YIr3QCb4vJyTHptI+TLOWxXh/X2B2La17dWFuU7V+zPm7DW5nTJLuhOnaQeF Pd2gmp4A==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51960) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rc6El-0007Kt-2a; Mon, 19 Feb 2024 16:11:23 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rc6Ee-0008V0-Sj; Mon, 19 Feb 2024 16:11:16 +0000 Date: Mon, 19 Feb 2024 16:11:16 +0000 From: "Russell King (Oracle)" To: =?iso-8859-1?Q?K=F6ry?= Maincent 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: 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> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240219142936.62112d34@kmaincent-XPS-13-7390> Sender: Russell King (Oracle) On Mon, Feb 19, 2024 at 02:29:36PM +0100, K?ry Maincent wrote: > On Fri, 16 Feb 2024 10:09:36 -0800 > Rahul Rameshbabu wrote: > > > On Fri, 16 Feb, 2024 16:52:22 +0100 Kory Maincent > > wrote: > > > Change the API to select MAC default time stamping instead of the PHY. > > > 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 specially for PTP case but > > > these devices are not very widespread. For not breaking the compatibility > > > default_timestamp flag has been introduced in phy_device that is set by > > > the phy driver to know we are using the old API behavior. > > > > > > Signed-off-by: Kory Maincent > > > --- > > > > 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 even > > 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. > > This patch comes from a request from Russell due to incompatibility between MAC > and PHY timestamping when both were supported. > https://lore.kernel.org/netdev/Y%2F4DZIDm1d74MuFJ@shell.armlinux.org.uk/ > > 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/ > > 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 necessary > anymore. > > Russell any thought about it? 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. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!