]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: ensure to use the most recently sent skb when filling the rate sample
authorPengcheng Yang <yangpc@wangsu.com>
Wed, 20 Apr 2022 02:34:41 +0000 (10:34 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 22 Apr 2022 22:20:47 +0000 (15:20 -0700)
commit73ce66d29ac87dab61fe89d2fbd617339938e198
treee0c18c5a0aa7e21620282dab9406132d7afd95cc
parent1f205816fc56f07ca32086f9183a298b50b2e68e
tcp: ensure to use the most recently sent skb when filling the rate sample

If an ACK (s)acks multiple skbs, we favor the information
from the most recently sent skb by choosing the skb with
the highest prior_delivered count. But in the interval
between receiving ACKs, we send multiple skbs with the same
prior_delivered, because the tp->delivered only changes
when we receive an ACK.

We used RACK's solution, copying tcp_rack_sent_after() as
tcp_skb_sent_after() helper to determine "which packet was
sent last?". Later, we will use tcp_skb_sent_after() instead
in RACK.

Fixes: a466c4d94a94 ("tcp: track data delivery rate for a TCP connection")
Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Tested-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/1650422081-22153-1-git-send-email-yangpc@wangsu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h
net/ipv4/tcp_rate.c