Skip to content

RFC : Time cleanups + nano-second clock resolution support

Patrick McHardy netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8: tbf: fix latency printingtc/q_tbf.c+1 -10 replies
2/8: Use tc_calc_xmittime() where appropriatetc/q_cbq.c tc/tc_core.c tc/tc_red.c+3 -30 replies
3/8: Introduce tc_calc_xmitsize and use where appropriatetc/m_police.c tc/q_htb.c tc/q_tbf.c +2 more+11 -50 replies
4/8: Introduce TIME_UNITS_PER_SEC to represent internal clock resolutiontc/q_hfsc.c tc/q_tbf.c tc/tc_cbq.c +4 more+36 -220 replies
5/8: Replace "usec" by "time" in function namestc/m_estimator.c tc/q_cbq.c tc/q_hfsc.c +7 more+38 -380 replies
6/8: Add sprint_ticks() function and use in CBQtc/q_cbq.c tc/q_netem.c tc/tc_util.c +1 more+10 -90 replies
7/8: Handle different kernel clock resolutionstc/tc_core.c+19 -70 replies
8/8: Increase internal clock resolution to nsectc/tc_core.h tc/tc_util.c+7 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC IPROUTE 00/08]: Time cleanups + nano-second clock resolution support

This patchset consists of four parts:

- minor TBF time conversion fix

- consolidation of time calculations: consolidate commonly used expressions with the goal of making it easier to audit for integer overflows when increasing the internally used clock resolution.

- support for detecting the clock resolution used by the kernel and converting time values as necessary.

- finally, increase the internally used clock resolution to nano-seconds

These patches have been tested (well, TBF and HFSC) with both old kernels and patched kernels using nano-second resolution.

 tc/m_estimator.c  |    4 +--
 tc/m_police.c     |    2 -
 tc/q_cbq.c        |   15 +++++++------
 tc/q_hfsc.c       |   18 +++++++--------
 tc/q_htb.c        |    4 +--
 tc/q_netem.c      |   14 +++---------
 tc/q_tbf.c        |   22 +++++++++----------
 tc/tc_cbq.c       |    8 +++----
 tc/tc_core.c      |   61 ++++++++++++++++++++++++++++++++++++++----------------
 tc/tc_core.h      |   13 +++++++----
 tc/tc_estimator.c |    2 -
 tc/tc_red.c       |    2 -
 tc/tc_util.c      |   40 ++++++++++++++++++++++-------------
 tc/tc_util.h      |    7 +++---
 14 files changed, 125 insertions(+), 87 deletions(-)

Patrick McHardy:
[IPROUTE]: tbf: fix latency printing
[IPROUTE]: Use tc_calc_xmittime() where appropriate
[IPROUTE]: Introduce tc_calc_xmitsize and use where appropriate [IPROUTE]: Introduce TIME_UNITS_PER_SEC to represent internal clock resolution [IPROUTE]: Replace "usec" by "time" in function names
[IPROUTE]: Add sprint_ticks() function and use in CBQ
[IPROUTE]: Handle different kernel clock resolutions
[IPROUTE]: Increase internal clock resolution to nsec