15 #include <linux/module.h>
17 #include <linux/inet_diag.h>
18 #include <asm/div64.h>
22 #define ALPHA_SCALE (1u<<ALPHA_SHIFT)
23 #define ALPHA_MIN ((3*ALPHA_SCALE)/10)
24 #define ALPHA_MAX (10*ALPHA_SCALE)
25 #define ALPHA_BASE ALPHA_SCALE
26 #define U32_MAX ((u32)~0U)
27 #define RTT_MAX (U32_MAX / ALPHA_MAX)
30 #define BETA_SCALE (1u<<BETA_SHIFT)
31 #define BETA_MIN (BETA_SCALE/8)
32 #define BETA_MAX (BETA_SCALE/2)
33 #define BETA_BASE BETA_MAX
37 MODULE_PARM_DESC(win_thresh,
"Window threshold for starting adaptive sizing");
57 static void rtt_reset(
struct sock *
sk)
69 static void tcp_illinois_init(
struct sock *
sk)
86 static void tcp_illinois_acked(
struct sock *
sk,
u32 pkts_acked,
s32 rtt)
90 ca->
acked = pkts_acked;
113 static inline u32 max_delay(
const struct illinois *ca)
119 static inline u32 avg_delay(
const struct illinois *ca)
200 if (da >= d3 || d3 <= d2)
221 static void update_params(
struct sock *sk)
224 struct illinois *ca = inet_csk_ca(sk);
230 u32 dm = max_delay(ca);
231 u32 da = avg_delay(ca);
245 struct illinois *ca = inet_csk_ca(sk);
259 static void tcp_illinois_cong_avoid(
struct sock *sk,
u32 ack,
u32 in_flight)
262 struct illinois *ca = inet_csk_ca(sk);
294 static u32 tcp_illinois_ssthresh(
struct sock *sk)
297 struct illinois *ca = inet_csk_ca(sk);
305 static void tcp_illinois_info(
struct sock *sk,
u32 ext,
308 const struct illinois *ca = inet_csk_ca(sk);
329 .init = tcp_illinois_init,
330 .ssthresh = tcp_illinois_ssthresh,
332 .cong_avoid = tcp_illinois_cong_avoid,
333 .set_state = tcp_illinois_state,
334 .get_info = tcp_illinois_info,
335 .pkts_acked = tcp_illinois_acked,
341 static int __init tcp_illinois_register(
void)
347 static void __exit tcp_illinois_unregister(
void)