]> git.baikalelectronics.ru Git - kernel.git/commit
tcp_bbr: improve arithmetic division in bbr_update_bw()
authorWen Yang <wenyang@linux.alibaba.com>
Mon, 20 Jan 2020 10:04:56 +0000 (18:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jan 2020 09:45:49 +0000 (10:45 +0100)
commit0fb32973d9c1332b5d0ae769373d0fa790aa5a64
tree1c9a026cc81dde4020ca68da9ed68dc0978a2a47
parent9682f04272470689b99b9a79fe239a301f1432f0
tcp_bbr: improve arithmetic division in bbr_update_bw()

do_div() does a 64-by-32 division. Use div64_long() instead of it
if the divisor is long, to avoid truncation to 32-bit.
And as a nice side effect also cleans up the function a bit.

Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_bbr.c