.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * CAIA Delay-Gradient (CDG) congestion control |
---|
3 | 4 | * |
---|
.. | .. |
---|
146 | 147 | return; |
---|
147 | 148 | |
---|
148 | 149 | if (hystart_detect & HYSTART_ACK_TRAIN) { |
---|
149 | | - u32 now_us = div_u64(local_clock(), NSEC_PER_USEC); |
---|
| 150 | + u32 now_us = tp->tcp_mstamp; |
---|
150 | 151 | |
---|
151 | 152 | if (ca->last_ack == 0 || !tcp_is_cwnd_limited(sk)) { |
---|
152 | 153 | ca->last_ack = now_us; |
---|
.. | .. |
---|
374 | 375 | struct cdg *ca = inet_csk_ca(sk); |
---|
375 | 376 | struct tcp_sock *tp = tcp_sk(sk); |
---|
376 | 377 | |
---|
| 378 | + ca->gradients = NULL; |
---|
377 | 379 | /* We silently fall back to window = 1 if allocation fails. */ |
---|
378 | 380 | if (window > 1) |
---|
379 | 381 | ca->gradients = kcalloc(window, sizeof(ca->gradients[0]), |
---|
.. | .. |
---|
387 | 389 | struct cdg *ca = inet_csk_ca(sk); |
---|
388 | 390 | |
---|
389 | 391 | kfree(ca->gradients); |
---|
| 392 | + ca->gradients = NULL; |
---|
390 | 393 | } |
---|
391 | 394 | |
---|
392 | 395 | static struct tcp_congestion_ops tcp_cdg __read_mostly = { |
---|