diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-06-28 17:52:38 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-30 21:18:16 -0700 |
commit | 837ced3a1a5d8bb1a637dd584711f31ae6b54d93 (patch) | |
tree | 5ff0dddc936cd8561624623fe3ae925492460bff /include/linux/time64.h | |
parent | 55a515b1f5a97df5704a1788fe97a4a740be2b9e (diff) |
time64.h: consolidate uses of PSEC_PER_NSEC
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 and the ocelot/felix DSA driver
to a PSEC_PER_NSEC macro. This macro is placed in include/linux/time64.h
as opposed to its relatives (PSEC_PER_SEC etc) from include/vdso/time64.h
because the vDSO library does not (yet) need/use it.
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> # for the vDSO parts
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/time64.h')
-rw-r--r-- | include/linux/time64.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/time64.h b/include/linux/time64.h index 81b9686a2079..2fb8232cff1d 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -20,6 +20,9 @@ struct itimerspec64 { struct timespec64 it_value; }; +/* Parameters used to convert the timespec values: */ +#define PSEC_PER_NSEC 1000L + /* Located here for timespec[64]_valid_strict */ #define TIME64_MAX ((s64)~((u64)1 << 63)) #define TIME64_MIN (-TIME64_MAX - 1) |