aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_westwood.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:38:13 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:38:13 -0500
commitcb18eccff48ef3986d1072964590bce6fec705fb (patch)
tree777fb1d15e0281341e1e02c9803d989538d346f2 /net/ipv4/tcp_westwood.c
parentc827ba4cb49a30ce581201fd0ba2be77cde412c7 (diff)
parent5ef213f6842277ee1df5659f59fac0ffc9beb411 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (45 commits) [IPV4]: Restore multipath routing after rt_next changes. [XFRM] IPV6: Fix outbound RO transformation which is broken by IPsec tunnel patch. [NET]: Reorder fields of struct dst_entry [DECNET]: Convert decnet route to use the new dst_entry 'next' pointer [IPV6]: Convert ipv6 route to use the new dst_entry 'next' pointer [IPV4]: Convert ipv4 route to use the new dst_entry 'next' pointer [NET]: Introduce union in struct dst_entry to hold 'next' pointer [DECNET]: fix misannotation of linkinfo_dn [DECNET]: FRA_{DST,SRC} are le16 for decnet [UDP]: UDP can use sk_hash to speedup lookups [NET]: Fix whitespace errors. [NET] XFRM: Fix whitespace errors. [NET] X25: Fix whitespace errors. [NET] WANROUTER: Fix whitespace errors. [NET] UNIX: Fix whitespace errors. [NET] TIPC: Fix whitespace errors. [NET] SUNRPC: Fix whitespace errors. [NET] SCTP: Fix whitespace errors. [NET] SCHED: Fix whitespace errors. [NET] RXRPC: Fix whitespace errors. ...
Diffstat (limited to 'net/ipv4/tcp_westwood.c')
-rw-r--r--net/ipv4/tcp_westwood.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
index 4f42a86c77f3..4e1b61032a9c 100644
--- a/net/ipv4/tcp_westwood.c
+++ b/net/ipv4/tcp_westwood.c
@@ -63,10 +63,10 @@ static void tcp_westwood_init(struct sock *sk)
63 struct westwood *w = inet_csk_ca(sk); 63 struct westwood *w = inet_csk_ca(sk);
64 64
65 w->bk = 0; 65 w->bk = 0;
66 w->bw_ns_est = 0; 66 w->bw_ns_est = 0;
67 w->bw_est = 0; 67 w->bw_est = 0;
68 w->accounted = 0; 68 w->accounted = 0;
69 w->cumul_ack = 0; 69 w->cumul_ack = 0;
70 w->reset_rtt_min = 1; 70 w->reset_rtt_min = 1;
71 w->rtt_min = w->rtt = TCP_WESTWOOD_INIT_RTT; 71 w->rtt_min = w->rtt = TCP_WESTWOOD_INIT_RTT;
72 w->rtt_win_sx = tcp_time_stamp; 72 w->rtt_win_sx = tcp_time_stamp;
@@ -121,7 +121,7 @@ static void westwood_update_window(struct sock *sk)
121 * to fix mismatch between tp->snd_una and w->snd_una for the first 121 * to fix mismatch between tp->snd_una and w->snd_una for the first
122 * bandwidth sample 122 * bandwidth sample
123 */ 123 */
124 if (w->first_ack) { 124 if (w->first_ack) {
125 w->snd_una = tcp_sk(sk)->snd_una; 125 w->snd_una = tcp_sk(sk)->snd_una;
126 w->first_ack = 0; 126 w->first_ack = 0;
127 } 127 }
@@ -147,7 +147,7 @@ static inline void update_rtt_min(struct westwood *w)
147{ 147{
148 if (w->reset_rtt_min) { 148 if (w->reset_rtt_min) {
149 w->rtt_min = w->rtt; 149 w->rtt_min = w->rtt;
150 w->reset_rtt_min = 0; 150 w->reset_rtt_min = 0;
151 } else 151 } else
152 w->rtt_min = min(w->rtt, w->rtt_min); 152 w->rtt_min = min(w->rtt, w->rtt_min);
153} 153}
@@ -183,15 +183,15 @@ static inline u32 westwood_acked_count(struct sock *sk)
183 183
184 w->cumul_ack = tp->snd_una - w->snd_una; 184 w->cumul_ack = tp->snd_una - w->snd_una;
185 185
186 /* If cumul_ack is 0 this is a dupack since it's not moving 186 /* If cumul_ack is 0 this is a dupack since it's not moving
187 * tp->snd_una. 187 * tp->snd_una.
188 */ 188 */
189 if (!w->cumul_ack) { 189 if (!w->cumul_ack) {
190 w->accounted += tp->mss_cache; 190 w->accounted += tp->mss_cache;
191 w->cumul_ack = tp->mss_cache; 191 w->cumul_ack = tp->mss_cache;
192 } 192 }
193 193
194 if (w->cumul_ack > tp->mss_cache) { 194 if (w->cumul_ack > tp->mss_cache) {
195 /* Partial or delayed ack */ 195 /* Partial or delayed ack */
196 if (w->accounted >= w->cumul_ack) { 196 if (w->accounted >= w->cumul_ack) {
197 w->accounted -= w->cumul_ack; 197 w->accounted -= w->cumul_ack;
@@ -237,7 +237,7 @@ static void tcp_westwood_event(struct sock *sk, enum tcp_ca_event event)
237 237
238 case CA_EVENT_FRTO: 238 case CA_EVENT_FRTO:
239 tp->snd_ssthresh = tcp_westwood_bw_rttmin(sk); 239 tp->snd_ssthresh = tcp_westwood_bw_rttmin(sk);
240 /* Update RTT_min when next ack arrives */ 240 /* Update RTT_min when next ack arrives */
241 w->reset_rtt_min = 1; 241 w->reset_rtt_min = 1;
242 break; 242 break;
243 243