17 #include <linux/module.h>
21 #define BICTCP_BETA_SCALE 1024
29 static int fast_convergence = 1;
30 static int max_increment = 16;
31 static int low_window = 14;
32 static int beta = 819;
33 static int initial_ssthresh;
34 static int smooth_part = 20;
39 MODULE_PARM_DESC(max_increment,
"Limit on increment allowed during binary search");
41 MODULE_PARM_DESC(low_window,
"lower bound on congestion window (for TCP friendliness)");
47 MODULE_PARM_DESC(smooth_part,
"log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax");
58 #define ACK_RATIO_SHIFT 4
62 static inline void bictcp_reset(
struct bictcp *
ca)
72 static void bictcp_init(
struct sock *
sk)
80 tcp_sk(sk)->snd_ssthresh = initial_ssthresh;
86 static inline void bictcp_update(
struct bictcp *ca,
u32 cwnd)
99 if (cwnd <= low_window) {
109 if (dist > max_increment)
111 ca->
cnt = cwnd / max_increment;
120 if (cwnd < ca->last_max_cwnd +
BICTCP_B)
123 else if (cwnd < ca->last_max_cwnd + max_increment*(
BICTCP_B-1))
129 ca->
cnt = cwnd / max_increment;
143 static void bictcp_cong_avoid(
struct sock *sk,
u32 ack,
u32 in_flight)
146 struct bictcp *ca = inet_csk_ca(sk);
164 static u32 bictcp_recalc_ssthresh(
struct sock *sk)
166 const struct tcp_sock *tp = tcp_sk(sk);
167 struct bictcp *ca = inet_csk_ca(sk);
187 static u32 bictcp_undo_cwnd(
struct sock *sk)
189 const struct tcp_sock *tp = tcp_sk(sk);
190 const struct bictcp *ca = inet_csk_ca(sk);
197 bictcp_reset(inet_csk_ca(sk));
208 struct bictcp *ca = inet_csk_ca(sk);
217 .ssthresh = bictcp_recalc_ssthresh,
218 .cong_avoid = bictcp_cong_avoid,
219 .set_state = bictcp_state,
220 .undo_cwnd = bictcp_undo_cwnd,
221 .pkts_acked = bictcp_acked,
226 static int __init bictcp_register(
void)
232 static void __exit bictcp_unregister(
void)