Skip to content

Commit aab2b4b

Browse files
nealcardwelldavem330
authored andcommitted
tcp: fix double-counted receiver RTT when leaving receiver fast path
We should not update ts_recent and call tcp_rcv_rtt_measure_ts() both before and after going to step5. That wastes CPU and double-counts the receiver-side RTT sample. Signed-off-by: Neal Cardwell <ncardwell@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d2123be commit aab2b4b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎net/ipv4/tcp_input.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5485,6 +5485,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
54855485
if (tcp_checksum_complete_user(sk, skb))
54865486
goto csum_error;
54875487

5488+
if ((int)skb->truesize > sk->sk_forward_alloc)
5489+
goto step5;
5490+
54885491
/* Predicted packet is in window by definition.
54895492
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
54905493
* Hence, check seq<=rcv_wup reduces to:
@@ -5496,9 +5499,6 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
54965499

54975500
tcp_rcv_rtt_measure_ts(sk, skb);
54985501

5499-
if ((int)skb->truesize > sk->sk_forward_alloc)
5500-
goto step5;
5501-
55025502
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITS);
55035503

55045504
/* Bulk data transfer: receiver */

0 commit comments

Comments
 (0)