hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/net/ipv4/tcp_rate.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 #include <net/tcp.h>
23
34 /* The bandwidth estimator estimates the rate at which the network
....@@ -55,8 +56,10 @@
5556 * bandwidth estimate.
5657 */
5758 if (!tp->packets_out) {
58
- tp->first_tx_mstamp = skb->skb_mstamp;
59
- tp->delivered_mstamp = skb->skb_mstamp;
59
+ u64 tstamp_us = tcp_skb_timestamp_us(skb);
60
+
61
+ tp->first_tx_mstamp = tstamp_us;
62
+ tp->delivered_mstamp = tstamp_us;
6063 }
6164
6265 TCP_SKB_CB(skb)->tx.first_tx_mstamp = tp->first_tx_mstamp;
....@@ -88,13 +91,12 @@
8891 rs->is_app_limited = scb->tx.is_app_limited;
8992 rs->is_retrans = scb->sacked & TCPCB_RETRANS;
9093
91
- /* Find the duration of the "send phase" of this window: */
92
- rs->interval_us = tcp_stamp_us_delta(
93
- skb->skb_mstamp,
94
- scb->tx.first_tx_mstamp);
95
-
9694 /* Record send time of most recently ACKed packet: */
97
- tp->first_tx_mstamp = skb->skb_mstamp;
95
+ tp->first_tx_mstamp = tcp_skb_timestamp_us(skb);
96
+ /* Find the duration of the "send phase" of this window: */
97
+ rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp,
98
+ scb->tx.first_tx_mstamp);
99
+
98100 }
99101 /* Mark off the skb delivered once it's sacked to avoid being
100102 * used again when it's cumulatively acked. For acked packets