tcp_recovery.c (428aec5e69fa17d223e1495f395833c50770f7ae) tcp_recovery.c (6065fd0d179b96ddc488c76542349bcb148a95fd)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/tcp.h>
3#include <net/tcp.h>
4
5static void tcp_rack_mark_skb_lost(struct sock *sk, struct sk_buff *skb)
6{
7 struct tcp_sock *tp = tcp_sk(sk);
8

--- 103 unchanged lines hidden (view full) ---

112 * This is "Step 3: Advance RACK.xmit_time and update RACK.RTT" from
113 * draft-cheng-tcpm-rack-00.txt
114 */
115void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
116 u64 xmit_time)
117{
118 u32 rtt_us;
119
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/tcp.h>
3#include <net/tcp.h>
4
5static void tcp_rack_mark_skb_lost(struct sock *sk, struct sk_buff *skb)
6{
7 struct tcp_sock *tp = tcp_sk(sk);
8

--- 103 unchanged lines hidden (view full) ---

112 * This is "Step 3: Advance RACK.xmit_time and update RACK.RTT" from
113 * draft-cheng-tcpm-rack-00.txt
114 */
115void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
116 u64 xmit_time)
117{
118 u32 rtt_us;
119
120 if (tp->rack.mstamp &&
121 !tcp_rack_sent_after(xmit_time, tp->rack.mstamp,
122 end_seq, tp->rack.end_seq))
123 return;
124
125 rtt_us = tcp_stamp_us_delta(tp->tcp_mstamp, xmit_time);
120 rtt_us = tcp_stamp_us_delta(tp->tcp_mstamp, xmit_time);
126 if (sacked & TCPCB_RETRANS) {
121 if (rtt_us < tcp_min_rtt(tp) && (sacked & TCPCB_RETRANS)) {
127 /* If the sacked packet was retransmitted, it's ambiguous
128 * whether the retransmission or the original (or the prior
129 * retransmission) was sacked.
130 *
131 * If the original is lost, there is no ambiguity. Otherwise
132 * we assume the original can be delayed up to aRTT + min_rtt.
133 * the aRTT term is bounded by the fast recovery or timeout,
134 * so it's at least one RTT (i.e., retransmission is at least
135 * an RTT later).
136 */
122 /* If the sacked packet was retransmitted, it's ambiguous
123 * whether the retransmission or the original (or the prior
124 * retransmission) was sacked.
125 *
126 * If the original is lost, there is no ambiguity. Otherwise
127 * we assume the original can be delayed up to aRTT + min_rtt.
128 * the aRTT term is bounded by the fast recovery or timeout,
129 * so it's at least one RTT (i.e., retransmission is at least
130 * an RTT later).
131 */
137 if (rtt_us < tcp_min_rtt(tp))
138 return;
132 return;
139 }
133 }
140 tp->rack.rtt_us = rtt_us;
141 tp->rack.mstamp = xmit_time;
142 tp->rack.end_seq = end_seq;
143 tp->rack.advanced = 1;
134 tp->rack.advanced = 1;
135 tp->rack.rtt_us = rtt_us;
136 if (tcp_rack_sent_after(xmit_time, tp->rack.mstamp,
137 end_seq, tp->rack.end_seq)) {
138 tp->rack.mstamp = xmit_time;
139 tp->rack.end_seq = end_seq;
140 }
144}
145
146/* We have waited long enough to accommodate reordering. Mark the expired
147 * packets lost and retransmit them.
148 */
149void tcp_rack_reo_timeout(struct sock *sk)
150{
151 struct tcp_sock *tp = tcp_sk(sk);

--- 56 unchanged lines hidden ---
141}
142
143/* We have waited long enough to accommodate reordering. Mark the expired
144 * packets lost and retransmit them.
145 */
146void tcp_rack_reo_timeout(struct sock *sk)
147{
148 struct tcp_sock *tp = tcp_sk(sk);

--- 56 unchanged lines hidden ---