Skip to content

Commit a88e24f

Browse files
committed
Merge branch 'tcp-switch-to-Early-Departure-Time-model'
Eric Dumazet says: ==================== tcp: switch to Early Departure Time model In the early days, pacing has been implemented in sch_fq (FQ) in a generic way : - SO_MAX_PACING_RATE could be used by any sockets. - TCP would vary effective pacing rate based on CWND*MSS/SRTT - FQ would ensure delays between packets based on current sk->sk_pacing_rate, but with some quantum based artifacts. (inflating RPC tail latencies) - BBR then tweaked the pacing rate in its various phases (PROBE, DRAIN, ...) This worked reasonably well, but had the side effect that TCP RTT samples would be inflated by the sojourn time of the packets in FQ. Also note that when FQ is not used and TCP wants pacing, the internal pacing fallback has very different behavior, since TCP emits packets at the time they should be sent (with unreasonable assumptions about scheduling costs) Van Jacobson gave a talk at Netdev 0x12 in Montreal, about letting TCP (or applications for UDP messages) decide of the Earliest Departure Time, instead of letting packet schedulers derive it from pacing rate. https://www.netdevconf.org/0x12/session.html?evolving-from-afap-teaching-nics-about-time https://www.files.netdevconf.org/d/46def75c2ef345809bbe/files/?p=/Evolving%20from%20AFAP%20%E2%80%93%20Teaching%20NICs%20about%20time.pdf Recent additions in linux provided SO_TXTIME and a new ETF qdisc supporting the new skb->tstamp role This patch series converts TCP and FQ to the same model. This might in the future allow us to relax tight TSQ limits (if FQ is present in the output path), and thus lower number of callbacks to tcp_write_xmit(), thanks to batching. This will be followed by FQ change allowing SO_TXTIME support so that QUIC servers can let the pacing being done in FQ (or offloaded if network device permits) For example, a TCP flow rated at 24Mbps now shows a more meaningful RTT Before : ESTAB 0 211408 10.246.7.151:41558 10.246.7.152:33723 cubic wscale:8,8 rto:203 rtt:2.195/0.084 mss:1448 rcvmss:536 advmss:1448 cwnd:20 ssthresh:20 bytes_acked:36897937 segs_out:25488 segs_in:12454 data_segs_out:25486 send 105.5Mbps lastsnd:1 lastrcv:12851 lastack:1 pacing_rate 24.0Mbps/24.0Mbps delivery_rate 22.9Mbps busy:12851ms unacked:4 rcv_space:29200 notsent:205616 minrtt:0.026 After : ESTAB 0 192584 10.246.7.151:61612 10.246.7.152:34375 cubic wscale:8,8 rto:201 rtt:0.165/0.129 mss:1448 rcvmss:536 advmss:1448 cwnd:20 ssthresh:20 bytes_acked:170755401 segs_out:117931 segs_in:57651 data_segs_out:117929 send 1404.1Mbps lastsnd:1 lastrcv:56915 lastack:1 pacing_rate 24.0Mbps/24.0Mbps delivery_rate 24.2Mbps busy:56915ms unacked:4 rcv_space:29200 notsent:186792 minrtt:0.054 A nice side effect of this patch series is a reduction of max/p99 latencies of RPC workloads, since the FQ quantum no longer adds artifact. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4f4b93a + 90caf67 commit a88e24f

File tree

13 files changed

+103
-128
lines changed

13 files changed

+103
-128
lines changed

include/linux/skbuff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ struct sk_buff {
689689

690690
union {
691691
ktime_t tstamp;
692-
u64 skb_mstamp;
692+
u64 skb_mstamp_ns; /* earliest departure time */
693693
};
694694
/*
695695
* This is the control buffer. It is free to use for every

include/linux/tcp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ struct tcp_sock {
248248
syn_smc:1; /* SYN includes SMC */
249249
u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */
250250

251+
u64 tcp_wstamp_ns; /* departure time for next sent data packet */
252+
251253
/* RTT measurement */
252254
u64 tcp_mstamp; /* most recent packet received/sent */
253255
u32 srtt_us; /* smoothed round trip time << 3 in usecs */

include/net/tcp.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ void tcp_send_window_probe(struct sock *sk);
732732

733733
static inline u64 tcp_clock_ns(void)
734734
{
735-
return local_clock();
735+
return ktime_get_tai_ns();
736736
}
737737

738738
static inline u64 tcp_clock_us(void)
@@ -752,17 +752,7 @@ static inline u32 tcp_time_stamp_raw(void)
752752
return div_u64(tcp_clock_ns(), NSEC_PER_SEC / TCP_TS_HZ);
753753
}
754754

