hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/ipv4/tcp_cdg.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * CAIA Delay-Gradient (CDG) congestion control
34 *
....@@ -146,7 +147,7 @@
146147 return;
147148
148149 if (hystart_detect & HYSTART_ACK_TRAIN) {
149
- u32 now_us = div_u64(local_clock(), NSEC_PER_USEC);
150
+ u32 now_us = tp->tcp_mstamp;
150151
151152 if (ca->last_ack == 0 || !tcp_is_cwnd_limited(sk)) {
152153 ca->last_ack = now_us;
....@@ -374,6 +375,7 @@
374375 struct cdg *ca = inet_csk_ca(sk);
375376 struct tcp_sock *tp = tcp_sk(sk);
376377
378
+ ca->gradients = NULL;
377379 /* We silently fall back to window = 1 if allocation fails. */
378380 if (window > 1)
379381 ca->gradients = kcalloc(window, sizeof(ca->gradients[0]),
....@@ -387,6 +389,7 @@
387389 struct cdg *ca = inet_csk_ca(sk);
388390
389391 kfree(ca->gradients);
392
+ ca->gradients = NULL;
390393 }
391394
392395 static struct tcp_congestion_ops tcp_cdg __read_mostly = {