aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2014-08-30 02:32:05 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-01 21:12:45 -0400
commit688d1945bc89bd585ec67b5b83121f499e6290bb (patch)
tree3138045afe46d72e458c1cfb3dd2552b2acaf915 /net/ipv4
parentd09d3038a336cbab6bde616ce44266c36c214f81 (diff)
tcp: whitespace fixes
Fix places where there is space before tab, long lines, and awkward if(){, double spacing etc. Add blank line after declaration/initialization. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_bic.c11
-rw-r--r--net/ipv4/tcp_cong.c5
-rw-r--r--net/ipv4/tcp_cubic.c18
-rw-r--r--net/ipv4/tcp_diag.c5
-rw-r--r--net/ipv4/tcp_highspeed.c145
-rw-r--r--net/ipv4/tcp_htcp.c6
-rw-r--r--net/ipv4/tcp_hybla.c1
-rw-r--r--net/ipv4/tcp_illinois.c3
-rw-r--r--net/ipv4/tcp_ipv4.c5
-rw-r--r--net/ipv4/tcp_probe.c6
-rw-r--r--net/ipv4/tcp_scalable.c2
-rw-r--r--net/ipv4/tcp_vegas.c3
-rw-r--r--net/ipv4/tcp_veno.c1
-rw-r--r--net/ipv4/tcp_westwood.c7
-rw-r--r--net/ipv4/tcp_yeah.c9
15 files changed, 104 insertions, 123 deletions
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c
index d5de69bc04f5..bb395d46a389 100644
--- a/net/ipv4/tcp_bic.c
+++ b/net/ipv4/tcp_bic.c
@@ -17,7 +17,6 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <net/tcp.h> 18#include <net/tcp.h>
19 19
20
21#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation 20#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation
22 * max_cwnd = snd_cwnd * beta 21 * max_cwnd = snd_cwnd * beta
23 */ 22 */
@@ -46,11 +45,10 @@ MODULE_PARM_DESC(initial_ssthresh, "initial value of slow start threshold");
46module_param(smooth_part, int, 0644); 45module_param(smooth_part, int, 0644);
47MODULE_PARM_DESC(smooth_part, "log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax"); 46MODULE_PARM_DESC(smooth_part, "log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax");
48 47
49
50/* BIC TCP Parameters */ 48/* BIC TCP Parameters */
51struct bictcp { 49struct bictcp {
52 u32 cnt; /* increase cwnd by 1 after ACKs */ 50 u32 cnt; /* increase cwnd by 1 after ACKs */
53 u32 last_max_cwnd; /* last maximum snd_cwnd */ 51 u32 last_max_cwnd; /* last maximum snd_cwnd */
54 u32 loss_cwnd; /* congestion window at last loss */ 52 u32 loss_cwnd; /* congestion window at last loss */
55 u32 last_cwnd; /* the last snd_cwnd */ 53 u32 last_cwnd; /* the last snd_cwnd */
56 u32 last_time; /* time when updated last_cwnd */ 54 u32 last_time; /* time when updated last_cwnd */
@@ -103,7 +101,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
103 101
104 /* binary increase */ 102 /* binary increase */
105 if (cwnd < ca->last_max_cwnd) { 103 if (cwnd < ca->last_max_cwnd) {
106 __u32 dist = (ca->last_max_cwnd - cwnd) 104 __u32 dist = (ca->last_max_cwnd - cwnd)
107 / BICTCP_B; 105 / BICTCP_B;
108 106
109 if (dist > max_increment) 107 if (dist > max_increment)
@@ -154,7 +152,6 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
154 bictcp_update(ca, tp->snd_cwnd); 152 bictcp_update(ca, tp->snd_cwnd);
155 tcp_cong_avoid_ai(tp, ca->cnt); 153 tcp_cong_avoid_ai(tp, ca->cnt);
156 } 154 }
157
158} 155}
159 156
160/* 157/*
@@ -177,7 +174,6 @@ static u32 bictcp_recalc_ssthresh(struct sock *sk)
177 174
178 ca->loss_cwnd = tp->snd_cwnd; 175 ca->loss_cwnd = tp->snd_cwnd;
179 176
180
181 if (tp->snd_cwnd <= low_window) 177 if (tp->snd_cwnd <= low_window)
182 return max(tp->snd_cwnd >> 1U, 2U); 178 return max(tp->snd_cwnd >> 1U, 2U);
183 else 179 else
@@ -188,6 +184,7 @@ static u32 bictcp_undo_cwnd(struct sock *sk)
188{ 184{
189 const struct tcp_sock *tp = tcp_sk(sk); 185 const struct tcp_sock *tp = tcp_sk(sk);
190 const struct bictcp *ca = inet_csk_ca(sk); 186 const struct bictcp *ca = inet_csk_ca(sk);
187
191 return max(tp->snd_cwnd, ca->loss_cwnd); 188 return max(tp->snd_cwnd, ca->loss_cwnd);
192} 189}
193 190
@@ -206,12 +203,12 @@ static void bictcp_acked(struct sock *sk, u32 cnt, s32 rtt)
206 203
207 if (icsk->icsk_ca_state == TCP_CA_Open) { 204 if (icsk->icsk_ca_state == TCP_CA_Open) {
208 struct bictcp *ca = inet_csk_ca(sk); 205 struct bictcp *ca = inet_csk_ca(sk);
206
209 cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT; 207 cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT;
210 ca->delayed_ack += cnt; 208 ca->delayed_ack += cnt;
211 } 209 }
212} 210}
213 211
214
215static struct tcp_congestion_ops bictcp __read_mostly = { 212static struct tcp_congestion_ops bictcp __read_mostly = {
216 .init = bictcp_init, 213 .init = bictcp_init,
217 .ssthresh = bictcp_recalc_ssthresh, 214 .ssthresh = bictcp_recalc_ssthresh,
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 7b09d8b49fa5..80248f56c89f 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -142,7 +142,6 @@ static int __init tcp_congestion_default(void)
142} 142}
143late_initcall(tcp_congestion_default); 143late_initcall(tcp_congestion_default);
144 144
145
146/* Build string with list of available congestion control values */ 145/* Build string with list of available congestion control values */
147void tcp_get_available_congestion_control(char *buf, size_t maxlen) 146void tcp_get_available_congestion_control(char *buf, size_t maxlen)
148{ 147{
@@ -154,7 +153,6 @@ void tcp_get_available_congestion_control(char *buf, size_t maxlen)
154 offs += snprintf(buf + offs, maxlen - offs, 153 offs += snprintf(buf + offs, maxlen - offs,
155 "%s%s", 154 "%s%s",
156 offs == 0 ? "" : " ", ca->name); 155 offs == 0 ? "" : " ", ca->name);
157
158 } 156 }
159 rcu_read_unlock(); 157 rcu_read_unlock();
160} 158}
@@ -186,7 +184,6 @@ void tcp_get_allowed_congestion_control(char *buf, size_t maxlen)
186 offs += snprintf(buf + offs, maxlen - offs, 184 offs += snprintf(buf + offs, maxlen - offs,
187 "%s%s", 185 "%s%s",
188 offs == 0 ? "" : " ", ca->name); 186 offs == 0 ? "" : " ", ca->name);
189
190 } 187 }
191 rcu_read_unlock(); 188 rcu_read_unlock();
192} 189}
@@ -230,7 +227,6 @@ out:
230 return ret; 227 return ret;
231} 228}
232 229
233
234/* Change congestion control for socket */ 230/* Change congestion control for socket */
235int tcp_set_congestion_control(struct sock *sk, const char *name) 231int tcp_set_congestion_control(struct sock *sk, const char *name)
236{ 232{
@@ -337,6 +333,7 @@ EXPORT_SYMBOL_GPL(tcp_reno_cong_avoid);
337u32 tcp_reno_ssthresh(struct sock *sk) 333u32 tcp_reno_ssthresh(struct sock *sk)
338{ 334{
339 const struct tcp_sock *tp = tcp_sk(sk); 335 const struct tcp_sock *tp = tcp_sk(sk);
336
340 return max(tp->snd_cwnd >> 1U, 2U); 337 return max(tp->snd_cwnd >> 1U, 2U);
341} 338}
342EXPORT_SYMBOL_GPL(tcp_reno_ssthresh); 339EXPORT_SYMBOL_GPL(tcp_reno_ssthresh);
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index a9bd8a4828a9..20de0118c98e 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -82,12 +82,13 @@ MODULE_PARM_DESC(hystart_ack_delta, "spacing between ack's indicating train (mse
82/* BIC TCP Parameters */ 82/* BIC TCP Parameters */
83struct bictcp { 83struct bictcp {
84 u32 cnt; /* increase cwnd by 1 after ACKs */ 84 u32 cnt; /* increase cwnd by 1 after ACKs */
85 u32 last_max_cwnd; /* last maximum snd_cwnd */ 85 u32 last_max_cwnd; /* last maximum snd_cwnd */
86 u32 loss_cwnd; /* congestion window at last loss */ 86 u32 loss_cwnd; /* congestion window at last loss */
87 u32 last_cwnd; /* the last snd_cwnd */ 87 u32 last_cwnd; /* the last snd_cwnd */
88 u32 last_time; /* time when updated last_cwnd */ 88 u32 last_time; /* time when updated last_cwnd */
89 u32 bic_origin_point;/* origin point of bic function */ 89 u32 bic_origin_point;/* origin point of bic function */
90 u32 bic_K; /* time to origin point from the beginning of the current epoch */ 90 u32 bic_K; /* time to origin point
91 from the beginning of the current epoch */
91 u32 delay_min; /* min delay (msec << 3) */ 92 u32 delay_min; /* min delay (msec << 3) */
92 u32 epoch_start; /* beginning of an epoch */ 93 u32 epoch_start; /* beginning of an epoch */
93 u32 ack_cnt; /* number of acks */ 94 u32 ack_cnt; /* number of acks */
@@ -219,7 +220,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
219 ca->last_time = tcp_time_stamp; 220 ca->last_time = tcp_time_stamp;
220 221
221 if (ca->epoch_start == 0) { 222 if (ca->epoch_start == 0) {
222 ca->epoch_start = tcp_time_stamp; /* record the beginning of an epoch */ 223 ca->epoch_start = tcp_time_stamp; /* record beginning */
223 ca->ack_cnt = 1; /* start counting */ 224 ca->ack_cnt = 1; /* start counting */
224 ca->tcp_cwnd = cwnd; /* syn with cubic */ 225 ca->tcp_cwnd = cwnd; /* syn with cubic */
225 226
@@ -263,9 +264,9 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
263 264
264 /* c/rtt * (t-K)^3 */ 265 /* c/rtt * (t-K)^3 */
265 delta = (cube_rtt_scale * offs * offs * offs) >> (10+3*BICTCP_HZ); 266 delta = (cube_rtt_scale * offs * offs * offs) >> (10+3*BICTCP_HZ);
266 if (t < ca->bic_K) /* below origin*/ 267 if (t < ca->bic_K) /* below origin*/
267 bic_target = ca->bic_origin_point - delta; 268 bic_target = ca->bic_origin_point - delta;
268 else /* above origin*/ 269 else /* above origin*/
269 bic_target = ca->bic_origin_point + delta; 270 bic_target = ca->bic_origin_point + delta;
270 271
271 /* cubic function - calc bictcp_cnt*/ 272 /* cubic function - calc bictcp_cnt*/
@@ -285,13 +286,14 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
285 /* TCP Friendly */ 286 /* TCP Friendly */
286 if (tcp_friendliness) { 287 if (tcp_friendliness) {
287 u32 scale = beta_scale; 288 u32 scale = beta_scale;
289
288 delta = (cwnd * scale) >> 3; 290 delta = (cwnd * scale) >> 3;
289 while (ca->ack_cnt > delta) { /* update tcp cwnd */ 291 while (ca->ack_cnt > delta) { /* update tcp cwnd */
290 ca->ack_cnt -= delta; 292 ca->ack_cnt -= delta;
291 ca->tcp_cwnd++; 293 ca->tcp_cwnd++;
292 } 294 }
293 295
294 if (ca->tcp_cwnd > cwnd){ /* if bic is slower than tcp */ 296 if (ca->tcp_cwnd > cwnd) { /* if bic is slower than tcp */
295 delta = ca->tcp_cwnd - cwnd; 297 delta = ca->tcp_cwnd - cwnd;
296 max_cnt = cwnd / delta; 298 max_cnt = cwnd / delta;
297 if (ca->cnt > max_cnt) 299 if (ca->cnt > max_cnt)
@@ -320,7 +322,6 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
320 bictcp_update(ca, tp->snd_cwnd); 322 bictcp_update(ca, tp->snd_cwnd);
321 tcp_cong_avoid_ai(tp, ca->cnt); 323 tcp_cong_avoid_ai(tp, ca->cnt);
322 } 324 }
323
324} 325}
325 326
326static u32 bictcp_recalc_ssthresh(struct sock *sk) 327static u32 bictcp_recalc_ssthresh(struct sock *sk)
@@ -452,7 +453,8 @@ static int __init cubictcp_register(void)
452 * based on SRTT of 100ms 453 * based on SRTT of 100ms
453 */ 454 */
454 455
455 beta_scale = 8*(BICTCP_BETA_SCALE+beta)/ 3 / (BICTCP_BETA_SCALE - beta); 456 beta_scale = 8*(BICTCP_BETA_SCALE+beta) / 3
457 / (BICTCP_BETA_SCALE - beta);
456 458
457 cube_rtt_scale = (bic_scale * 10); /* 1024*c/rtt */ 459 cube_rtt_scale = (bic_scale * 10); /* 1024*c/rtt */
458 460
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index ed3f2ad42e0f..0d73f9ddb55b 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/inet_diag.h> 13#include <linux/inet_diag.h>
15 14
@@ -35,13 +34,13 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
35} 34}
36 35
37static void tcp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, 36static void tcp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
38 struct inet_diag_req_v2 *r, struct nlattr *bc) 37 struct inet_diag_req_v2 *r, struct nlattr *bc)
39{ 38{
40 inet_diag_dump_icsk(&tcp_hashinfo, skb, cb, r, bc); 39 inet_diag_dump_icsk(&tcp_hashinfo, skb, cb, r, bc);
41} 40}
42 41
43static int tcp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh, 42static int tcp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
44 struct inet_diag_req_v2 *req) 43 struct inet_diag_req_v2 *req)
45{ 44{
46 return inet_diag_dump_one_icsk(&tcp_hashinfo, in_skb, nlh, req); 45 return inet_diag_dump_one_icsk(&tcp_hashinfo, in_skb, nlh, req);
47} 46}
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c
index 1c4908280d92..882c08aae2f5 100644
--- a/net/ipv4/tcp_highspeed.c
+++ b/net/ipv4/tcp_highspeed.c
@@ -9,7 +9,6 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <net/tcp.h> 10#include <net/tcp.h>
11 11
12
13/* From AIMD tables from RFC 3649 appendix B, 12/* From AIMD tables from RFC 3649 appendix B,
14 * with fixed-point MD scaled <<8. 13 * with fixed-point MD scaled <<8.
15 */ 14 */
@@ -17,78 +16,78 @@ static const struct hstcp_aimd_val {
17 unsigned int cwnd; 16 unsigned int cwnd;
18 unsigned int md; 17 unsigned int md;
19} hstcp_aimd_vals[] = { 18} hstcp_aimd_vals[] = {
20 { 38, 128, /* 0.50 */ }, 19 { 38, 128, /* 0.50 */ },
21 { 118, 112, /* 0.44 */ }, 20 { 118, 112, /* 0.44 */ },
22 { 221, 104, /* 0.41 */ }, 21 { 221, 104, /* 0.41 */ },
23 { 347, 98, /* 0.38 */ }, 22 { 347, 98, /* 0.38 */ },
24 { 495, 93, /* 0.37 */ }, 23 { 495, 93, /* 0.37 */ },
25 { 663, 89, /* 0.35 */ }, 24 { 663, 89, /* 0.35 */ },
26 { 851, 86, /* 0.34 */ }, 25 { 851, 86, /* 0.34 */ },
27 { 1058, 83, /* 0.33 */ }, 26 { 1058, 83, /* 0.33 */ },
28 { 1284, 81, /* 0.32 */ }, 27 { 1284, 81, /* 0.32 */ },
29 { 1529, 78, /* 0.31 */ }, 28 { 1529, 78, /* 0.31 */ },
30 { 1793, 76, /* 0.30 */ }, 29 { 1793, 76, /* 0.30 */ },
31 { 2076, 74, /* 0.29 */ }, 30 { 2076, 74, /* 0.29 */ },
32 { 2378, 72, /* 0.28 */ }, 31 { 2378, 72, /* 0.28 */ },
33 { 2699, 71, /* 0.28 */ }, 32 { 2699, 71, /* 0.28 */ },
34 { 3039, 69, /* 0.27 */ }, 33 { 3039, 69, /* 0.27 */ },
35 { 3399, 68, /* 0.27 */ }, 34 { 3399, 68, /* 0.27 */ },
36 { 3778, 66, /* 0.26 */ }, 35 { 3778, 66, /* 0.26 */ },
37 { 4177, 65, /* 0.26 */ }, 36 { 4177, 65, /* 0.26 */ },
38 { 4596, 64, /* 0.25 */ }, 37 { 4596, 64, /* 0.25 */ },
39 { 5036, 62, /* 0.25 */ }, 38 { 5036, 62, /* 0.25 */ },
40 { 5497, 61, /* 0.24 */ }, 39 { 5497, 61, /* 0.24 */ },
41 { 5979, 60, /* 0.24 */ }, 40 { 5979, 60, /* 0.24 */ },
42 { 6483, 59, /* 0.23 */ }, 41 { 6483, 59, /* 0.23 */ },
43 { 7009, 58, /* 0.23 */ }, 42 { 7009, 58, /* 0.23 */ },
44 { 7558, 57, /* 0.22 */ }, 43 { 7558, 57, /* 0.22 */ },
45 { 8130, 56, /* 0.22 */ }, 44 { 8130, 56, /* 0.22 */ },
46 { 8726, 55, /* 0.22 */ }, 45 { 8726, 55, /* 0.22 */ },
47 { 9346, 54, /* 0.21 */ }, 46 { 9346, 54, /* 0.21 */ },
48 { 9991, 53, /* 0.21 */ }, 47 { 9991, 53, /* 0.21 */ },
49 { 10661, 52, /* 0.21 */ }, 48 { 10661, 52, /* 0.21 */ },
50 { 11358, 52, /* 0.20 */ }, 49 { 11358, 52, /* 0.20 */ },
51 { 12082, 51, /* 0.20 */ }, 50 { 12082, 51, /* 0.20 */ },
52 { 12834, 50, /* 0.20 */ }, 51 { 12834, 50, /* 0.20 */ },
53 { 13614, 49, /* 0.19 */ }, 52 { 13614, 49, /* 0.19 */ },
54 { 14424, 48, /* 0.19 */ }, 53 { 14424, 48, /* 0.19 */ },
55 { 15265, 48, /* 0.19 */ }, 54 { 15265, 48, /* 0.19 */ },
56 { 16137, 47, /* 0.19 */ }, 55 { 16137, 47, /* 0.19 */ },
57 { 17042, 46, /* 0.18 */ }, 56 { 17042, 46, /* 0.18 */ },
58 { 17981, 45, /* 0.18 */ }, 57 { 17981, 45, /* 0.18 */ },
59 { 18955, 45, /* 0.18 */ }, 58 { 18955, 45, /* 0.18 */ },
60 { 19965, 44, /* 0.17 */ }, 59 { 19965, 44, /* 0.17 */ },
61 { 21013, 43, /* 0.17 */ }, 60 { 21013, 43, /* 0.17 */ },
62 { 22101, 43, /* 0.17 */ }, 61 { 22101, 43, /* 0.17 */ },
63 { 23230, 42, /* 0.17 */ }, 62 { 23230, 42, /* 0.17 */ },
64 { 24402, 41, /* 0.16 */ }, 63 { 24402, 41, /* 0.16 */ },
65 { 25618, 41, /* 0.16 */ }, 64 { 25618, 41, /* 0.16 */ },
66 { 26881, 40, /* 0.16 */ }, 65 { 26881, 40, /* 0.16 */ },
67 { 28193, 39, /* 0.16 */ }, 66 { 28193, 39, /* 0.16 */ },
68 { 29557, 39, /* 0.15 */ }, 67 { 29557, 39, /* 0.15 */ },
69 { 30975, 38, /* 0.15 */ }, 68 { 30975, 38, /* 0.15 */ },
70 { 32450, 38, /* 0.15 */ }, 69 { 32450, 38, /* 0.15 */ },
71 { 33986, 37, /* 0.15 */ }, 70 { 33986, 37, /* 0.15 */ },
72 { 35586, 36, /* 0.14 */ }, 71 { 35586, 36, /* 0.14 */ },
73 { 37253, 36, /* 0.14 */ }, 72 { 37253, 36, /* 0.14 */ },
74 { 38992, 35, /* 0.14 */ }, 73 { 38992, 35, /* 0.14 */ },
75 { 40808, 35, /* 0.14 */ }, 74 { 40808, 35, /* 0.14 */ },
76 { 42707, 34, /* 0.13 */ }, 75 { 42707, 34, /* 0.13 */ },
77 { 44694, 33, /* 0.13 */ }, 76 { 44694, 33, /* 0.13 */ },
78 { 46776, 33, /* 0.13 */ }, 77 { 46776, 33, /* 0.13 */ },
79 { 48961, 32, /* 0.13 */ }, 78 { 48961, 32, /* 0.13 */ },
80 { 51258, 32, /* 0.13 */ }, 79 { 51258, 32, /* 0.13 */ },
81 { 53677, 31, /* 0.12 */ }, 80 { 53677, 31, /* 0.12 */ },
82 { 56230, 30, /* 0.12 */ }, 81 { 56230, 30, /* 0.12 */ },
83 { 58932, 30, /* 0.12 */ }, 82 { 58932, 30, /* 0.12 */ },
84 { 61799, 29, /* 0.12 */ }, 83 { 61799, 29, /* 0.12 */ },
85 { 64851, 28, /* 0.11 */ }, 84 { 64851, 28, /* 0.11 */ },
86 { 68113, 28, /* 0.11 */ }, 85 { 68113, 28, /* 0.11 */ },
87 { 71617, 27, /* 0.11 */ }, 86 { 71617, 27, /* 0.11 */ },
88 { 75401, 26, /* 0.10 */ }, 87 { 75401, 26, /* 0.10 */ },
89 { 79517, 26, /* 0.10 */ }, 88 { 79517, 26, /* 0.10 */ },
90 { 84035, 25, /* 0.10 */ }, 89 { 84035, 25, /* 0.10 */ },
91 { 89053, 24, /* 0.10 */ }, 90 { 89053, 24, /* 0.10 */ },
92}; 91};
93 92
94#define HSTCP_AIMD_MAX ARRAY_SIZE(hstcp_aimd_vals) 93#define HSTCP_AIMD_MAX ARRAY_SIZE(hstcp_aimd_vals)
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index 031361311a8b..58469fff6c18 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -98,7 +98,8 @@ static inline void measure_rtt(struct sock *sk, u32 srtt)
98 } 98 }
99} 99}
100 100
101static void measure_achieved_throughput(struct sock *sk, u32 pkts_acked, s32 rtt) 101static void measure_achieved_throughput(struct sock *sk,
102 u32 pkts_acked, s32 rtt)
102{ 103{
103 const struct inet_connection_sock *icsk = inet_csk(sk); 104 const struct inet_connection_sock *icsk = inet_csk(sk);
104 const struct tcp_sock *tp = tcp_sk(sk); 105 const struct tcp_sock *tp = tcp_sk(sk);
@@ -148,8 +149,8 @@ static inline void htcp_beta_update(struct htcp *ca, u32 minRTT, u32 maxRTT)
148 if (use_bandwidth_switch) { 149 if (use_bandwidth_switch) {
149 u32 maxB = ca->maxB; 150 u32 maxB = ca->maxB;
150 u32 old_maxB = ca->old_maxB; 151 u32 old_maxB = ca->old_maxB;
151 ca->old_maxB = ca->maxB;
152 152
153 ca->old_maxB = ca->maxB;
153 if (!between(5 * maxB, 4 * old_maxB, 6 * old_maxB)) { 154 if (!between(5 * maxB, 4 * old_maxB, 6 * old_maxB)) {
154 ca->beta = BETA_MIN; 155 ca->beta = BETA_MIN;
155 ca->modeswitch = 0; 156 ca->modeswitch = 0;
@@ -270,6 +271,7 @@ static void htcp_state(struct sock *sk, u8 new_state)
270 case TCP_CA_Open: 271 case TCP_CA_Open:
271 { 272 {
272 struct htcp *ca = inet_csk_ca(sk); 273 struct htcp *ca = inet_csk_ca(sk);
274
273 if (ca->undo_last_cong) { 275 if (ca->undo_last_cong) {
274 ca->last_cong = jiffies; 276 ca->last_cong = jiffies;
275 ca->undo_last_cong = 0; 277 ca->undo_last_cong = 0;
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index d8f8f05a4951..f963b274f2b0 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -29,7 +29,6 @@ static int rtt0 = 25;
29module_param(rtt0, int, 0644); 29module_param(rtt0, int, 0644);
30MODULE_PARM_DESC(rtt0, "reference rout trip time (ms)"); 30MODULE_PARM_DESC(rtt0, "reference rout trip time (ms)");
31 31
32
33/* This is called to refresh values for hybla parameters */ 32/* This is called to refresh values for hybla parameters */
34static inline void hybla_recalc_param (struct sock *sk) 33static inline void hybla_recalc_param (struct sock *sk)
35{ 34{
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c
index 5999b3972e64..1d5a30a90adf 100644
--- a/net/ipv4/tcp_illinois.c
+++ b/net/ipv4/tcp_illinois.c
@@ -284,7 +284,7 @@ static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, u32 acked)
284 delta = (tp->snd_cwnd_cnt * ca->alpha) >> ALPHA_SHIFT; 284 delta = (tp->snd_cwnd_cnt * ca->alpha) >> ALPHA_SHIFT;
285 if (delta >= tp->snd_cwnd) { 285 if (delta >= tp->snd_cwnd) {
286 tp->snd_cwnd = min(tp->snd_cwnd + delta / tp->snd_cwnd, 286 tp->snd_cwnd = min(tp->snd_cwnd + delta / tp->snd_cwnd,
287 (u32) tp->snd_cwnd_clamp); 287 (u32)tp->snd_cwnd_clamp);
288 tp->snd_cwnd_cnt = 0; 288 tp->snd_cwnd_cnt = 0;
289 } 289 }
290 } 290 }
@@ -299,7 +299,6 @@ static u32 tcp_illinois_ssthresh(struct sock *sk)
299 return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->beta) >> BETA_SHIFT), 2U); 299 return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->beta) >> BETA_SHIFT), 2U);
300} 300}
301 301
302
303/* Extract info for Tcp socket info provided via netlink. */ 302/* Extract info for Tcp socket info provided via netlink. */
304static void tcp_illinois_info(struct sock *sk, u32 ext, 303static void tcp_illinois_info(struct sock *sk, u32 ext,
305 struct sk_buff *skb) 304 struct sk_buff *skb)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index cd17f009aede..487e2a41667f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -90,7 +90,6 @@ int sysctl_tcp_tw_reuse __read_mostly;
90int sysctl_tcp_low_latency __read_mostly; 90int sysctl_tcp_low_latency __read_mostly;
91EXPORT_SYMBOL(sysctl_tcp_low_latency); 91EXPORT_SYMBOL(sysctl_tcp_low_latency);
92 92
93
94#ifdef CONFIG_TCP_MD5SIG 93#ifdef CONFIG_TCP_MD5SIG
95static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key, 94static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key,
96 __be32 daddr, __be32 saddr, const struct tcphdr *th); 95 __be32 daddr, __be32 saddr, const struct tcphdr *th);
@@ -1269,7 +1268,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = {
1269 .send_ack = tcp_v4_reqsk_send_ack, 1268 .send_ack = tcp_v4_reqsk_send_ack,
1270 .destructor = tcp_v4_reqsk_destructor, 1269 .destructor = tcp_v4_reqsk_destructor,
1271 .send_reset = tcp_v4_send_reset, 1270 .send_reset = tcp_v4_send_reset,
1272 .syn_ack_timeout = tcp_syn_ack_timeout, 1271 .syn_ack_timeout = tcp_syn_ack_timeout,
1273}; 1272};
1274 1273
1275static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { 1274static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
@@ -2183,7 +2182,7 @@ int tcp_seq_open(struct inode *inode, struct file *file)
2183 2182
2184 s = ((struct seq_file *)file->private_data)->private; 2183 s = ((struct seq_file *)file->private_data)->private;
2185 s->family = afinfo->family; 2184 s->family = afinfo->family;
2186 s->last_pos = 0; 2185 s->last_pos = 0;
2187 return 0; 2186 return 0;
2188} 2187}
2189EXPORT_SYMBOL(tcp_seq_open); 2188EXPORT_SYMBOL(tcp_seq_open);
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 3b66610d4156..ebf5ff57526e 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -83,7 +83,6 @@ static struct {
83 struct tcp_log *log; 83 struct tcp_log *log;
84} tcp_probe; 84} tcp_probe;
85 85
86
87static inline int tcp_probe_used(void) 86static inline int tcp_probe_used(void)
88{ 87{
89 return (tcp_probe.head - tcp_probe.tail) & (bufsize - 1); 88 return (tcp_probe.head - tcp_probe.tail) & (bufsize - 1);
@@ -101,7 +100,6 @@ static inline int tcp_probe_avail(void)
101 si4.sin_addr.s_addr = inet->inet_##mem##addr; \ 100 si4.sin_addr.s_addr = inet->inet_##mem##addr; \
102 } while (0) \ 101 } while (0) \
103 102
104
105/* 103/*
106 * Hook inserted to be called before each receive packet. 104 * Hook inserted to be called before each receive packet.
107 * Note: arguments must match tcp_rcv_established()! 105 * Note: arguments must match tcp_rcv_established()!
@@ -194,8 +192,8 @@ static int tcpprobe_sprint(char *tbuf, int n)
194 192
195 return scnprintf(tbuf, n, 193 return scnprintf(tbuf, n,
196 "%lu.%09lu %pISpc %pISpc %d %#x %#x %u %u %u %u %u\n", 194 "%lu.%09lu %pISpc %pISpc %d %#x %#x %u %u %u %u %u\n",
197 (unsigned long) tv.tv_sec, 195 (unsigned long)tv.tv_sec,
198 (unsigned long) tv.tv_nsec, 196 (unsigned long)tv.tv_nsec,
199 &p->src, &p->dst, p->length, p->snd_nxt, p->snd_una, 197 &p->src, &p->dst, p->length, p->snd_nxt, p->snd_una,
200 p->snd_cwnd, p->ssthresh, p->snd_wnd, p->srtt, p->rcv_wnd); 198 p->snd_cwnd, p->ssthresh, p->snd_wnd, p->srtt, p->rcv_wnd);
201} 199}
diff --git a/net/ipv4/tcp_scalable.c b/net/ipv4/tcp_scalable.c
index 8250949b8853..6824afb65d93 100644
--- a/net/ipv4/tcp_scalable.c
+++ b/net/ipv4/tcp_scalable.c
@@ -31,10 +31,10 @@ static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 acked)
31static u32 tcp_scalable_ssthresh(struct sock *sk) 31static u32 tcp_scalable_ssthresh(struct sock *sk)
32{ 32{
33 const struct tcp_sock *tp = tcp_sk(sk); 33 const struct tcp_sock *tp = tcp_sk(sk);
34
34 return max(tp->snd_cwnd - (tp->snd_cwnd>>TCP_SCALABLE_MD_SCALE), 2U); 35 return max(tp->snd_cwnd - (tp->snd_cwnd>>TCP_SCALABLE_MD_SCALE), 2U);
35} 36}
36 37
37
38static struct tcp_congestion_ops tcp_scalable __read_mostly = { 38static struct tcp_congestion_ops tcp_scalable __read_mostly = {
39 .ssthresh = tcp_scalable_ssthresh, 39 .ssthresh = tcp_scalable_ssthresh,
40 .cong_avoid = tcp_scalable_cong_avoid, 40 .cong_avoid = tcp_scalable_cong_avoid,
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index b40ad897f945..a6afde666ab1 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -51,7 +51,6 @@ MODULE_PARM_DESC(beta, "upper bound of packets in network");
51module_param(gamma, int, 0644); 51module_param(gamma, int, 0644);
52MODULE_PARM_DESC(gamma, "limit on increase (scale by 2)"); 52MODULE_PARM_DESC(gamma, "limit on increase (scale by 2)");
53 53
54
55/* There are several situations when we must "re-start" Vegas: 54/* There are several situations when we must "re-start" Vegas:
56 * 55 *
57 * o when a connection is established 56 * o when a connection is established
@@ -133,7 +132,6 @@ EXPORT_SYMBOL_GPL(tcp_vegas_pkts_acked);
133 132
134void tcp_vegas_state(struct sock *sk, u8 ca_state) 133void tcp_vegas_state(struct sock *sk, u8 ca_state)
135{ 134{
136
137 if (ca_state == TCP_CA_Open) 135 if (ca_state == TCP_CA_Open)
138 vegas_enable(sk); 136 vegas_enable(sk);
139 else 137 else
@@ -285,7 +283,6 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 acked)
285 /* Use normal slow start */ 283 /* Use normal slow start */
286 else if (tp->snd_cwnd <= tp->snd_ssthresh) 284 else if (tp->snd_cwnd <= tp->snd_ssthresh)
287 tcp_slow_start(tp, acked); 285 tcp_slow_start(tp, acked);
288
289} 286}
290 287
291/* Extract info for Tcp socket info provided via netlink. */ 288/* Extract info for Tcp socket info provided via netlink. */
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 8276977d2c85..a4d2d2d88dca 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -175,7 +175,6 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
175 } else 175 } else
176 tp->snd_cwnd_cnt++; 176 tp->snd_cwnd_cnt++;
177 } 177 }
178
179 } 178 }
180 if (tp->snd_cwnd < 2) 179 if (tp->snd_cwnd < 2)
181 tp->snd_cwnd = 2; 180 tp->snd_cwnd = 2;
diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
index b94a04ae2ed5..81911a92356c 100644
--- a/net/ipv4/tcp_westwood.c
+++ b/net/ipv4/tcp_westwood.c
@@ -42,7 +42,6 @@ struct westwood {
42 u8 reset_rtt_min; /* Reset RTT min to next RTT sample*/ 42 u8 reset_rtt_min; /* Reset RTT min to next RTT sample*/
43}; 43};
44 44
45
46/* TCP Westwood functions and constants */ 45/* TCP Westwood functions and constants */
47#define TCP_WESTWOOD_RTT_MIN (HZ/20) /* 50ms */ 46#define TCP_WESTWOOD_RTT_MIN (HZ/20) /* 50ms */
48#define TCP_WESTWOOD_INIT_RTT (20*HZ) /* maybe too conservative?! */ 47#define TCP_WESTWOOD_INIT_RTT (20*HZ) /* maybe too conservative?! */
@@ -153,7 +152,6 @@ static inline void update_rtt_min(struct westwood *w)
153 w->rtt_min = min(w->rtt, w->rtt_min); 152 w->rtt_min = min(w->rtt, w->rtt_min);
154} 153}
155 154
156
157/* 155/*
158 * @westwood_fast_bw 156 * @westwood_fast_bw
159 * It is called when we are in fast path. In particular it is called when 157 * It is called when we are in fast path. In particular it is called when
@@ -208,7 +206,6 @@ static inline u32 westwood_acked_count(struct sock *sk)
208 return w->cumul_ack; 206 return w->cumul_ack;
209} 207}
210 208
211
212/* 209/*
213 * TCP Westwood 210 * TCP Westwood
214 * Here limit is evaluated as Bw estimation*RTTmin (for obtaining it 211 * Here limit is evaluated as Bw estimation*RTTmin (for obtaining it
@@ -219,6 +216,7 @@ static u32 tcp_westwood_bw_rttmin(const struct sock *sk)
219{ 216{
220 const struct tcp_sock *tp = tcp_sk(sk); 217 const struct tcp_sock *tp = tcp_sk(sk);
221 const struct westwood *w = inet_csk_ca(sk); 218 const struct westwood *w = inet_csk_ca(sk);
219
222 return max_t(u32, (w->bw_est * w->rtt_min) / tp->mss_cache, 2); 220 return max_t(u32, (w->bw_est * w->rtt_min) / tp->mss_cache, 2);
223} 221}
224 222
@@ -254,12 +252,12 @@ static void tcp_westwood_event(struct sock *sk, enum tcp_ca_event event)
254 } 252 }
255} 253}
256 254
257
258/* Extract info for Tcp socket info provided via netlink. */ 255/* Extract info for Tcp socket info provided via netlink. */
259static void tcp_westwood_info(struct sock *sk, u32 ext, 256static void tcp_westwood_info(struct sock *sk, u32 ext,
260 struct sk_buff *skb) 257 struct sk_buff *skb)
261{ 258{
262 const struct westwood *ca = inet_csk_ca(sk); 259 const struct westwood *ca = inet_csk_ca(sk);
260
263 if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) { 261 if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
264 struct tcpvegas_info info = { 262 struct tcpvegas_info info = {
265 .tcpv_enabled = 1, 263 .tcpv_enabled = 1,
@@ -271,7 +269,6 @@ static void tcp_westwood_info(struct sock *sk, u32 ext,
271 } 269 }
272} 270}
273 271
274
275static struct tcp_congestion_ops tcp_westwood __read_mostly = { 272static struct tcp_congestion_ops tcp_westwood __read_mostly = {
276 .init = tcp_westwood_init, 273 .init = tcp_westwood_init,
277 .ssthresh = tcp_reno_ssthresh, 274 .ssthresh = tcp_reno_ssthresh,
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
index 599b79b8eac0..cd7273218598 100644
--- a/net/ipv4/tcp_yeah.c
+++ b/net/ipv4/tcp_yeah.c
@@ -54,10 +54,8 @@ static void tcp_yeah_init(struct sock *sk)
54 /* Ensure the MD arithmetic works. This is somewhat pedantic, 54 /* Ensure the MD arithmetic works. This is somewhat pedantic,
55 * since I don't think we will see a cwnd this large. :) */ 55 * since I don't think we will see a cwnd this large. :) */
56 tp->snd_cwnd_clamp = min_t(u32, tp->snd_cwnd_clamp, 0xffffffff/128); 56 tp->snd_cwnd_clamp = min_t(u32, tp->snd_cwnd_clamp, 0xffffffff/128);
57
58} 57}
59 58
60
61static void tcp_yeah_pkts_acked(struct sock *sk, u32 pkts_acked, s32 rtt_us) 59static void tcp_yeah_pkts_acked(struct sock *sk, u32 pkts_acked, s32 rtt_us)
62{ 60{
63 const struct inet_connection_sock *icsk = inet_csk(sk); 61 const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -84,7 +82,7 @@ static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 acked)
84 /* Scalable */ 82 /* Scalable */
85 83
86 tp->snd_cwnd_cnt += yeah->pkts_acked; 84 tp->snd_cwnd_cnt += yeah->pkts_acked;
87 if (tp->snd_cwnd_cnt > min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT)){ 85 if (tp->snd_cwnd_cnt > min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT)) {
88 if (tp->snd_cwnd < tp->snd_cwnd_clamp) 86 if (tp->snd_cwnd < tp->snd_cwnd_clamp)
89 tp->snd_cwnd++; 87 tp->snd_cwnd++;
90 tp->snd_cwnd_cnt = 0; 88 tp->snd_cwnd_cnt = 0;
@@ -120,7 +118,6 @@ static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 acked)
120 */ 118 */
121 119
122 if (after(ack, yeah->vegas.beg_snd_nxt)) { 120 if (after(ack, yeah->vegas.beg_snd_nxt)) {
123
124 /* We do the Vegas calculations only if we got enough RTT 121 /* We do the Vegas calculations only if we got enough RTT
125 * samples that we can be reasonably sure that we got 122 * samples that we can be reasonably sure that we got
126 * at least one RTT sample that wasn't from a delayed ACK. 123 * at least one RTT sample that wasn't from a delayed ACK.
@@ -189,7 +186,6 @@ static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 acked)
189 } 186 }
190 187
191 yeah->lastQ = queue; 188 yeah->lastQ = queue;
192
193 } 189 }
194 190
195 /* Save the extent of the current window so we can use this 191 /* Save the extent of the current window so we can use this
@@ -205,7 +201,8 @@ static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 acked)
205 } 201 }
206} 202}
207 203
208static u32 tcp_yeah_ssthresh(struct sock *sk) { 204static u32 tcp_yeah_ssthresh(struct sock *sk)
205{
209 const struct tcp_sock *tp = tcp_sk(sk); 206 const struct tcp_sock *tp = tcp_sk(sk);
210 struct yeah *yeah = inet_csk_ca(sk); 207 struct yeah *yeah = inet_csk_ca(sk);
211 u32 reduction; 208 u32 reduction;