755-
756-
/* Refresh 1us clock of a TCP socket,
757-
* ensuring monotically increasing values.
758-
*/
759-
static inline void tcp_mstamp_refresh(struct tcp_sock *tp)
760-
{
761-
u64 val = tcp_clock_us();
762-
763-
if (val > tp->tcp_mstamp)
764-
tp->tcp_mstamp = val;
765-
}
755+
void tcp_mstamp_refresh(struct tcp_sock *tp);
766756

767757
static inline u32 tcp_stamp_us_delta(u64 t1, u64 t0)
768758
{
@@ -771,7 +761,13 @@ static inline u32 tcp_stamp_us_delta(u64 t1, u64 t0)
771761

772762
static inline u32 tcp_skb_timestamp(const struct sk_buff *skb)
773763
{
774-
return div_u64(skb->skb_mstamp, USEC_PER_SEC / TCP_TS_HZ);
764+
return div_u64(skb->skb_mstamp_ns, NSEC_PER_SEC / TCP_TS_HZ);
765+
}
766+
767+
/* provide the departure time in us unit */
768+
static inline u64 tcp_skb_timestamp_us(const struct sk_buff *skb)
769+
{
770+
return div_u64(skb->skb_mstamp_ns, NSEC_PER_USEC);
775771
}
776772

777773

@@ -817,7 +813,7 @@ struct tcp_skb_cb {
817813
#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */
818814
#define TCPCB_LOST 0x04 /* SKB is lost */
819815
#define TCPCB_TAGBITS 0x07 /* All tag bits */
820-
#define TCPCB_REPAIRED 0x10 /* SKB repaired (no skb_mstamp) */
816+
#define TCPCB_REPAIRED 0x10 /* SKB repaired (no skb_mstamp_ns) */
821817
#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */
822818
#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS| \
823819
TCPCB_REPAIRED)
@@ -1940,7 +1936,7 @@ static inline s64 tcp_rto_delta_us(const struct sock *sk)
19401936
{
19411937
const struct sk_buff *skb = tcp_rtx_queue_head(sk);
19421938
u32 rto = inet_csk(sk)->icsk_rto;
1943-
u64 rto_time_stamp_us = skb->skb_mstamp + jiffies_to_usecs(rto);
1939+
u64 rto_time_stamp_us = tcp_skb_timestamp_us(skb) + jiffies_to_usecs(rto);
19441940

19451941
return rto_time_stamp_us - tcp_sk(sk)->tcp_mstamp;
19461942
}

net/ipv4/syncookies.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ u64 cookie_init_timestamp(struct request_sock *req)
8888
ts <<= TSBITS;
8989
ts |= options;
9090
}
91-
return (u64)ts * (USEC_PER_SEC / TCP_TS_HZ);
91+
return (u64)ts * (NSEC_PER_SEC / TCP_TS_HZ);
9292
}
9393

9494

net/ipv4/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
12951295
copy = size_goal;
12961296

12971297
/* All packets are restored as if they have
1298-
* already been sent. skb_mstamp isn't set to
1298+
* already been sent. skb_mstamp_ns isn't set to
12991299
* avoid wrong rtt estimation.
13001300
*/
13011301
if (tp->repair)

net/ipv4/tcp_bbr.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ static const u32 bbr_probe_rtt_mode_ms = 200;
128128
/* Skip TSO below the following bandwidth (bits/sec): */
129129
static const int bbr_min_tso_rate = 1200000;
130130

131+
/* Pace at ~1% below estimated bw, on average, to reduce queue at bottleneck. */
132+
static const int bbr_pacing_marging_percent = 1;
133+
131134
/* We use a high_gain value of 2/ln(2) because it's the smallest pacing gain
132135
* that will allow a smoothly increasing pacing rate that will double each RTT
133136
* and send the same number of packets per RTT that an un-paced, slow-starting
@@ -208,12 +211,10 @@ static u64 bbr_rate_bytes_per_sec(struct sock *sk, u64 rate, int gain)
208211
{
209212
unsigned int mss = tcp_sk(sk)->mss_cache;
210213

211-
if (!tcp_needs_internal_pacing(sk))
212-
mss = tcp_mss_to_mtu(sk, mss);
213214
rate *= mss;
214215
rate *= gain;
215216
rate >>= BBR_SCALE;
216-
rate *= USEC_PER_SEC;
217+
rate *= USEC_PER_SEC / 100 * (100 - bbr_pacing_marging_percent);
217218
return rate >> BW_SCALE;
218219
}
219220

net/ipv4/tcp_input.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
13051305
*/
13061306
tcp_sacktag_one(sk, state, TCP_SKB_CB(skb)->sacked,
13071307
start_seq, end_seq, dup_sack, pcount,
1308-
skb->skb_mstamp);
1308+
tcp_skb_timestamp_us(skb));
13091309
tcp_rate_skb_delivered(sk, skb, state->rate);
13101310

