Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *   YeAH TCP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * For further details look at:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *   https://web.archive.org/web/20080316215752/http://wil.cs.caltech.edu/pfldnet2007/paper/YeAH_TCP.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/mm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/inet_diag.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <net/tcp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include "tcp_vegas.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define TCP_YEAH_ALPHA       80 /* number of packets queued at the bottleneck */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define TCP_YEAH_GAMMA        1 /* fraction of queue to be removed per rtt */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define TCP_YEAH_DELTA        3 /* log minimum fraction of cwnd to be removed on loss */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define TCP_YEAH_EPSILON      1 /* log maximum fraction to be removed on early decongestion */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define TCP_YEAH_PHY          8 /* maximum delta from base */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define TCP_YEAH_RHO         16 /* minimum number of consecutive rtt to consider competition on loss */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define TCP_YEAH_ZETA        50 /* minimum number of state switches to reset reno_count */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define TCP_SCALABLE_AI_CNT	 100U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) /* YeAH variables */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) struct yeah {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	struct vegas vegas;	/* must be first */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	/* YeAH */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	u32 lastQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	u32 doing_reno_now;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	u32 reno_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	u32 fast_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) static void tcp_yeah_init(struct sock *sk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	struct tcp_sock *tp = tcp_sk(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	struct yeah *yeah = inet_csk_ca(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	tcp_vegas_init(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	yeah->doing_reno_now = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	yeah->lastQ = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	yeah->reno_count = 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	/* Ensure the MD arithmetic works.  This is somewhat pedantic,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	 * since I don't think we will see a cwnd this large. :) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	tp->snd_cwnd_clamp = min_t(u32, tp->snd_cwnd_clamp, 0xffffffff/128);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 acked)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	struct tcp_sock *tp = tcp_sk(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	struct yeah *yeah = inet_csk_ca(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	if (!tcp_is_cwnd_limited(sk))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	if (tcp_in_slow_start(tp)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		acked = tcp_slow_start(tp, acked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		if (!acked)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 			goto do_vegas;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	if (!yeah->doing_reno_now) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		/* Scalable */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 				  acked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		/* Reno */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		tcp_cong_avoid_ai(tp, tp->snd_cwnd, acked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	/* The key players are v_vegas.beg_snd_una and v_beg_snd_nxt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	 * These are so named because they represent the approximate values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	 * of snd_una and snd_nxt at the beginning of the current RTT. More
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	 * precisely, they represent the amount of data sent during the RTT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	 * At the end of the RTT, when we receive an ACK for v_beg_snd_nxt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	 * we will calculate that (v_beg_snd_nxt - v_vegas.beg_snd_una) outstanding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	 * bytes of data have been ACKed during the course of the RTT, giving
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	 * an "actual" rate of:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	 *     (v_beg_snd_nxt - v_vegas.beg_snd_una) / (rtt duration)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	 * Unfortunately, v_vegas.beg_snd_una is not exactly equal to snd_una,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	 * because delayed ACKs can cover more than one segment, so they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	 * don't line up yeahly with the boundaries of RTTs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	 * Another unfortunate fact of life is that delayed ACKs delay the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	 * advance of the left edge of our send window, so that the number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	 * of bytes we send in an RTT is often less than our cwnd will allow.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	 * So we keep track of our cwnd separately, in v_beg_snd_cwnd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) do_vegas:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	if (after(ack, yeah->vegas.beg_snd_nxt)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		/* We do the Vegas calculations only if we got enough RTT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		 * samples that we can be reasonably sure that we got
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		 * at least one RTT sample that wasn't from a delayed ACK.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		 * If we only had 2 samples total,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		 * then that means we're getting only 1 ACK per RTT, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		 * means they're almost certainly delayed ACKs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		 * If  we have 3 samples, we should be OK.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		if (yeah->vegas.cntRTT > 2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 			u32 rtt, queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 			u64 bw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 			/* We have enough RTT samples, so, using the Vegas
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 			 * algorithm, we determine if we should increase or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 			 * decrease cwnd, and by how much.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 			/* Pluck out the RTT we are using for the Vegas
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 			 * calculations. This is the min RTT seen during the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 			 * last RTT. Taking the min filters out the effects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 			 * of delayed ACKs, at the cost of noticing congestion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 			 * a bit later.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 			rtt = yeah->vegas.minRTT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 			/* Compute excess number of packets above bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			 * Avoid doing full 64 bit divide.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			bw = tp->snd_cwnd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 			bw *= rtt - yeah->vegas.baseRTT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 			do_div(bw, rtt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 			queue = bw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 			if (queue > TCP_YEAH_ALPHA ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 			    rtt - yeah->vegas.baseRTT > (yeah->vegas.baseRTT / TCP_YEAH_PHY)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 				if (queue > TCP_YEAH_ALPHA &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 				    tp->snd_cwnd > yeah->reno_count) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 					u32 reduction = min(queue / TCP_YEAH_GAMMA ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 							    tp->snd_cwnd >> TCP_YEAH_EPSILON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 					tp->snd_cwnd -= reduction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 					tp->snd_cwnd = max(tp->snd_cwnd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 							   yeah->reno_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 					tp->snd_ssthresh = tp->snd_cwnd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 				if (yeah->reno_count <= 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 					yeah->reno_count = max(tp->snd_cwnd>>1, 2U);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 				else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 					yeah->reno_count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 				yeah->doing_reno_now = min(yeah->doing_reno_now + 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 							   0xffffffU);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 				yeah->fast_count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 				if (yeah->fast_count > TCP_YEAH_ZETA) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 					yeah->reno_count = 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 					yeah->fast_count = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 				yeah->doing_reno_now = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 			yeah->lastQ = queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		/* Save the extent of the current window so we can use this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		 * at the end of the next RTT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		yeah->vegas.beg_snd_una  = yeah->vegas.beg_snd_nxt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		yeah->vegas.beg_snd_nxt  = tp->snd_nxt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		yeah->vegas.beg_snd_cwnd = tp->snd_cwnd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		/* Wipe the slate clean for the next RTT. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		yeah->vegas.cntRTT = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		yeah->vegas.minRTT = 0x7fffffff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static u32 tcp_yeah_ssthresh(struct sock *sk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	const struct tcp_sock *tp = tcp_sk(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	struct yeah *yeah = inet_csk_ca(sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	u32 reduction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	if (yeah->doing_reno_now < TCP_YEAH_RHO) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		reduction = yeah->lastQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		reduction = min(reduction, max(tp->snd_cwnd>>1, 2U));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		reduction = max(reduction, tp->snd_cwnd >> TCP_YEAH_DELTA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	} else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		reduction = max(tp->snd_cwnd>>1, 2U);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	yeah->fast_count = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	yeah->reno_count = max(yeah->reno_count>>1, 2U);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	return max_t(int, tp->snd_cwnd - reduction, 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) static struct tcp_congestion_ops tcp_yeah __read_mostly = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	.init		= tcp_yeah_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	.ssthresh	= tcp_yeah_ssthresh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	.undo_cwnd      = tcp_reno_undo_cwnd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	.cong_avoid	= tcp_yeah_cong_avoid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	.set_state	= tcp_vegas_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	.cwnd_event	= tcp_vegas_cwnd_event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	.get_info	= tcp_vegas_get_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	.pkts_acked	= tcp_vegas_pkts_acked,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	.owner		= THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	.name		= "yeah",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) static int __init tcp_yeah_register(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	BUG_ON(sizeof(struct yeah) > ICSK_CA_PRIV_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	tcp_register_congestion_control(&tcp_yeah);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) static void __exit tcp_yeah_unregister(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	tcp_unregister_congestion_control(&tcp_yeah);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) module_init(tcp_yeah_register);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) module_exit(tcp_yeah_unregister);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) MODULE_AUTHOR("Angelo P. Castellani");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) MODULE_DESCRIPTION("YeAH TCP");