Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1120387rdg; Fri, 13 Oct 2023 10:46:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBEKSHKGD27PuA0o0XaVel+QmGHe6ZT/BV9JXRxVOXCtIKxAqtYdGE99mn2t9OPwdkFYq+ X-Received: by 2002:a05:6808:29a:b0:3a7:39f6:3f2c with SMTP id z26-20020a056808029a00b003a739f63f2cmr30782141oic.55.1697219181368; Fri, 13 Oct 2023 10:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697219181; cv=none; d=google.com; s=arc-20160816; b=GjlIvfGtS8ANu2adeNBDJpM5Lpd+WixHBliz9+186D062BCpn/6BAzTb2dNyzqPHdB dZJvjyaWItf2SOhK4UgmEIaYPWEJonZk4mj2R/Vq4lSqMMCXM+e2fDO5lxvjQxLDZ3Of OjDaXzh2w4Gi1C7h3+O82wmsOF+qxccNxgWlN4PQeQGKOuorEAFjSG0ykZZpW2su5Ik7 dcoVOs7LC8+fEAgMflCziP8QK13YVrqjpWDsTcYNcq4gmnn/VUmei2ZhBOdp3Jv9yFG5 80pq7NgTRr+f6gPkjQkC4wG4p3ThKbpbEFtj8ibnQyAIz81jrcoTa0GYlCk2HP+p+nEl 1Z2g== 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=ZaBV/TTFSzr2Flb4bGClLaVYKdsfktcZ7ea8bqdrz1I=; fh=iA9bTnpmaYLoKcvpe/HYYvQwIKjzaXwIG4hFcJy8kWY=; b=E6CVRKWSqnpF8M7g56TkFkUdb7Gt1ZMAxQrcZ9WUAbY9jl1Rd4L0o56v4ZpNVdRzB1 FXYEUmBLsaA87mxd3AWmH5uh3Nt3Q/ya7B5SLpgK91ibF+RkQlvpWLLCClEsR2Sae3fw vEZ/l2tIWgiNiaVpkwcBM+NLeXM/wCUqkiWK/zO37lqbpifBwZr1zwlwu0V+bnWas52H Y/4wbz9V42/3iclakgRS8WEZ6+BW4kp0JI+anYmh2Yjr+ybg/UmAct//4Fe14BfywCVN 783gMWqEULE7HxwD2kKr+AL6SVn5JhrICN2WbFY3swUZVaYvB5TIvsGDCy4leEcZU/2M +6ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j4wUI0Iz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q6-20020a056a00150600b0065b4e2b52c5si6543360pfu.196.2023.10.13.10.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 10:46:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j4wUI0Iz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id C393782ACAF2; Fri, 13 Oct 2023 10:46:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjJMRqM (ORCPT + 99 others); Fri, 13 Oct 2023 13:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjJMRqK (ORCPT ); Fri, 13 Oct 2023 13:46:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3FED83 for ; Fri, 13 Oct 2023 10:46:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58DDFC433C9; Fri, 13 Oct 2023 17:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697219168; bh=LnnOZq9IcCexCgRtAyz56/PMKVOuCg7VAzCjooDMXH8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=j4wUI0Iz9/RmzVEvQtad7WVexCb03+TqC9xzaQ3JNoXL+VhSRjEFe7yiqD1HUxyW5 txuxZ9F3GR08ik6Yt7z1gESAPpXwZ9080tI5Ch1KjdWoZvZQ3lpkcgjocqoM+6OJ3L rufidlqsYGr7RQnIJUBL+6RzxcV3XY9cfOd6KTj2qksXlY90kyd8X0A+/vpf6+T9rL OaWxf/c0BPtMAeioRjxzrDyvFo5Q/ovpCQdupU5IEg8U3iGt2P1fTWKDQm2scvy3ry rRWhQK3NfK9jGCJ2xBFYgqyKtDKRY6dNYiY6//UuLzeYDdUc7M+N7HOY1bGu0ZSqVc mKuFoK0FdG2Hw== Date: Fri, 13 Oct 2023 10:46:06 -0700 From: Jakub Kicinski To: Vladimir Oltean Cc: =?UTF-8?B?S8O2cnk=?= Maincent , 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 , Andrew Lunn , Heiner Kallweit , Russell King , Richard Cochran , Radu Pirea , Willem de Bruijn , 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: <20231013104606.174664a2@kernel.org> In-Reply-To: <20231013170903.p3ycicebnfrsmoks@skbuf> 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> <20231013161446.st7tlemyaj3ggkgk@skbuf> <20231013093056.4f915df1@kernel.org> <20231013170903.p3ycicebnfrsmoks@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 10:46:18 -0700 (PDT) On Fri, 13 Oct 2023 20:09:03 +0300 Vladimir Oltean wrote: > > > Translation between the UAPI-visible PHC index and MAC, DMA, phylib > > > PHY, other PHY etc can then be done by the kernel as needed. > > > > Translation by the kernel at which point? > > The gist of what I'm proposing is for the core ethtool netlink message > handler to get just the phc_index as an attribute. No other information > as to what it represents. Not that it's netdev, DMA, phylib PHY or whatnot. > > The ethtool kernel code would iterate through the stuff registered in > the system for the netdev, calling get_ts_info() or phy_ts_info() on it, > until it finds something which populates struct ethtool_ts_info :: > phc_index with the phc_index retrieved from netlink. > > Then, ethtool just talks with the timestamper that matched that phc_index. > > Same idea would be applied for the command that lists all timestamping > layers for a netdev. Check get_ts_info(), phy_ts_info(dev->phydev), and > can be extended in the future. I see, that could work. The user would then dig around sysfs to figure out which PHC has what characteristics? > > IMHO it'd indeed be clearer for the user to have an ability to read > > the PHC for SOF_..._DMA via ETHTOOL_MSG_TS_LIST_GET_REPLY as a separate > > entry, rather than e.g. assume that DMA uses the same PHC as MAC. > > I'm not really sure what you're referring to, with SOF_..._DMA. > The DMA, if presented as a PHC as I am proposing, would play the role of > the hardware timestamp provider (think SOF_TIMESTAMPING_TX_HARDWARE | > SOF_TIMESTAMPING_RX_HARDWARE), so there will be no driver-visible > special socket option flags for DMA timestamping. Each packet may want different timestamp tho, especially on Tx it should be fairly easy for socket to request to get "real" MAC stamps, while most get cheaper DMA stamps. Currently some drivers run flow matching to find PTP packets and automatically give them better quality timestamps :( Even if at the config level we use PHCs we need to translate that into some SKBTX_* bit, don't we?