13111311
if (skb == tp->lost_skb_hint)
@@ -1580,7 +1580,7 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
15801580
TCP_SKB_CB(skb)->end_seq,
15811581
dup_sack,
15821582
tcp_skb_pcount(skb),
1583-
skb->skb_mstamp);
1583+
tcp_skb_timestamp_us(skb));
15841584
tcp_rate_skb_delivered(sk, skb, state->rate);
15851585
if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)
15861586
list_del_init(&skb->tcp_tsorted_anchor);
@@ -3103,7 +3103,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack,
31033103
tp->retrans_out -= acked_pcount;
31043104
flag |= FLAG_RETRANS_DATA_ACKED;
31053105
} else if (!(sacked & TCPCB_SACKED_ACKED)) {
3106-
last_ackt = skb->skb_mstamp;
3106+
last_ackt = tcp_skb_timestamp_us(skb);
31073107
WARN_ON_ONCE(last_ackt == 0);
31083108
if (!first_ackt)
31093109
first_ackt = last_ackt;
@@ -3121,7 +3121,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack,
31213121
tp->delivered += acked_pcount;
31223122
if (!tcp_skb_spurious_retrans(tp, skb))
31233123
tcp_rack_advance(tp, sacked, scb->end_seq,
3124-
skb->skb_mstamp);
3124+
tcp_skb_timestamp_us(skb));
31253125
}
31263126
if (sacked & TCPCB_LOST)
31273127
tp->lost_out -= acked_pcount;
@@ -3215,7 +3215,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack,
32153215
tp->lost_cnt_hint -= min(tp->lost_cnt_hint, delta);
32163216
}
32173217
} else if (skb && rtt_update && sack_rtt_us >= 0 &&
3218-
sack_rtt_us > tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp)) {
3218+
sack_rtt_us > tcp_stamp_us_delta(tp->tcp_mstamp,
3219+
tcp_skb_timestamp_us(skb))) {
32193220
/* Do not re-arm RTO if the sack RTT is measured from data sent
32203221
* after when the head was last (re)transmitted. Otherwise the
32213222
* timeout may continue to extend in loss recovery.

net/ipv4/tcp_ipv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
544544
BUG_ON(!skb);
545545

546546
tcp_mstamp_refresh(tp);
547-
delta_us = (u32)(tp->tcp_mstamp - skb->skb_mstamp);
547+
delta_us = (u32)(tp->tcp_mstamp - tcp_skb_timestamp_us(skb));
548548
remaining = icsk->icsk_rto -
549549
usecs_to_jiffies(delta_us);
550550

net/ipv4/tcp_output.c

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@
4545

4646
#include <trace/events/tcp.h>
4747

48+
/* Refresh clocks of a TCP socket,
49+
* ensuring monotically increasing values.
50+
*/
51+
void tcp_mstamp_refresh(struct tcp_sock *tp)
52+
{
53+
u64 val = tcp_clock_ns();
54+
55+
/* departure time for next data packet */
56+
if (val > tp->tcp_wstamp_ns)
57+
tp->tcp_wstamp_ns = val;
58+
59+
val = div_u64(val, NSEC_PER_USEC);
60+
if (val > tp->tcp_mstamp)
61+
tp->tcp_mstamp = val;
62+
}
63+
4864
static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
4965
int push_one, gfp_t gfp);
5066

@@ -977,28 +993,34 @@ enum hrtimer_restart tcp_pace_kick(struct hrtimer *timer)
977993
return HRTIMER_NORESTART;
978994
}
979995

980-
static void tcp_internal_pacing(struct sock *sk, const struct sk_buff *skb)
996+
static void tcp_internal_pacing(struct sock *sk)
981997
{
982-
u64 len_ns;
983-
u32 rate;
984-
985998
if (!tcp_needs_internal_pacing(sk))
986999
return;
987-
rate = sk->sk_pacing_rate;
988-
if (!rate || rate == ~0U)
989-
return;
990-
991-
len_ns = (u64)skb->len * NSEC_PER_SEC;
992-
do_div(len_ns, rate);
9931000
hrtimer_start(&tcp_sk(sk)->pacing_timer,
994-
ktime_add_ns(ktime_get(), len_ns),
1001+
ns_to_ktime(tcp_sk(sk)->tcp_wstamp_ns),
9951002
HRTIMER_MODE_ABS_PINNED_SOFT);
9961003
sock_hold(sk);
9971004
}
9981005

