| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <net/tcp.h> |
|---|
| 2 | 3 | |
|---|
| 3 | 4 | /* The bandwidth estimator estimates the rate at which the network |
|---|
| .. | .. |
|---|
| 55 | 56 | * bandwidth estimate. |
|---|
| 56 | 57 | */ |
|---|
| 57 | 58 | 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; |
|---|
| 60 | 63 | } |
|---|
| 61 | 64 | |
|---|
| 62 | 65 | TCP_SKB_CB(skb)->tx.first_tx_mstamp = tp->first_tx_mstamp; |
|---|
| .. | .. |
|---|
| 88 | 91 | rs->is_app_limited = scb->tx.is_app_limited; |
|---|
| 89 | 92 | rs->is_retrans = scb->sacked & TCPCB_RETRANS; |
|---|
| 90 | 93 | |
|---|
| 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 | | - |
|---|
| 96 | 94 | /* 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 | + |
|---|
| 98 | 100 | } |
|---|
| 99 | 101 | /* Mark off the skb delivered once it's sacked to avoid being |
|---|
| 100 | 102 | * used again when it's cumulatively acked. For acked packets |
|---|