From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C616C433E3 for ; Tue, 25 Aug 2020 09:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEB332067C for ; Tue, 25 Aug 2020 09:55:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="az6XmRx0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="p0+MO18m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729655AbgHYJzn (ORCPT ); Tue, 25 Aug 2020 05:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729456AbgHYJzk (ORCPT ); Tue, 25 Aug 2020 05:55:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87148C061574; Tue, 25 Aug 2020 02:55:40 -0700 (PDT) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598349339; 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: in-reply-to:in-reply-to:references:references; bh=5bdT5tTM+hEnX3GHDG3SgFYwTwZMX1yMI7aVVjqitqY=; b=az6XmRx0k5oLN1bIaAHyCdIuH590fxM3/uYM0egcx2w+6s56vftoivh4/DDL0y8tZaXGgB Xd/dMTYP4htDmj77ZYPKmtuulUTGZiW6ctR83KWrcYJVaEdwSun+H2/FFnQa+vUbFYjyiO 3Cs6fxHY+4V3XDEUic1hESs9SRP8bkbUzGnMP1Fh2XCzeSUmfh7zbZX5wg04Bowsz2/unh FEizV4bgRM2CunF+cLppghCcpx9DmSprFsZZcFIAccCKIC8CnzMQmc2XbxV3bNxAHYbi8e Wb51G0XpY5WPkK+74sRRJlVPc96CK/PxFSH9s4N+IsDr4XGf7/UOdqHsDycnGQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598349339; 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: in-reply-to:in-reply-to:references:references; bh=5bdT5tTM+hEnX3GHDG3SgFYwTwZMX1yMI7aVVjqitqY=; b=p0+MO18mFNv6nUcGw/fOpqWL3EmCv1vx5i0JWx2mxD5NVODpZfbqICiy0wx/6EIRg2VsKJ sQOT40Z3aCsfvoCQ== To: Vladimir Oltean Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Sebastian Andrzej Siewior , Richard Cochran , Kamil Alkhouri , ilias.apalodimas@linaro.org Subject: Re: [PATCH v3 5/8] net: dsa: hellcreek: Add TAPRIO offloading support In-Reply-To: <20200825093830.r2zlpowtmhgwm6rz@skbuf> References: <20200820081118.10105-1-kurt@linutronix.de> <20200820081118.10105-6-kurt@linutronix.de> <20200824225615.jtikfwyrxa7vxiq2@skbuf> <878se3133y.fsf@kurt> <20200825093830.r2zlpowtmhgwm6rz@skbuf> Date: Tue, 25 Aug 2020 11:55:37 +0200 Message-ID: <871rjv123q.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue Aug 25 2020, Vladimir Oltean wrote: > On Tue, Aug 25, 2020 at 11:33:53AM +0200, Kurt Kanzenbach wrote: >> On Tue Aug 25 2020, Vladimir Oltean wrote: >> > On Thu, Aug 20, 2020 at 10:11:15AM +0200, Kurt Kanzenbach wrote: >> > >> > Explain again how this works, please? The hrtimer measures the CLOCK_T= AI >> > of the CPU, but you are offloading the CLOCK_TAI domain of the NIC? So >> > you are assuming that the CPU and the NIC PHC are synchronized? What if >> > they aren't? >>=20 >> Yes, I assume that's synchronized with e.g. phc2sys. >>=20 > > My intuition tells me that this isn't the user's expectation, and that > it should do the right thing even if it's not synchronized to the system > clock. I get your point. But how to do it? We would need a timer based on the PTP clock in the switch. > >> > >> > And what if the base-time is in the past, do you deal with that (how >> > does the hardware deal with a base-time in the past)? >> > A base-time in the past (example: 0) should work: you should advance t= he >> > base-time into the nearest future multiple of the cycle-time, to at >> > least preserve phase correctness of the schedule. >>=20 >> If the hrtimer is programmed with a value in the past, it fires >> instantly. > > Yes, it does. > >> The callback is executed and the start time is programmed. >>=20 > > With a valid value from the hardware's perspective? Yes. That's no problem. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEooWgvezyxHPhdEojeSpbgcuY8KYFAl9E4BkACgkQeSpbgcuY 8KYTLA//czMWI4/CjiYlrGZSJO5Yo+04S6/y8xANPp50A8kGblNt3YuN5etwykHx 7xPPR6FdlU/U1FNTbi6FMgi5ryJjE6aktcpnCjkHPL63epMnx2pbt4JMRMNInaYv u91chzZcsyMJRb3FTu5SMZVC06aPh7zPgxSIey9+D/Yn7xjtvXKu511mPooPCPC3 vR5+++wa3sOassjabinJRr2Vjsg+6nzGULd0GCQ3L8gnURN3bB/a4McV0xBWpUpi IM256G0NWkRs0NXNX8R9B/Tn7ykeacgErRuLtuL/qXOktI+awR9PStS0O5JI8xnC 0FodtVyKhPhdTxTiaeNf8tHlyWsxUy812G5uJXWxCSdZrSoRjzCq5oVOmjvxaP5Z s/ws+WWOufaDb4eN8QbqHvmTfqMDi7uhUFpEHnuHoBTOaXY0hzLHNKx1n6S/fHMK x7kWkgoJ4Xu0xvuOGgVRuZcq5VpG5XaF7Hxzyn4tgT1XXXAyyIbIzvaLZSGOslBc yOUmoYPeru2J91Ssh5GLy8nuPadYaQjsynOy+/i7RDDS+yhOuSgt8jBBcHMX3RBX YrCGJZY5blnm5YT4Kk+f68p5njinzU9wbCoOuFQe+KX8rDhQJ05GQeVHGSAZOlpV nQ+sH4raun37QhMM+s5pe1W8glnBdOFV5M62VMFuHdLRart4DAA= =G86F -----END PGP SIGNATURE----- --=-=-=--