999-
static void tcp_update_skb_after_send(struct tcp_sock *tp, struct sk_buff *skb)
1006+
static void tcp_update_skb_after_send(struct sock *sk, struct sk_buff *skb)
10001007
{
1001-
skb->skb_mstamp = tp->tcp_mstamp;
1008+
struct tcp_sock *tp = tcp_sk(sk);
1009+
1010+
skb->skb_mstamp_ns = tp->tcp_wstamp_ns;
1011+
if (sk->sk_pacing_status != SK_PACING_NONE) {
1012+
u32 rate = sk->sk_pacing_rate;
1013+
1014+
/* Original sch_fq does not pace first 10 MSS
1015+
* Note that tp->data_segs_out overflows after 2^32 packets,
1016+
* this is a minor annoyance.
1017+
*/
1018+
if (rate != ~0U && rate && tp->data_segs_out >= 10) {
1019+
tp->tcp_wstamp_ns += div_u64((u64)skb->len * NSEC_PER_SEC, rate);
1020+
1021+
tcp_internal_pacing(sk);
1022+
}
1023+
}
10021024
list_move_tail(&skb->tcp_tsorted_anchor, &tp->tsorted_sent_queue);
10031025
}
10041026

@@ -1045,7 +1067,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
10451067
if (unlikely(!skb))
10461068
return -ENOBUFS;
10471069
}
1048-
skb->skb_mstamp = tp->tcp_mstamp;
1070+
skb->skb_mstamp_ns = tp->tcp_wstamp_ns;
10491071

10501072
inet = inet_sk(sk);
10511073
tcb = TCP_SKB_CB(skb);
@@ -1137,7 +1159,6 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
11371159
tcp_event_data_sent(tp, sk);
11381160
tp->data_segs_out += tcp_skb_pcount(skb);
11391161
tp->bytes_sent += skb->len - tcp_header_size;
1140-
tcp_internal_pacing(sk, skb);
11411162
}
11421163

11431164
if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq)
@@ -1149,8 +1170,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
11491170
skb_shinfo(skb)->gso_segs = tcp_skb_pcount(skb);
11501171
skb_shinfo(skb)->gso_size = tcp_skb_mss(skb);
11511172

1152-
/* Our usage of tstamp should remain private */
1153-
skb->tstamp = 0;
1173+
/* Leave earliest departure time in skb->tstamp (skb->skb_mstamp_ns) */
11541174

11551175
/* Cleanup our debris for IP stacks */
11561176
memset(skb->cb, 0, max(sizeof(struct inet_skb_parm),
@@ -1163,7 +1183,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
11631183
err = net_xmit_eval(err);
11641184
}
11651185
if (!err && oskb) {
1166-
tcp_update_skb_after_send(tp, oskb);
1186+
tcp_update_skb_after_send(sk, oskb);
11671187
tcp_rate_skb_sent(sk, oskb);
11681188
}
11691189
return err;
@@ -1966,7 +1986,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
19661986
head = tcp_rtx_queue_head(sk);
19671987
if (!head)
19681988
goto send_now;
1969-
age = tcp_stamp_us_delta(tp->tcp_mstamp, head->skb_mstamp);
1989+
age = tcp_stamp_us_delta(tp->tcp_mstamp, tcp_skb_timestamp_us(head));
19701990
/* If next ACK is likely to come too late (half srtt), do not defer */
19711991
if (age < (tp->srtt_us >> 4))
19721992
goto send_now;
@@ -2312,7 +2332,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
23122332

23132333
if (unlikely(tp->repair) && tp->repair_queue == TCP_SEND_QUEUE) {
23142334
/* "skb_mstamp" is used as a start point for the retransmit timer */
2315-
tcp_update_skb_after_send(tp, skb);
2335+
tcp_update_skb_after_send(sk, skb);
23162336
goto repair; /* Skip network transmission */
23172337
}
23182338

@@ -2887,7 +2907,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
28872907
} tcp_skb_tsorted_restore(skb);
28882908

