Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1196969rdg; Fri, 13 Oct 2023 13:16:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVWCnqGzVojyfP5nNfcWwdTHUbgzITD/bLvI9/e2B/49Bdk6y0OH8+k0E4w/xy+gx1+Ad9 X-Received: by 2002:a05:6358:1c9:b0:13c:cdef:25ab with SMTP id e9-20020a05635801c900b0013ccdef25abmr26658055rwa.24.1697228178011; Fri, 13 Oct 2023 13:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697228177; cv=none; d=google.com; s=arc-20160816; b=DtG4TLUBSH4UIK6+RWJZLdjvAWE5f18uyMq02jldsxEYhGVoYaRb0l4vmUrYVxvOrW OlYq8i5PQew8kMj+TwZFjsNGi6IA7W/9hjjUnNCC1CcNihKoUTPyocmbQmWDWQG13Mco xL1tkq3QvRXuy7lOAj7ejjeh8+dztaGrxrzpfY/ReJGIxD0XBwJ0u/sL2Mp0w8LwiMRe gbSE5Bef/V5SLlJxhDHkAavmQEtt2Ny0g+S9SL7pfo6aJvDo+5UESPUG5BOB4Qgq9Rw1 aIxb+Ik7wm1+VTgFX9lM5gFDpPSh1AMnLEJ8FlNWClc8qhc8pogYX7Nl6pp6pCO+9rJW f1qQ== 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=E3+dZ0gO7twUQSKLtNiS/mkH2B9x8cmNDaJpgepLg8o=; fh=iA9bTnpmaYLoKcvpe/HYYvQwIKjzaXwIG4hFcJy8kWY=; b=gsKXYUGUuiv5i+QQfsRBZJwXrJrtN341wIVpbg4J/dOvjople8iKtuz8BE+ZEkH+Am K5KIpLBIr0t+xswG2Osz80DNt+l8MO2pV49MHbrGd7CIPhRn8CTMh/ZeJHgjYJw681Hz yQRhLaecBw1cdFXD9fJK9hucDWkxqAeOwrFr1U4fy1/0CcO3M9lAJ6GYPUPAa2s41SU4 Oe8b/GSHLe6YQbBTqLXjVLLIs0uTLBYDZHoVKdOxmCh/MxHPTk8wjfzVLXMTwspqa2Zs +EAJVFGFtd10eGMbxW8JqwEuB7SnJLVN+j83Bi+aV5WCqAGJN3aCo1s/n07AQib6rTBw kMcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+MuLCIv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id be3-20020a656e43000000b005789f94cd34si5025855pgb.636.2023.10.13.13.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 13:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+MuLCIv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id DE65980765D2; Fri, 13 Oct 2023 13:15:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232008AbjJMUPK (ORCPT + 99 others); Fri, 13 Oct 2023 16:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbjJMUPJ (ORCPT ); Fri, 13 Oct 2023 16:15:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17B59BB for ; Fri, 13 Oct 2023 13:15:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 953FEC433C8; Fri, 13 Oct 2023 20:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697228107; bh=E3+dZ0gO7twUQSKLtNiS/mkH2B9x8cmNDaJpgepLg8o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Y+MuLCIvcVqb9CfklV543jhsCSzIgWsevDuqNSl5yfnYh20EYYFfg2orc7ZLpAYWx 3lj/HShq8p/wIOEDd5opfnj8bR/AfQKeWWssVw6RDCOsh0oiQigxaXD3NJSeZdoqXZ g7jtQYS0YydDbm5V39DR1l/OKKuCmlMJy5Bpm7x8bfSQlJUfo05pkBXTh+HKjhnGtD UxLcz+2brd/hvjxuwnTAmF4aE85lTc8r7Vj+QgzRE0cQYdeU7vivt/+WDDvx1YesQo FLtpLXmBDH1uSXM3/43HSDByYJAmjXK/ULsR7vXl5dfnb0g9tEvgwZc7TjzcNmdeUg vwQa19h9Y878w== Date: Fri, 13 Oct 2023 13:15:05 -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: <20231013131505.2b27e3b8@kernel.org> In-Reply-To: <20231013175601.5mpyx7cjy6cp6sdb@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> <20231013104606.174664a2@kernel.org> <20231013175601.5mpyx7cjy6cp6sdb@skbuf> 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 13:15:23 -0700 (PDT) On Fri, 13 Oct 2023 20:56:01 +0300 Vladimir Oltean wrote: > > > 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. =20 > >=20 > > 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 :( > >=20 > > Even if at the config level we use PHCs we need to translate that into > > some SKBTX_* bit, don't we? =20 >=20 > I think Richard had something to say about that being wishful thinking: > https://lore.kernel.org/netdev/ZGw46hrpiqCVNeXS@hoboy.vegasvil.org/ =F0=9F=A4=B7=EF=B8=8F > On RX I'm not sure how you'd know in advance if the packet is going to > be routed to a socket that wants DMA or MAC timestamps. And having a > socket with hardware timestamps from one provider in one direction, and > another provider in the other direction, is.... not sane as a kernel API? For DC NICs all the timestamps are based on the same PHC. The use case is to get MAC/precise stamps for PTP and DMA/rough stamps for TCP CC. Agreed that stamps from different PHCs in different directions would=20 be weird. Thinking about it again we want the ability to configure the rx filter per stamping point. MAC stamps PTP frames and DMA stamps all the rest. For Tx we need to know whether app wanted DMA or MAC stamp (more or less whether it's PTP again, without running a classifier on the packet).