lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+nT61qvE3iChGc-bYiTCzR=x2ZhvddRD0qDUTF6JuK+g@mail.gmail.com>
Date:   Sat, 10 Dec 2022 18:45:56 +0100
From:   Eric Dumazet <edumazet@...gle.com>
To:     Jakub Sitnicki <jakub@...udflare.com>
Cc:     Neal Cardwell <ncardwell@...gle.com>,
        Weiping Zhang <zhangweiping@...iglobal.com>,
        davem@...emloft.net, yoshfuji@...ux-ipv6.org, dsahern@...nel.org,
        kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
        zwp10758@...il.com
Subject: Re: [RFC PATCH] tcp: correct srtt and mdev_us calculation

On Tue, Dec 6, 2022 at 10:29 AM Jakub Sitnicki <jakub@...udflare.com> wrote:


> Nifty. And it's documented.
>
> struct tcp_sock {
>         …
>         u32     srtt_us;        /* smoothed round trip time << 3 in usecs */
>
> Thanks for the hint.

The >> 3 is all over the place... So even without a formal comment,
anyone familiar with TCP stack would spot this...

include/net/tcp.h:700:  return usecs_to_jiffies((tp->srtt_us >> 3) +
tp->rttvar_us);
include/trace/events/tcp.h:286:         __entry->srtt = tp->srtt_us >> 3;
include/uapi/linux/bpf.h:6038:  __u32 srtt_us;          /* smoothed
round trip time << 3 in usecs */
include/uapi/linux/bpf.h:6396:  __u32 srtt_us;          /* Averaged
RTT << 3 in usecs */
et/ipv4/tcp.c:3906:    info->tcpi_rtt = tp->srtt_us >> 3;
net/ipv4/tcp.c:4045:    nla_put_u32(stats, TCP_NLA_SRTT, tp->srtt_us >> 3);
net/ipv4/tcp_bbr.c:273: if (tp->srtt_us) {              /* any RTT
sample yet? */
net/ipv4/tcp_bbr.c:274:         rtt_us = max(tp->srtt_us >> 3, 1U);

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