Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2587224rdg; Mon, 16 Oct 2023 08:44:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIVZR72TI1jmUW88+rvYJH3Por8KrMc8DtAxVXIiOyXQq27Y6q1Gjh1jYs7h4/nsKaIJgW X-Received: by 2002:a05:6a20:dd87:b0:15c:c381:f65e with SMTP id kw7-20020a056a20dd8700b0015cc381f65emr30146393pzb.34.1697471049430; Mon, 16 Oct 2023 08:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697471049; cv=none; d=google.com; s=arc-20160816; b=RApME5sNbggNs4ZFzZOvlTjHhM4jWuGi32aUQXXl4GPh0sfQ2SS2oRV8vwgdaOYL6v kMT3lTm9rIEwuXieyK+isVP6dPnZCGvafAguMpVat4M6brBCwj/Y/Bb2hQdqe8N4a8L4 xbBq0DouimJJzBNS/u09gk6KCYWV+YJDFLiGN2I5bY/KSvOs+7aDvDF2z+Dm1aWGDd05 RByOdi+YttbGxorw0cNlBhu8UPyro7qVFuYe4kNuNbIhh2iDuesvusuDPu2XmuEaUV7o JtfjrDKFlTTff2hEPOW4N1gH9jtCODbDzTby56zduOg5HfWi8n+3+kLQlzJWY1p/THMd udSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7BCKgPtULfryetGv3yAkVEMLcj6XU3eIVuA24LFPumQ=; fh=XxyL1YgQZIJ7RHzZjvuIj0NuuyJjUDOxO2YlN4b07X8=; b=XHYKhjrLBagdVAjkCY6m+JwcRioaPtdzcgEbGGEgkzui/eB0GvP/4obng7F2mFuwDs r8jfs3PxWbCxfCLqIiAvY61tZsp3jHp1xYA4pvQdylHDy8WAKTPK4hiDU4sTHwcaZlrZ 4YUnrFGIhEznEPHmYW1JfPXYmq6pXraR/0byaqMEUt2RxJY+myw9sm8qd6Q7Pk2HW2Oj STmw8AISHZyvSOp/E0iRJJiFQuz5W/hGfF4N/ghiOFJOwM8gcnHZuqVlTePazRPlcanA JTv4NlUSv2ln2Kx6TfN0cnbObZZnWY3TLui9tE+Hh0bPFWrRjq1IE0fNK2OfmAIP41B2 Thbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dIxqsPs7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d13-20020a170902c18d00b001c76a06b5b5si10649515pld.298.2023.10.16.08.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:44:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dIxqsPs7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EA85180B2859; Mon, 16 Oct 2023 08:44:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbjJPPn5 (ORCPT + 99 others); Mon, 16 Oct 2023 11:43:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233804AbjJPPnw (ORCPT ); Mon, 16 Oct 2023 11:43:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEB54FC for ; Mon, 16 Oct 2023 08:43:48 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40323C433C8; Mon, 16 Oct 2023 15:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697471028; bh=KflpWEqX7L8WyrGy1c91r65GrP/uvGSP3yrFJnPap1Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dIxqsPs7/I47MoMm8sZ5jmn5lqUcuYDCCam58k6Xtn/xVKVpV5IAvJcgFjRl1Ba1T PvKET3E6toxxkP02X1pJubkAfVn9JveoKAD7w/e43vsm103/dCTifZu5g/2lzlA8Y9 CIk7z755isPQu7huNSuEgc/TtcgNAu1sx0dxEihs8yUmYvPRm/78FNJRxO/HGRBSYi xoHvXIiEPAQLR9eT5g5dJn9JRGSSZKKhneipjT8IQ3CbIpS2kQydF9VKwlhcxhYuRd WJervn19g9gGFo3Q7vcbkIJm3EVg7IWLFhcw22qtucwUDjltvaJKKvblFJf2sffItc 19qlXJSfXVcXQ== Date: Mon, 16 Oct 2023 08:43:46 -0700 From: Jakub Kicinski To: =?UTF-8?B?S8O2cnk=?= Maincent Cc: Andrew Lunn , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Thomas Petazzoni , "David S . Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Horatiu Vultur , UNGLinuxDriver@microchip.com, Broadcom internal kernel review list , Heiner Kallweit , Russell King , Richard Cochran , Radu Pirea , Willem de Bruijn , Vladimir Oltean , Michael Walle , Jacob Keller , Maxime Chevallier Subject: Re: [PATCH net-next v5 08/16] net: ethtool: Add a command to expose current time stamping layer Message-ID: <20231016084346.10764b4a@kernel.org> In-Reply-To: <20231016170027.42806cb7@kmaincent-XPS-13-7390> References: <20231009155138.86458-1-kory.maincent@bootlin.com> <20231009155138.86458-9-kory.maincent@bootlin.com> <2fbde275-e60b-473d-8488-8f0aa637c294@broadcom.com> <20231010102343.3529e4a7@kmaincent-XPS-13-7390> <20231013090020.34e9f125@kernel.org> <6ef6418d-6e63-49bd-bcc1-cdc6eb0da2d5@lunn.ch> <20231016124134.6b271f07@kmaincent-XPS-13-7390> <20231016072204.1cb41eab@kernel.org> <20231016170027.42806cb7@kmaincent-XPS-13-7390> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:44:06 -0700 (PDT) On Mon, 16 Oct 2023 17:00:27 +0200 K=C3=B6ry Maincent wrote: > On Mon, 16 Oct 2023 07:22:04 -0700 > Jakub Kicinski wrote: > > > This is the main reason I changed this. This is Linux implementation > > > purpose to know whether it should go through netdev or phylib, and th= en > > > each of these drivers could use other timestamps which are hardware > > > related. =20 > >=20 > > For an integrated design there's 90% chance the stamping is done=20 > > by the MAC. Even if it isn't there's no difference between PHY > > and MAC in terms of quality. =20 >=20 > Ok, but there might be quality difference in case of several timestamp > configuration done in the MAC. Like the timestamping precision vs frequen= cy > precision. In that case how ethtool would tell the driver to switch betwe= en > them? What's the reason for timestamp precision differences? My understanding so far was the the differences come from: 1. different stamping device (i.e. separate "piece of silicon", accessed over a different bus, with different PHC etc.) 2. different stamping point (MAC vs DMA) I don't think any "integrated" device would support stamps which differ under category 1. > My solution could work for this case by simply adding new values to the e= num: >=20 > enum { > NETDEV_TIMESTAMPING =3D (1 << 0), > PHYLIB_TIMESTAMPING =3D (1 << 1), > MAC_TS_PRECISION =3D (1 << 2)|(1 << 0), > MAC_FREQ_PRECISION =3D (2 << 2)|(1 << 0), > } >=20 > Automatically Linux will go through the netdev implementation and could p= ass > the enum value to the netdev driver. We can add multiple fields to netlink. Why use the magic encoding? > > But there is a big difference between MAC/PHY and DMA which would > > both fall under NETDEV? =20 >=20 > Currently there is no DMA timestamping support right? Kinda. Some devices pass DMA stamps as "HW stamps", and pretend they are "good enough". But yes, there's no distinction at API level. > And I suppose it fill fall under the net device management? Yes. > In that case we will have MAC and DMA under netdev and PHY under phylib a= nd > we won't have to do anything more than this timestamping management patch= :=20 > https://lore.kernel.org/netdev/20231009155138.86458-14-kory.maincent@boot= lin.com/ Maybe we should start with a doc describing what APIs are at play, what questions they answer, and what hard use cases we have. I'm not opposed to the ethool API reporting just the differences from my point 1. (in the first paragraph). But then we shouldn't call that "layer", IMO, but device or source or such.