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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36F0AC43334 for ; Mon, 27 Jun 2022 07:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232852AbiF0HxQ (ORCPT ); Mon, 27 Jun 2022 03:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbiF0HxO (ORCPT ); Mon, 27 Jun 2022 03:53:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BFA565FC8; Mon, 27 Jun 2022 00:53:13 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9CBB61758; Mon, 27 Jun 2022 00:53:13 -0700 (PDT) Received: from [192.168.4.21] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 791553F5A1; Mon, 27 Jun 2022 00:53:08 -0700 (PDT) Message-ID: <5db4e640-8165-d7bf-c6b6-192ea7edfafd@arm.com> Date: Mon, 27 Jun 2022 08:52:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH net-next 1/4] time64.h: define PSEC_PER_NSEC and use it in tc-taprio Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , linux-kernel@vger.kernel.org, Andy Lutomirski , Thomas Gleixner References: <20220626120505.2369600-1-vladimir.oltean@nxp.com> <20220626120505.2369600-2-vladimir.oltean@nxp.com> From: Vincenzo Frascino In-Reply-To: <20220626120505.2369600-2-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Vladimir, On 6/26/22 13:05, Vladimir Oltean wrote: > Time-sensitive networking code needs to work with PTP times expressed in > nanoseconds, and with packet transmission times expressed in > picoseconds, since those would be fractional at higher than gigabit > speed when expressed in nanoseconds. > > Convert the existing uses in tc-taprio to a PSEC_PER_NSEC macro. > > Cc: Andy Lutomirski > Cc: Thomas Gleixner > Cc: Vincenzo Frascino > Signed-off-by: Vladimir Oltean > --- > include/vdso/time64.h | 1 + > net/sched/sch_taprio.c | 4 ++-- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/include/vdso/time64.h b/include/vdso/time64.h > index b40cfa2aa33c..f1c2d02474ae 100644 > --- a/include/vdso/time64.h > +++ b/include/vdso/time64.h > @@ -6,6 +6,7 @@ > #define MSEC_PER_SEC 1000L > #define USEC_PER_MSEC 1000L > #define NSEC_PER_USEC 1000L > +#define PSEC_PER_NSEC 1000L Are you planning to use this definition in the vdso library code? If not, you should define PSEC_PER_NSEC in "include/linux/time64.h". The vdso namespace should contain only the definitions shared by the implementations of the kernel and of the vdso library. ... -- Regards, Vincenzo