From: Hangbin Liu <hangbin.liu@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
donald.hunter@gmail.com
Subject: Re: [PATCH net-next 2/2] netlink: specs: tcp_metrics: drop the RTT shift instructions
Date: Mon, 14 Sep 2026 14:49:32 +0800 [thread overview]
Message-ID: <aqeY_G3XtQ3zSE0k@fedora> (raw)
In-Reply-To: <20260912234337.308298-2-kuba@kernel.org>
On Sat, Sep 12, 2026 at 04:43:37PM -0700, Jakub Kicinski wrote:
> All four RTT attributes tell the reader to left-shift, which inflates the
> value by 16 to 64 times, and the two usec ones say the result is in msecs.
> The attributes carry srtt_us and mdev_us, which hold 3 and 2 fractional
> bits. The shift to get the integer part would be a right shift.
>
> Drop the instructions instead of turning them around. The number of
> fractional bits is the part worth documenting, whether to shift, divide or
> convert to a double is up to the caller.
>
> While at it fix the acronym on the two variance attributes.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> Documentation/netlink/specs/tcp_metrics.yaml | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/netlink/specs/tcp_metrics.yaml b/Documentation/netlink/specs/tcp_metrics.yaml
> index 1d365908084d..779e8a22b765 100644
> --- a/Documentation/netlink/specs/tcp_metrics.yaml
> +++ b/Documentation/netlink/specs/tcp_metrics.yaml
> @@ -93,14 +93,12 @@ kernel-policy: global
> name: rtt
> type: u32
> doc: |
> - Round Trip Time (RTT), in msecs with 3 bits fractional
> - (left-shift by 3 to get the msec value).
> + Round Trip Time (RTT), in msecs with 3 bits fractional.
> -
> name: rttvar
> type: u32
> doc: |
> - Round Trip Time VARiance (RTT), in msecs with 2 bits fractional
> - (left-shift by 2 to get the msec value).
> + Round Trip Time VARiance (RTTVAR), in msecs with 2 bits fractional.
> -
> name: ssthresh
> type: u32
> @@ -117,14 +115,12 @@ kernel-policy: global
> name: rtt-us
> type: u32
> doc: |
> - Round Trip Time (RTT), in usecs, with 3 bits fractional
> - (left-shift by 3 to get the msec value).
> + Round Trip Time (RTT), in usecs, with 3 bits fractional.
> -
> name: rttvar-us
> type: u32
> doc: |
> - Round Trip Time (RTT), in usecs, with 2 bits fractional
> - (left-shift by 3 to get the msec value).
> + Round Trip Time VARiance (RTTVAR), in usecs, with 2 bits fractional.
>
> operations:
> list:
> --
> 2.55.0
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
next prev parent reply other threads:[~2026-09-14 6:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 23:43 [PATCH net-next 1/2] netlink: specs: tcp_metrics: fix the attribute length checks Jakub Kicinski
2026-09-12 23:43 ` [PATCH net-next 2/2] netlink: specs: tcp_metrics: drop the RTT shift instructions Jakub Kicinski
2026-09-14 6:49 ` Hangbin Liu [this message]
2026-09-14 6:41 ` [PATCH net-next 1/2] netlink: specs: tcp_metrics: fix the attribute length checks Hangbin Liu
2026-09-15 13:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aqeY_G3XtQ3zSE0k@fedora \
--to=hangbin.liu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.