hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/net/ipv4/tcp_veno.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * TCP Veno congestion control
34 *
....@@ -6,7 +7,7 @@
67 * "TCP Veno: TCP Enhancement for Transmission over Wireless Access Networks."
78 * IEEE Journal on Selected Areas in Communication,
89 * Feb. 2003.
9
- * See http://www.ie.cuhk.edu.hk/fileadmin/staff_upload/soung/Journal/J3.pdf
10
+ * See https://www.ie.cuhk.edu.hk/fileadmin/staff_upload/soung/Journal/J3.pdf
1011 */
1112
1213 #include <linux/mm.h>
....@@ -152,31 +153,34 @@
152153 veno->diff = (tp->snd_cwnd << V_PARAM_SHIFT) - target_cwnd;
153154
154155 if (tcp_in_slow_start(tp)) {
155
- /* Slow start. */
156
- tcp_slow_start(tp, acked);
157
- } else {
158
- /* Congestion avoidance. */
159
- if (veno->diff < beta) {
160
- /* In the "non-congestive state", increase cwnd
161
- * every rtt.
162
- */
163
- tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1);
164
- } else {
165
- /* In the "congestive state", increase cwnd
166
- * every other rtt.
167
- */
168
- if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
169
- if (veno->inc &&
170
- tp->snd_cwnd < tp->snd_cwnd_clamp) {
171
- tp->snd_cwnd++;
172
- veno->inc = 0;
173
- } else
174
- veno->inc = 1;
175
- tp->snd_cwnd_cnt = 0;
176
- } else
177
- tp->snd_cwnd_cnt++;
178
- }
156
+ /* Slow start. */
157
+ acked = tcp_slow_start(tp, acked);
158
+ if (!acked)
159
+ goto done;
179160 }
161
+
162
+ /* Congestion avoidance. */
163
+ if (veno->diff < beta) {
164
+ /* In the "non-congestive state", increase cwnd
165
+ * every rtt.
166
+ */
167
+ tcp_cong_avoid_ai(tp, tp->snd_cwnd, acked);
168
+ } else {
169
+ /* In the "congestive state", increase cwnd
170
+ * every other rtt.
171
+ */
172
+ if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
173
+ if (veno->inc &&
174
+ tp->snd_cwnd < tp->snd_cwnd_clamp) {
175
+ tp->snd_cwnd++;
176
+ veno->inc = 0;
177
+ } else
178
+ veno->inc = 1;
179
+ tp->snd_cwnd_cnt = 0;
180
+ } else
181
+ tp->snd_cwnd_cnt += acked;
182
+ }
183
+done:
180184 if (tp->snd_cwnd < 2)
181185 tp->snd_cwnd = 2;
182186 else if (tp->snd_cwnd > tp->snd_cwnd_clamp)