aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_hybla.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-05-16 19:15:34 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-17 14:59:59 -0400
commita2a385d627e1549da4b43a8b3dfe370589766e1c (patch)
treed61e9913497c6c14406032f6a0822738707f1abf /net/ipv4/tcp_hybla.c
parente005d193d55ee5f757b13306112d8c23aac27a88 (diff)
tcp: bool conversions
bool conversions where possible. __inline__ -> inline space cleanups Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_hybla.c')
-rw-r--r--net/ipv4/tcp_hybla.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index fe3ecf484b44..57bdd17dff4d 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -15,7 +15,7 @@
15 15
16/* Tcp Hybla structure. */ 16/* Tcp Hybla structure. */
17struct hybla { 17struct hybla {
18 u8 hybla_en; 18 bool hybla_en;
19 u32 snd_cwnd_cents; /* Keeps increment values when it is <1, <<7 */ 19 u32 snd_cwnd_cents; /* Keeps increment values when it is <1, <<7 */
20 u32 rho; /* Rho parameter, integer part */ 20 u32 rho; /* Rho parameter, integer part */
21 u32 rho2; /* Rho * Rho, integer part */ 21 u32 rho2; /* Rho * Rho, integer part */
@@ -24,8 +24,7 @@ struct hybla {
24 u32 minrtt; /* Minimum smoothed round trip time value seen */ 24 u32 minrtt; /* Minimum smoothed round trip time value seen */
25}; 25};
26 26
27/* Hybla reference round trip time (default= 1/40 sec = 25 ms), 27/* Hybla reference round trip time (default= 1/40 sec = 25 ms), in ms */
28 expressed in jiffies */
29static int rtt0 = 25; 28static int rtt0 = 25;
30module_param(rtt0, int, 0644); 29module_param(rtt0, int, 0644);
31MODULE_PARM_DESC(rtt0, "reference rout trip time (ms)"); 30MODULE_PARM_DESC(rtt0, "reference rout trip time (ms)");
@@ -39,7 +38,7 @@ static inline void hybla_recalc_param (struct sock *sk)
39 ca->rho_3ls = max_t(u32, tcp_sk(sk)->srtt / msecs_to_jiffies(rtt0), 8); 38 ca->rho_3ls = max_t(u32, tcp_sk(sk)->srtt / msecs_to_jiffies(rtt0), 8);
40 ca->rho = ca->rho_3ls >> 3; 39 ca->rho = ca->rho_3ls >> 3;
41 ca->rho2_7ls = (ca->rho_3ls * ca->rho_3ls) << 1; 40 ca->rho2_7ls = (ca->rho_3ls * ca->rho_3ls) << 1;
42 ca->rho2 = ca->rho2_7ls >>7; 41 ca->rho2 = ca->rho2_7ls >> 7;
43} 42}
44 43
45static void hybla_init(struct sock *sk) 44static void hybla_init(struct sock *sk)
@@ -52,7 +51,7 @@ static void hybla_init(struct sock *sk)
52 ca->rho_3ls = 0; 51 ca->rho_3ls = 0;
53 ca->rho2_7ls = 0; 52 ca->rho2_7ls = 0;
54 ca->snd_cwnd_cents = 0; 53 ca->snd_cwnd_cents = 0;
55 ca->hybla_en = 1; 54 ca->hybla_en = true;
56 tp->snd_cwnd = 2; 55 tp->snd_cwnd = 2;
57 tp->snd_cwnd_clamp = 65535; 56 tp->snd_cwnd_clamp = 65535;
58 57
@@ -67,6 +66,7 @@ static void hybla_init(struct sock *sk)
67static void hybla_state(struct sock *sk, u8 ca_state) 66static void hybla_state(struct sock *sk, u8 ca_state)
68{ 67{
69 struct hybla *ca = inet_csk_ca(sk); 68 struct hybla *ca = inet_csk_ca(sk);
69
70 ca->hybla_en = (ca_state == TCP_CA_Open); 70 ca->hybla_en = (ca_state == TCP_CA_Open);
71} 71}
72 72