xref: /linux/net/ipv4/tcp_illinois.c (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
109c434b8SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
2c462238dSStephen Hemminger /*
3c462238dSStephen Hemminger  * TCP Illinois congestion control.
4c462238dSStephen Hemminger  * Home page:
5c462238dSStephen Hemminger  *	http://www.ews.uiuc.edu/~shaoliu/tcpillinois/index.html
6c462238dSStephen Hemminger  *
7c462238dSStephen Hemminger  * The algorithm is described in:
8c462238dSStephen Hemminger  * "TCP-Illinois: A Loss and Delay-Based Congestion Control Algorithm
9c462238dSStephen Hemminger  *  for High-Speed Networks"
10ecc83275SJoey Pabalinas  * http://tamerbasar.csl.illinois.edu/LiuBasarSrikantPerfEvalArtJun2008.pdf
11c462238dSStephen Hemminger  *
12c462238dSStephen Hemminger  * Implemented from description in paper and ns-2 simulation.
13c462238dSStephen Hemminger  * Copyright (C) 2007 Stephen Hemminger <shemminger@linux-foundation.org>
14c462238dSStephen Hemminger  */
15c462238dSStephen Hemminger 
16c462238dSStephen Hemminger #include <linux/module.h>
17c462238dSStephen Hemminger #include <linux/skbuff.h>
18c462238dSStephen Hemminger #include <linux/inet_diag.h>
19c462238dSStephen Hemminger #include <asm/div64.h>
20c462238dSStephen Hemminger #include <net/tcp.h>
21c462238dSStephen Hemminger 
22c462238dSStephen Hemminger #define ALPHA_SHIFT	7
23c462238dSStephen Hemminger #define ALPHA_SCALE	(1u<<ALPHA_SHIFT)
24c462238dSStephen Hemminger #define ALPHA_MIN	((3*ALPHA_SCALE)/10)	/* ~0.3 */
25c462238dSStephen Hemminger #define ALPHA_MAX	(10*ALPHA_SCALE)	/* 10.0 */
26c462238dSStephen Hemminger #define ALPHA_BASE	ALPHA_SCALE		/* 1.0 */
2765d1b4a7SStephen Hemminger #define RTT_MAX		(U32_MAX / ALPHA_MAX)	/* 3.3 secs */
28c462238dSStephen Hemminger 
29c462238dSStephen Hemminger #define BETA_SHIFT	6
30c462238dSStephen Hemminger #define BETA_SCALE	(1u<<BETA_SHIFT)
3165d1b4a7SStephen Hemminger #define BETA_MIN	(BETA_SCALE/8)		/* 0.125 */
3265d1b4a7SStephen Hemminger #define BETA_MAX	(BETA_SCALE/2)		/* 0.5 */
3365d1b4a7SStephen Hemminger #define BETA_BASE	BETA_MAX
34c462238dSStephen Hemminger 
35c462238dSStephen Hemminger static int win_thresh __read_mostly = 15;
3665d1b4a7SStephen Hemminger module_param(win_thresh, int, 0);
37c462238dSStephen Hemminger MODULE_PARM_DESC(win_thresh, "Window threshold for starting adaptive sizing");
38c462238dSStephen Hemminger 
3965d1b4a7SStephen Hemminger static int theta __read_mostly = 5;
4065d1b4a7SStephen Hemminger module_param(theta, int, 0);
4165d1b4a7SStephen Hemminger MODULE_PARM_DESC(theta, "# of fast RTT's before full growth");
42c462238dSStephen Hemminger 
43c462238dSStephen Hemminger /* TCP Illinois Parameters */
4465d1b4a7SStephen Hemminger struct illinois {
4565d1b4a7SStephen Hemminger 	u64	sum_rtt;	/* sum of rtt's measured within last rtt */
4665d1b4a7SStephen Hemminger 	u16	cnt_rtt;	/* # of rtts measured within last rtt */
4765d1b4a7SStephen Hemminger 	u32	base_rtt;	/* min of all rtt in usec */
4865d1b4a7SStephen Hemminger 	u32	max_rtt;	/* max of all rtt in usec */
4965d1b4a7SStephen Hemminger 	u32	end_seq;	/* right edge of current RTT */
5065d1b4a7SStephen Hemminger 	u32	alpha;		/* Additive increase */
5165d1b4a7SStephen Hemminger 	u32	beta;		/* Muliplicative decrease */
5265d1b4a7SStephen Hemminger 	u16	acked;		/* # packets acked by current ACK */
5365d1b4a7SStephen Hemminger 	u8	rtt_above;	/* average rtt has gone above threshold */
5465d1b4a7SStephen Hemminger 	u8	rtt_low;	/* # of rtts measurements below threshold */
55c462238dSStephen Hemminger };
56c462238dSStephen Hemminger 
rtt_reset(struct sock * sk)5765d1b4a7SStephen Hemminger static void rtt_reset(struct sock *sk)
5865d1b4a7SStephen Hemminger {
5965d1b4a7SStephen Hemminger 	struct tcp_sock *tp = tcp_sk(sk);
6065d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
6165d1b4a7SStephen Hemminger 
6265d1b4a7SStephen Hemminger 	ca->end_seq = tp->snd_nxt;
6365d1b4a7SStephen Hemminger 	ca->cnt_rtt = 0;
6465d1b4a7SStephen Hemminger 	ca->sum_rtt = 0;
6565d1b4a7SStephen Hemminger 
6665d1b4a7SStephen Hemminger 	/* TODO: age max_rtt? */
6765d1b4a7SStephen Hemminger }
6865d1b4a7SStephen Hemminger 
tcp_illinois_init(struct sock * sk)69c462238dSStephen Hemminger static void tcp_illinois_init(struct sock *sk)
70c462238dSStephen Hemminger {
7165d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
72c462238dSStephen Hemminger 
7365d1b4a7SStephen Hemminger 	ca->alpha = ALPHA_MAX;
7465d1b4a7SStephen Hemminger 	ca->beta = BETA_BASE;
7565d1b4a7SStephen Hemminger 	ca->base_rtt = 0x7fffffff;
7665d1b4a7SStephen Hemminger 	ca->max_rtt = 0;
7765d1b4a7SStephen Hemminger 
7865d1b4a7SStephen Hemminger 	ca->acked = 0;
7965d1b4a7SStephen Hemminger 	ca->rtt_low = 0;
8065d1b4a7SStephen Hemminger 	ca->rtt_above = 0;
8165d1b4a7SStephen Hemminger 
8265d1b4a7SStephen Hemminger 	rtt_reset(sk);
83c462238dSStephen Hemminger }
84c462238dSStephen Hemminger 
8565d1b4a7SStephen Hemminger /* Measure RTT for each ack. */
tcp_illinois_acked(struct sock * sk,const struct ack_sample * sample)86756ee172SLawrence Brakmo static void tcp_illinois_acked(struct sock *sk, const struct ack_sample *sample)
87c462238dSStephen Hemminger {
8865d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
89756ee172SLawrence Brakmo 	s32 rtt_us = sample->rtt_us;
90164891aaSStephen Hemminger 
91756ee172SLawrence Brakmo 	ca->acked = sample->pkts_acked;
92164891aaSStephen Hemminger 
9330cfd0baSStephen Hemminger 	/* dup ack, no rtt sample */
94756ee172SLawrence Brakmo 	if (rtt_us < 0)
95b9ce204fSIlpo Järvinen 		return;
96b9ce204fSIlpo Järvinen 
9765d1b4a7SStephen Hemminger 	/* ignore bogus values, this prevents wraparound in alpha math */
98756ee172SLawrence Brakmo 	if (rtt_us > RTT_MAX)
99756ee172SLawrence Brakmo 		rtt_us = RTT_MAX;
10065d1b4a7SStephen Hemminger 
10165d1b4a7SStephen Hemminger 	/* keep track of minimum RTT seen so far */
102756ee172SLawrence Brakmo 	if (ca->base_rtt > rtt_us)
103756ee172SLawrence Brakmo 		ca->base_rtt = rtt_us;
10465d1b4a7SStephen Hemminger 
10565d1b4a7SStephen Hemminger 	/* and max */
106756ee172SLawrence Brakmo 	if (ca->max_rtt < rtt_us)
107756ee172SLawrence Brakmo 		ca->max_rtt = rtt_us;
108c462238dSStephen Hemminger 
10965d1b4a7SStephen Hemminger 	++ca->cnt_rtt;
110756ee172SLawrence Brakmo 	ca->sum_rtt += rtt_us;
111c462238dSStephen Hemminger }
112c462238dSStephen Hemminger 
11365d1b4a7SStephen Hemminger /* Maximum queuing delay */
max_delay(const struct illinois * ca)11465d1b4a7SStephen Hemminger static inline u32 max_delay(const struct illinois *ca)
115c462238dSStephen Hemminger {
11665d1b4a7SStephen Hemminger 	return ca->max_rtt - ca->base_rtt;
11765d1b4a7SStephen Hemminger }
118c462238dSStephen Hemminger 
11965d1b4a7SStephen Hemminger /* Average queuing delay */
avg_delay(const struct illinois * ca)12065d1b4a7SStephen Hemminger static inline u32 avg_delay(const struct illinois *ca)
12165d1b4a7SStephen Hemminger {
12265d1b4a7SStephen Hemminger 	u64 t = ca->sum_rtt;
123c462238dSStephen Hemminger 
12465d1b4a7SStephen Hemminger 	do_div(t, ca->cnt_rtt);
12565d1b4a7SStephen Hemminger 	return t - ca->base_rtt;
126c462238dSStephen Hemminger }
127c462238dSStephen Hemminger 
128c462238dSStephen Hemminger /*
129c462238dSStephen Hemminger  * Compute value of alpha used for additive increase.
130c462238dSStephen Hemminger  * If small window then use 1.0, equivalent to Reno.
131c462238dSStephen Hemminger  *
132c462238dSStephen Hemminger  * For larger windows, adjust based on average delay.
133c462238dSStephen Hemminger  * A. If average delay is at minimum (we are uncongested),
134c462238dSStephen Hemminger  *    then use large alpha (10.0) to increase faster.
135c462238dSStephen Hemminger  * B. If average delay is at maximum (getting congested)
13665d1b4a7SStephen Hemminger  *    then use small alpha (0.3)
137c462238dSStephen Hemminger  *
138c462238dSStephen Hemminger  * The result is a convex window growth curve.
139c462238dSStephen Hemminger  */
alpha(struct illinois * ca,u32 da,u32 dm)14065d1b4a7SStephen Hemminger static u32 alpha(struct illinois *ca, u32 da, u32 dm)
141c462238dSStephen Hemminger {
14265d1b4a7SStephen Hemminger 	u32 d1 = dm / 100;	/* Low threshold */
143c462238dSStephen Hemminger 
144c462238dSStephen Hemminger 	if (da <= d1) {
14565d1b4a7SStephen Hemminger 		/* If never got out of low delay zone, then use max */
14665d1b4a7SStephen Hemminger 		if (!ca->rtt_above)
14765d1b4a7SStephen Hemminger 			return ALPHA_MAX;
14865d1b4a7SStephen Hemminger 
14965d1b4a7SStephen Hemminger 		/* Wait for 5 good RTT's before allowing alpha to go alpha max.
15065d1b4a7SStephen Hemminger 		 * This prevents one good RTT from causing sudden window increase.
15165d1b4a7SStephen Hemminger 		 */
15265d1b4a7SStephen Hemminger 		if (++ca->rtt_low < theta)
15365d1b4a7SStephen Hemminger 			return ca->alpha;
15465d1b4a7SStephen Hemminger 
15565d1b4a7SStephen Hemminger 		ca->rtt_low = 0;
15665d1b4a7SStephen Hemminger 		ca->rtt_above = 0;
157c462238dSStephen Hemminger 		return ALPHA_MAX;
158c462238dSStephen Hemminger 	}
159c462238dSStephen Hemminger 
16065d1b4a7SStephen Hemminger 	ca->rtt_above = 1;
161c462238dSStephen Hemminger 
162c462238dSStephen Hemminger 	/*
163c462238dSStephen Hemminger 	 * Based on:
164c462238dSStephen Hemminger 	 *
165c462238dSStephen Hemminger 	 *      (dm - d1) amin amax
166c462238dSStephen Hemminger 	 * k1 = -------------------
167c462238dSStephen Hemminger 	 *         amax - amin
168c462238dSStephen Hemminger 	 *
169c462238dSStephen Hemminger 	 *       (dm - d1) amin
170c462238dSStephen Hemminger 	 * k2 = ----------------  - d1
171c462238dSStephen Hemminger 	 *        amax - amin
172c462238dSStephen Hemminger 	 *
173c462238dSStephen Hemminger 	 *             k1
174c462238dSStephen Hemminger 	 * alpha = ----------
175c462238dSStephen Hemminger 	 *          k2 + da
176c462238dSStephen Hemminger 	 */
177c462238dSStephen Hemminger 
178c462238dSStephen Hemminger 	dm -= d1;
179c462238dSStephen Hemminger 	da -= d1;
18065d1b4a7SStephen Hemminger 	return (dm * ALPHA_MAX) /
18165d1b4a7SStephen Hemminger 		(dm + (da  * (ALPHA_MAX - ALPHA_MIN)) / ALPHA_MIN);
182c462238dSStephen Hemminger }
183c462238dSStephen Hemminger 
184c462238dSStephen Hemminger /*
185c462238dSStephen Hemminger  * Beta used for multiplicative decrease.
186c462238dSStephen Hemminger  * For small window sizes returns same value as Reno (0.5)
187c462238dSStephen Hemminger  *
188c462238dSStephen Hemminger  * If delay is small (10% of max) then beta = 1/8
189c462238dSStephen Hemminger  * If delay is up to 80% of max then beta = 1/2
190c462238dSStephen Hemminger  * In between is a linear function
191c462238dSStephen Hemminger  */
beta(u32 da,u32 dm)19265d1b4a7SStephen Hemminger static u32 beta(u32 da, u32 dm)
193c462238dSStephen Hemminger {
194c462238dSStephen Hemminger 	u32 d2, d3;
195c462238dSStephen Hemminger 
196c462238dSStephen Hemminger 	d2 = dm / 10;
197c462238dSStephen Hemminger 	if (da <= d2)
198c462238dSStephen Hemminger 		return BETA_MIN;
19965d1b4a7SStephen Hemminger 
200c462238dSStephen Hemminger 	d3 = (8 * dm) / 10;
201c462238dSStephen Hemminger 	if (da >= d3 || d3 <= d2)
202c462238dSStephen Hemminger 		return BETA_MAX;
203c462238dSStephen Hemminger 
204c462238dSStephen Hemminger 	/*
205c462238dSStephen Hemminger 	 * Based on:
206c462238dSStephen Hemminger 	 *
207c462238dSStephen Hemminger 	 *       bmin d3 - bmax d2
208c462238dSStephen Hemminger 	 * k3 = -------------------
209c462238dSStephen Hemminger 	 *         d3 - d2
210c462238dSStephen Hemminger 	 *
211c462238dSStephen Hemminger 	 *       bmax - bmin
212c462238dSStephen Hemminger 	 * k4 = -------------
213c462238dSStephen Hemminger 	 *         d3 - d2
214c462238dSStephen Hemminger 	 *
215c462238dSStephen Hemminger 	 * b = k3 + k4 da
216c462238dSStephen Hemminger 	 */
217c462238dSStephen Hemminger 	return (BETA_MIN * d3 - BETA_MAX * d2 + (BETA_MAX - BETA_MIN) * da)
218c462238dSStephen Hemminger 		/ (d3 - d2);
219c462238dSStephen Hemminger }
220c462238dSStephen Hemminger 
22165d1b4a7SStephen Hemminger /* Update alpha and beta values once per RTT */
update_params(struct sock * sk)22265d1b4a7SStephen Hemminger static void update_params(struct sock *sk)
22365d1b4a7SStephen Hemminger {
22465d1b4a7SStephen Hemminger 	struct tcp_sock *tp = tcp_sk(sk);
22565d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
22665d1b4a7SStephen Hemminger 
227*40570375SEric Dumazet 	if (tcp_snd_cwnd(tp) < win_thresh) {
22865d1b4a7SStephen Hemminger 		ca->alpha = ALPHA_BASE;
22965d1b4a7SStephen Hemminger 		ca->beta = BETA_BASE;
23065d1b4a7SStephen Hemminger 	} else if (ca->cnt_rtt > 0) {
23165d1b4a7SStephen Hemminger 		u32 dm = max_delay(ca);
23265d1b4a7SStephen Hemminger 		u32 da = avg_delay(ca);
23365d1b4a7SStephen Hemminger 
23465d1b4a7SStephen Hemminger 		ca->alpha = alpha(ca, da, dm);
23565d1b4a7SStephen Hemminger 		ca->beta = beta(da, dm);
23665d1b4a7SStephen Hemminger 	}
23765d1b4a7SStephen Hemminger 
23865d1b4a7SStephen Hemminger 	rtt_reset(sk);
23965d1b4a7SStephen Hemminger }
24065d1b4a7SStephen Hemminger 
24165d1b4a7SStephen Hemminger /*
24265d1b4a7SStephen Hemminger  * In case of loss, reset to default values
24365d1b4a7SStephen Hemminger  */
tcp_illinois_state(struct sock * sk,u8 new_state)24465d1b4a7SStephen Hemminger static void tcp_illinois_state(struct sock *sk, u8 new_state)
24565d1b4a7SStephen Hemminger {
24665d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
24765d1b4a7SStephen Hemminger 
24865d1b4a7SStephen Hemminger 	if (new_state == TCP_CA_Loss) {
24965d1b4a7SStephen Hemminger 		ca->alpha = ALPHA_BASE;
25065d1b4a7SStephen Hemminger 		ca->beta = BETA_BASE;
25165d1b4a7SStephen Hemminger 		ca->rtt_low = 0;
25265d1b4a7SStephen Hemminger 		ca->rtt_above = 0;
25365d1b4a7SStephen Hemminger 		rtt_reset(sk);
25465d1b4a7SStephen Hemminger 	}
25565d1b4a7SStephen Hemminger }
25665d1b4a7SStephen Hemminger 
25765d1b4a7SStephen Hemminger /*
25865d1b4a7SStephen Hemminger  * Increase window in response to successful acknowledgment.
25965d1b4a7SStephen Hemminger  */
tcp_illinois_cong_avoid(struct sock * sk,u32 ack,u32 acked)26024901551SEric Dumazet static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, u32 acked)
26165d1b4a7SStephen Hemminger {
26265d1b4a7SStephen Hemminger 	struct tcp_sock *tp = tcp_sk(sk);
26365d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
26465d1b4a7SStephen Hemminger 
26565d1b4a7SStephen Hemminger 	if (after(ack, ca->end_seq))
26665d1b4a7SStephen Hemminger 		update_params(sk);
26765d1b4a7SStephen Hemminger 
26865d1b4a7SStephen Hemminger 	/* RFC2861 only increase cwnd if fully utilized */
26924901551SEric Dumazet 	if (!tcp_is_cwnd_limited(sk))
27065d1b4a7SStephen Hemminger 		return;
27165d1b4a7SStephen Hemminger 
27265d1b4a7SStephen Hemminger 	/* In slow start */
273071d5080SYuchung Cheng 	if (tcp_in_slow_start(tp))
2749f9843a7SYuchung Cheng 		tcp_slow_start(tp, acked);
27565d1b4a7SStephen Hemminger 
27665d1b4a7SStephen Hemminger 	else {
27765d1b4a7SStephen Hemminger 		u32 delta;
27865d1b4a7SStephen Hemminger 
27965d1b4a7SStephen Hemminger 		/* snd_cwnd_cnt is # of packets since last cwnd increment */
28065d1b4a7SStephen Hemminger 		tp->snd_cwnd_cnt += ca->acked;
28165d1b4a7SStephen Hemminger 		ca->acked = 1;
28265d1b4a7SStephen Hemminger 
28365d1b4a7SStephen Hemminger 		/* This is close approximation of:
28465d1b4a7SStephen Hemminger 		 * tp->snd_cwnd += alpha/tp->snd_cwnd
28565d1b4a7SStephen Hemminger 		*/
28665d1b4a7SStephen Hemminger 		delta = (tp->snd_cwnd_cnt * ca->alpha) >> ALPHA_SHIFT;
287*40570375SEric Dumazet 		if (delta >= tcp_snd_cwnd(tp)) {
288*40570375SEric Dumazet 			tcp_snd_cwnd_set(tp, min(tcp_snd_cwnd(tp) + delta / tcp_snd_cwnd(tp),
289*40570375SEric Dumazet 						 (u32)tp->snd_cwnd_clamp));
29065d1b4a7SStephen Hemminger 			tp->snd_cwnd_cnt = 0;
29165d1b4a7SStephen Hemminger 		}
29265d1b4a7SStephen Hemminger 	}
29365d1b4a7SStephen Hemminger }
29465d1b4a7SStephen Hemminger 
tcp_illinois_ssthresh(struct sock * sk)295c462238dSStephen Hemminger static u32 tcp_illinois_ssthresh(struct sock *sk)
296c462238dSStephen Hemminger {
297c462238dSStephen Hemminger 	struct tcp_sock *tp = tcp_sk(sk);
29865d1b4a7SStephen Hemminger 	struct illinois *ca = inet_csk_ca(sk);
299*40570375SEric Dumazet 	u32 decr;
300c462238dSStephen Hemminger 
301c462238dSStephen Hemminger 	/* Multiplicative decrease */
302*40570375SEric Dumazet 	decr = (tcp_snd_cwnd(tp) * ca->beta) >> BETA_SHIFT;
303*40570375SEric Dumazet 	return max(tcp_snd_cwnd(tp) - decr, 2U);
304c462238dSStephen Hemminger }
30565d1b4a7SStephen Hemminger 
30665d1b4a7SStephen Hemminger /* Extract info for Tcp socket info provided via netlink. */
tcp_illinois_info(struct sock * sk,u32 ext,int * attr,union tcp_cc_info * info)30764f40ff5SEric Dumazet static size_t tcp_illinois_info(struct sock *sk, u32 ext, int *attr,
30864f40ff5SEric Dumazet 				union tcp_cc_info *info)
309c462238dSStephen Hemminger {
31065d1b4a7SStephen Hemminger 	const struct illinois *ca = inet_csk_ca(sk);
311c462238dSStephen Hemminger 
312c462238dSStephen Hemminger 	if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
31364f40ff5SEric Dumazet 		info->vegas.tcpv_enabled = 1;
31464f40ff5SEric Dumazet 		info->vegas.tcpv_rttcnt = ca->cnt_rtt;
31564f40ff5SEric Dumazet 		info->vegas.tcpv_minrtt = ca->base_rtt;
31664f40ff5SEric Dumazet 		info->vegas.tcpv_rtt = 0;
3178f363b77SJesper Dangaard Brouer 
31864f40ff5SEric Dumazet 		if (info->vegas.tcpv_rttcnt > 0) {
31965d1b4a7SStephen Hemminger 			u64 t = ca->sum_rtt;
32065d1b4a7SStephen Hemminger 
32164f40ff5SEric Dumazet 			do_div(t, info->vegas.tcpv_rttcnt);
32264f40ff5SEric Dumazet 			info->vegas.tcpv_rtt = t;
3238f363b77SJesper Dangaard Brouer 		}
32464f40ff5SEric Dumazet 		*attr = INET_DIAG_VEGASINFO;
32564f40ff5SEric Dumazet 		return sizeof(struct tcpvegas_info);
326c462238dSStephen Hemminger 	}
327521f1cf1SEric Dumazet 	return 0;
328c462238dSStephen Hemminger }
329c462238dSStephen Hemminger 
330a252bebeSStephen Hemminger static struct tcp_congestion_ops tcp_illinois __read_mostly = {
331c462238dSStephen Hemminger 	.init		= tcp_illinois_init,
332c462238dSStephen Hemminger 	.ssthresh	= tcp_illinois_ssthresh,
333f1722a1bSYuchung Cheng 	.undo_cwnd	= tcp_reno_undo_cwnd,
334c462238dSStephen Hemminger 	.cong_avoid	= tcp_illinois_cong_avoid,
33565d1b4a7SStephen Hemminger 	.set_state	= tcp_illinois_state,
33665d1b4a7SStephen Hemminger 	.get_info	= tcp_illinois_info,
33765d1b4a7SStephen Hemminger 	.pkts_acked	= tcp_illinois_acked,
338c462238dSStephen Hemminger 
339c462238dSStephen Hemminger 	.owner		= THIS_MODULE,
340c462238dSStephen Hemminger 	.name		= "illinois",
341c462238dSStephen Hemminger };
342c462238dSStephen Hemminger 
tcp_illinois_register(void)343c462238dSStephen Hemminger static int __init tcp_illinois_register(void)
344c462238dSStephen Hemminger {
34565d1b4a7SStephen Hemminger 	BUILD_BUG_ON(sizeof(struct illinois) > ICSK_CA_PRIV_SIZE);
346c462238dSStephen Hemminger 	return tcp_register_congestion_control(&tcp_illinois);
347c462238dSStephen Hemminger }
348c462238dSStephen Hemminger 
tcp_illinois_unregister(void)349c462238dSStephen Hemminger static void __exit tcp_illinois_unregister(void)
350c462238dSStephen Hemminger {
351c462238dSStephen Hemminger 	tcp_unregister_congestion_control(&tcp_illinois);
352c462238dSStephen Hemminger }
353c462238dSStephen Hemminger 
354c462238dSStephen Hemminger module_init(tcp_illinois_register);
355c462238dSStephen Hemminger module_exit(tcp_illinois_unregister);
356c462238dSStephen Hemminger 
357c462238dSStephen Hemminger MODULE_AUTHOR("Stephen Hemminger, Shao Liu");
358c462238dSStephen Hemminger MODULE_LICENSE("GPL");
359c462238dSStephen Hemminger MODULE_DESCRIPTION("TCP Illinois");
36065d1b4a7SStephen Hemminger MODULE_VERSION("1.0");
361