Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2228225rdb; Mon, 20 Nov 2023 05:50:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkoinsbElkeGEFl3lzKB/9jqtnQ/jgrJUmJj6W++5fSsM1VHGq+zM/synTYdD1AarJ8GHL X-Received: by 2002:a17:902:8b85:b0:1ca:28f3:5690 with SMTP id ay5-20020a1709028b8500b001ca28f35690mr8508119plb.46.1700488231423; Mon, 20 Nov 2023 05:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700488231; cv=none; d=google.com; s=arc-20160816; b=shLs2aDrvHyigy6g6QmrtBzF5Ttrs9QMaSkFu2+X35SsOB0zgPKrp5wtvZGICAuJ3c U2XzM+oIJJwFFcyQaVfeyHBBw1qemWGhgdL+3YxLqmvEOazprPhC/adeZIIGdjxLGRDi e/GHX05gT7X6rhZqpmosesNVC9+wbbUxMnu15s7Azr69qzEJjkZEci2JEk8biEWezYAm 0+WxpyhLJqm8IUHtLFmNITFzIZvYQoBO1poJDrVZYb6iSxDhT+Jcci7433cAKqUrpyYK OaEZimMRKxuJlHbu2k6svHpYBlwi3b4P+fjMxZLhDHLJr7KTZMuILS9wf4I/PdTcNFCc Fq6w== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=7GFf2MmlZRbRryB9gq03P/QdrczVE9sVH3xjYJA5blE=; fh=MWt/aau18iZB4cBNRDtmAfDw6lQMgSQj1JsFQe1KAAc=; b=X7GDNluFmUDf1r7Og7YMpSREyyl6DFnvluY568kxFzv6YLdfYJYpNMBkzFEBulPhl+ IhNvB/mSDV+vk/eTvkaB2A3ShvVFOzP3btco5ZUtoMGvHUEMHQcyC+P77jknbZ7U2h2m PAkopgxlg9Jd2eAgFBmijEh4AGLyl9sP4R9lT4CZCptEnZ+2/8LDXf8T+1SKGofP8ScX CIncgDWCspySMxOL4dES8QECdj42GBuQNjPvFwcaTilcHSgov4JGM+JA6jN8STjVxXkg k/tJn4u0vY4yL28xbExcWIKCh1Ak0WYZN5a5RjcICpcJZGx5cig7ZjrCsNhtpXTzj4yn ImSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WU9e64b7; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o12-20020a170902bccc00b001ae40e07fb0si7667314pls.216.2023.11.20.05.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 05:50:31 -0800 (PST) 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=@bootlin.com header.s=gm1 header.b=WU9e64b7; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A570E8041E8A; Mon, 20 Nov 2023 05:50:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232764AbjKTNtk (ORCPT + 99 others); Mon, 20 Nov 2023 08:49:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232270AbjKTNti (ORCPT ); Mon, 20 Nov 2023 08:49:38 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67F39116; Mon, 20 Nov 2023 05:49:33 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 143D220010; Mon, 20 Nov 2023 13:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700488172; 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=7GFf2MmlZRbRryB9gq03P/QdrczVE9sVH3xjYJA5blE=; b=WU9e64b7dxhhmS5tY3Ewf9DZhZ4FNQbEc1dqBCABIwKqcCTEGu3N5XUxqYFN6+1NwBXNmL 4K0FCzqi7f5BmNvus4CG5MVVkI424l1fUBhRVFGCAMGk9L5sWQilQuHGK+Dxl8QpDwO0ns YxQzQQKvVzIk1c/q7yn4oIIrcGP4tI7+nZGRclVear2DMioqjTi7fvoj0KtQie5zIZjbwR JvpDlLMWXFp8aNbILVoYqrx2asmCQTlgH6WDpTGQhX/QpU4kfMDDztRA0OhcflpcpqSYij u6rH1gWnoPZYryN9ahnkBGNIP6acA8bIUvsQRn200q0fwWgqsrlfHN1p6XNBow== Date: Mon, 20 Nov 2023 14:49:29 +0100 From: =?UTF-8?B?S8O2cnk=?= Maincent To: Vladimir Oltean Cc: Jakub Kicinski , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , 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 , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier Subject: Re: [PATCH net-next v7 15/16] net: ethtool: ts: Let the active time stamping layer be selectable Message-ID: <20231120144929.3375317e@kmaincent-XPS-13-7390> In-Reply-To: <20231120120601.ondrhbkqpnaozl2q@skbuf> References: <20231114-feature_ptp_netnext-v7-0-472e77951e40@bootlin.com> <20231114-feature_ptp_netnext-v7-15-472e77951e40@bootlin.com> <20231118183433.30ca1d1a@kernel.org> <20231120104439.15bfdd09@kmaincent-XPS-13-7390> <20231120105255.cgbart5amkg4efaz@skbuf> <20231120121440.3274d44c@kmaincent-XPS-13-7390> <20231120120601.ondrhbkqpnaozl2q@skbuf> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Mon, 20 Nov 2023 05:50:28 -0800 (PST) On Mon, 20 Nov 2023 14:06:01 +0200 Vladimir Oltean wrote: > On Mon, Nov 20, 2023 at 12:14:40PM +0100, K=C3=B6ry Maincent wrote: > > > Does your UAPI proposal make it possible in any way to select > > > timestamping in phylib PHY A rather than PHY B? Or do you think it is > > > extensible to support that, somehow? =20 > >=20 > > It does not support it for now. > > I didn't want to base my work on his series as it could work without it= for > > now and I didn't want to wait to have his series accepted. It is more a > > future possible support as I don't have anything to test it and I don't > > know if such hardware exists right now. > > I think it will be extensible to support that, my thinking was to create > > this struct in net_device struct: > >=20 > > struct { > > enum layer; > > u32 id; > > } ts; > >=20 > > With id saving the phy_index of the PHY X used when the layer PHY is > > selected. This id could also be used to store the timestamp point in ca= se > > of several timestamp in a MAC. =20 >=20 > Ok, and I suppose the "u32 id" would be numerically the same as the > ETHTOOL_A_HEADER_PHY_INDEX nlattr that Maxime is proposing? Yes. > The next question would be: if a driver performs PHY management in > firmware, and does not use phylib, how should user space interact with it? > What timestamping layer and upon what should the ID be chosen? In that case it could be the second options I refereed to. Using the id to select the right timestamp within the NIC driver. It indeed won't be called PHY timestamping as it is managed by the NIC firm= ware but as it is managed by only one firmware and driver using the id to separa= te the available timestamp seems a good idea. Another solution would be to create another value in the layer enumeration. PHY_NIC_TIMESTAMPING? Better idea? I am not good at naming. =20 > Finally (and unrelated to the question above), why is SOFTWARE_TIMESTAMPI= NG > even a layer exposed in the UAPI? My understanding of this patch set is > that it is meant to select the source of hardware timestamps that are > given to a socket. What gap in the UAPI does the introduction of a > SOFTWARE_TIMESTAMPING hwtstamping layer cover? As I explained to Jakub: The software timestamping comes from the MAC driver capabilities and I deci= ded to separate software and MAC timestamping. If we select PHY timestamping we can't use software timestamping and for an user, selecting the MAC as timestamping seems not logical to use software timestamping (I got confused myself when I first dig into it long time ago). Be able to select directly Software timestamping seems appropriate and won't bring any harm. = What do you think? Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com