diff options
author | Maxime Ripard <maxime@cerno.tech> | 2022-05-03 11:53:42 +0200 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-05-03 11:53:42 +0200 |
commit | b812f646bb818ca0e1806072eb7f0006f3a65dde (patch) | |
tree | 3ba2134dcefd8127f5ad286e0fe1135588fbd0b3 /net/ipv4/tcp_rate.c | |
parent | a5fc012e6ee75a899173398573e77207542f588a (diff) | |
parent | e954d2c94d007afe487044ecfa48f2518643df0e (diff) | |
download | linux-b812f646bb818ca0e1806072eb7f0006f3a65dde.tar.gz |
Merge drm/drm-next into drm-misc-next
Christian needs a backmerge to avoid a merge conflict for amdgpu.
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'net/ipv4/tcp_rate.c')
-rw-r--r-- | net/ipv4/tcp_rate.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c index fbab921670cc..9a8e014d9b5b 100644 --- a/net/ipv4/tcp_rate.c +++ b/net/ipv4/tcp_rate.c @@ -74,27 +74,32 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb) * * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is * called multiple times. We favor the information from the most recently - * sent skb, i.e., the skb with the highest prior_delivered count. + * sent skb, i.e., the skb with the most recently sent time and the highest + * sequence. */ void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb, struct rate_sample *rs) { struct tcp_sock *tp = tcp_sk(sk); struct tcp_skb_cb *scb = TCP_SKB_CB(skb); + u64 tx_tstamp; if (!scb->tx.delivered_mstamp) return; + tx_tstamp = tcp_skb_timestamp_us(skb); if (!rs->prior_delivered || - after(scb->tx.delivered, rs->prior_delivered)) { + tcp_skb_sent_after(tx_tstamp, tp->first_tx_mstamp, + scb->end_seq, rs->last_end_seq)) { rs->prior_delivered_ce = scb->tx.delivered_ce; rs->prior_delivered = scb->tx.delivered; rs->prior_mstamp = scb->tx.delivered_mstamp; rs->is_app_limited = scb->tx.is_app_limited; rs->is_retrans = scb->sacked & TCPCB_RETRANS; + rs->last_end_seq = scb->end_seq; /* Record send time of most recently ACKed packet: */ - tp->first_tx_mstamp = tcp_skb_timestamp_us(skb); + tp->first_tx_mstamp = tx_tstamp; /* Find the duration of the "send phase" of this window: */ rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp, scb->tx.first_tx_mstamp); |