Lines Matching +full:static +full:- +full:beta
1 // SPDX-License-Identifier: GPL-2.0-only
20 /* Default values of the Veno variables, in fixed-point representation
24 static const int beta = 3 << V_PARAM_SHIFT; variable
36 /* There are several situations when we must "re-start" Veno:
45 static inline void veno_enable(struct sock *sk) in veno_enable()
50 veno->doing_veno_now = 1; in veno_enable()
52 veno->minrtt = 0x7fffffff; in veno_enable()
55 static inline void veno_disable(struct sock *sk) in veno_disable()
60 veno->doing_veno_now = 0; in veno_disable()
63 static void tcp_veno_init(struct sock *sk) in tcp_veno_init()
67 veno->basertt = 0x7fffffff; in tcp_veno_init()
68 veno->inc = 1; in tcp_veno_init()
73 static void tcp_veno_pkts_acked(struct sock *sk, in tcp_veno_pkts_acked()
79 if (sample->rtt_us < 0) in tcp_veno_pkts_acked()
83 vrtt = sample->rtt_us + 1; in tcp_veno_pkts_acked()
86 if (vrtt < veno->basertt) in tcp_veno_pkts_acked()
87 veno->basertt = vrtt; in tcp_veno_pkts_acked()
92 veno->minrtt = min(veno->minrtt, vrtt); in tcp_veno_pkts_acked()
93 veno->cntrtt++; in tcp_veno_pkts_acked()
96 static void tcp_veno_state(struct sock *sk, u8 ca_state) in tcp_veno_state()
113 static void tcp_veno_cwnd_event(struct sock *sk, enum tcp_ca_event event) in tcp_veno_cwnd_event()
119 static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked) in tcp_veno_cong_avoid()
124 if (!veno->doing_veno_now) { in tcp_veno_cong_avoid()
134 if (veno->cntrtt <= 2) { in tcp_veno_cong_avoid()
147 rtt = veno->minrtt; in tcp_veno_cong_avoid()
149 target_cwnd = (u64)tcp_snd_cwnd(tp) * veno->basertt; in tcp_veno_cong_avoid()
153 veno->diff = (tcp_snd_cwnd(tp) << V_PARAM_SHIFT) - target_cwnd; in tcp_veno_cong_avoid()
163 if (veno->diff < beta) { in tcp_veno_cong_avoid()
164 /* In the "non-congestive state", increase cwnd in tcp_veno_cong_avoid()
172 if (tp->snd_cwnd_cnt >= tcp_snd_cwnd(tp)) { in tcp_veno_cong_avoid()
173 if (veno->inc && in tcp_veno_cong_avoid()
174 tcp_snd_cwnd(tp) < tp->snd_cwnd_clamp) { in tcp_veno_cong_avoid()
176 veno->inc = 0; in tcp_veno_cong_avoid()
178 veno->inc = 1; in tcp_veno_cong_avoid()
179 tp->snd_cwnd_cnt = 0; in tcp_veno_cong_avoid()
181 tp->snd_cwnd_cnt += acked; in tcp_veno_cong_avoid()
186 else if (tcp_snd_cwnd(tp) > tp->snd_cwnd_clamp) in tcp_veno_cong_avoid()
187 tcp_snd_cwnd_set(tp, tp->snd_cwnd_clamp); in tcp_veno_cong_avoid()
190 /* veno->cntrtt = 0; */ in tcp_veno_cong_avoid()
191 veno->minrtt = 0x7fffffff; in tcp_veno_cong_avoid()
195 static u32 tcp_veno_ssthresh(struct sock *sk) in tcp_veno_ssthresh()
200 if (veno->diff < beta) in tcp_veno_ssthresh()
201 /* in "non-congestive state", cut cwnd by 1/5 */ in tcp_veno_ssthresh()
208 static struct tcp_congestion_ops tcp_veno __read_mostly = {
221 static int __init tcp_veno_register(void) in tcp_veno_register()
228 static void __exit tcp_veno_unregister(void) in tcp_veno_unregister()