]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix TCP socket rehash stats mis-accounting
authorYuchung Cheng <ycheng@google.com>
Tue, 19 Jan 2021 19:26:19 +0000 (11:26 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Jan 2021 03:47:20 +0000 (19:47 -0800)
commit95530fb4c53f33fb33c9ae1801af3dff745853e6
treed7bd663b98e76378c3a279078746b22962a30932
parentd63e6b2a99a028d7955d425b1b7c07cbe9c20414
tcp: fix TCP socket rehash stats mis-accounting

The previous commit b66b62181534 ("tcp: export count for rehash attempts")
would mis-account rehashing SNMP and socket stats:

  a. During handshake of an active open, only counts the first
     SYN timeout

  b. After handshake of passive and active open, stop updating
     after (roughly) TCP_RETRIES1 recurring RTOs

  c. After the socket aborts, over count timeout_rehash by 1

This patch fixes this by checking the rehash result from sk_rethink_txhash.

Fixes: b66b62181534 ("tcp: export count for rehash attempts")
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Link: https://lore.kernel.org/r/20210119192619.1848270-1-ycheng@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sock.h
net/ipv4/tcp_input.c
net/ipv4/tcp_timer.c