10 #include <linux/module.h>
12 #include <linux/inet_diag.h>
18 #define TCP_YEAH_ALPHA 80 //lin number of packets queued at the bottleneck
19 #define TCP_YEAH_GAMMA 1 //lin fraction of queue to be removed per rtt
20 #define TCP_YEAH_DELTA 3 //log minimum fraction of cwnd to be removed on loss
21 #define TCP_YEAH_EPSILON 1 //log maximum fraction to be removed on early decongestion
22 #define TCP_YEAH_PHY 8 //lin maximum delta from base
23 #define TCP_YEAH_RHO 16 //lin minimum number of consecutive rtt to consider competition on loss
24 #define TCP_YEAH_ZETA 50 //lin minimum number of state switchs to reset reno_count
26 #define TCP_SCALABLE_AI_CNT 100U
42 static void tcp_yeah_init(
struct sock *
sk)
72 static void tcp_yeah_cong_avoid(
struct sock *sk,
u32 ack,
u32 in_flight)
75 struct yeah *yeah = inet_csk_ca(sk);
133 if (yeah->
vegas.cntRTT > 2) {
148 rtt = yeah->
vegas.minRTT;
154 bw *= rtt - yeah->
vegas.baseRTT;
198 yeah->
vegas.beg_snd_una = yeah->
vegas.beg_snd_nxt;
203 yeah->
vegas.cntRTT = 0;
204 yeah->
vegas.minRTT = 0x7fffffff;
208 static u32 tcp_yeah_ssthresh(
struct sock *sk) {
209 const struct tcp_sock *tp = tcp_sk(sk);
210 struct yeah *yeah = inet_csk_ca(sk);
214 reduction = yeah->
lastQ;
230 .init = tcp_yeah_init,
231 .ssthresh = tcp_yeah_ssthresh,
232 .cong_avoid = tcp_yeah_cong_avoid,
237 .pkts_acked = tcp_yeah_pkts_acked,
243 static int __init tcp_yeah_register(
void)
250 static void __exit tcp_yeah_unregister(
void)