28892909
if (!err) {
2890-
tcp_update_skb_after_send(tp, skb);
2910+
tcp_update_skb_after_send(sk, skb);
28912911
tcp_rate_skb_sent(sk, skb);
28922912
}
28932913
} else {
@@ -3205,10 +3225,10 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,
32053225
memset(&opts, 0, sizeof(opts));
32063226
#ifdef CONFIG_SYN_COOKIES
32073227
if (unlikely(req->cookie_ts))
3208-
skb->skb_mstamp = cookie_init_timestamp(req);
3228+
skb->skb_mstamp_ns = cookie_init_timestamp(req);
32093229
else
32103230
#endif
3211-
skb->skb_mstamp = tcp_clock_us();
3231+
skb->skb_mstamp_ns = tcp_clock_ns();
32123232

32133233
#ifdef CONFIG_TCP_MD5SIG
32143234
rcu_read_lock();
@@ -3424,7 +3444,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)
34243444

34253445
err = tcp_transmit_skb(sk, syn_data, 1, sk->sk_allocation);
34263446

3427-
syn->skb_mstamp = syn_data->skb_mstamp;
3447+
syn->skb_mstamp_ns = syn_data->skb_mstamp_ns;
34283448

34293449
/* Now full SYN+DATA was cloned and sent (or not),
34303450
* remove the SYN from the original skb (syn_data)

net/ipv4/tcp_rate.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb)
5555
* bandwidth estimate.
5656
*/
5757
if (!tp->packets_out) {
58-
tp->first_tx_mstamp = skb->skb_mstamp;
59-
tp->delivered_mstamp = skb->skb_mstamp;
58+
u64 tstamp_us = tcp_skb_timestamp_us(skb);
59+
60+
tp->first_tx_mstamp = tstamp_us;
61+
tp->delivered_mstamp = tstamp_us;
6062
}
6163

6264
TCP_SKB_CB(skb)->tx.first_tx_mstamp = tp->first_tx_mstamp;
@@ -88,13 +90,12 @@ void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb,
8890
rs->is_app_limited = scb->tx.is_app_limited;
8991
rs->is_retrans = scb->sacked & TCPCB_RETRANS;
9092

93+
/* Record send time of most recently ACKed packet: */
94+
tp->first_tx_mstamp = tcp_skb_timestamp_us(skb);
9195
/* 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);
96+
rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp,
97+
scb->tx.first_tx_mstamp);
9598

96-
/* Record send time of most recently ACKed packet: */
97-
tp->first_tx_mstamp = skb->skb_mstamp;
9899
}
99100
/* Mark off the skb delivered once it's sacked to avoid being
100101
* used again when it's cumulatively acked. For acked packets

net/ipv4/tcp_recovery.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static u32 tcp_rack_reo_wnd(const struct sock *sk)
5050
s32 tcp_rack_skb_timeout(struct tcp_sock *tp, struct sk_buff *skb, u32 reo_wnd)
5151
{
5252
return tp->rack.rtt_us + reo_wnd -
53-
tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp);
53+
tcp_stamp_us_delta(tp->tcp_mstamp, tcp_skb_timestamp_us(skb));
5454
}
5555

5656
/* RACK loss detection (IETF draft draft-ietf-tcpm-rack-01):
@@ -91,7 +91,8 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout)
9191
!(scb->sacked & TCPCB_SACKED_RETRANS))
9292
continue;
9393

94-
if (!tcp_rack_sent_after(tp->rack.mstamp, skb->skb_mstamp,
94+
if (!tcp_rack_sent_after(tp->rack.mstamp,
95+
tcp_skb_timestamp_us(skb),
9596
tp->rack.end_seq, scb->end_seq))
9697
break;
9798

net/ipv4/tcp_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static void tcp_probe_timer(struct sock *sk)
360360
*/
361361
start_ts = tcp_skb_timestamp(skb);
362362
if (!start_ts)
363-
skb->skb_mstamp = tp->tcp_mstamp;
363+
skb->skb_mstamp_ns = tp->tcp_wstamp_ns;
364364
else if (icsk->icsk_user_timeout &&
365365
(s32)(tcp_time_stamp(tp) - start_ts) > icsk->icsk_user_timeout)
366366
goto abort;
@@ -758,7 +758,7 @@ void tcp_init_xmit_timers(struct sock *sk)
758758
{
759759
inet_csk_init_xmit_timers(sk, &tcp_write_timer, &tcp_delack_timer,
760760
&tcp_keepalive_timer);
761-
hrtimer_init(&tcp_sk(sk)->pacing_timer, CLOCK_MONOTONIC,
761+
hrtimer_init(&tcp_sk(sk)->pacing_timer, CLOCK_TAI,
762762
HRTIMER_MODE_ABS_PINNED_SOFT);
763763
tcp_sk(sk)->pacing_timer.function = tcp_pace_kick;
764764

0 commit comments

Comments
 (0)