diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-08 16:15:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-08 16:47:38 -0500 |
commit | fe6c791570efe717946ea7b7dd50aec96b70d551 (patch) | |
tree | 1becb5e8aea7a9c9a7d78f987bd73b0a5d8ee434 /net/ipv4/tcp_output.c | |
parent | f8bf5681cf15f77692c8ad8cb95d059ff7c622c9 (diff) | |
parent | f19872575ff7819a3723154657a497d9bca66b33 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
net/llc/af_llc.c
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 749b6498588e..97041f24cd27 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -231,11 +231,10 @@ void tcp_select_initial_window(int __space, __u32 mss, | |||
231 | /* when initializing use the value from init_rcv_wnd | 231 | /* when initializing use the value from init_rcv_wnd |
232 | * rather than the default from above | 232 | * rather than the default from above |
233 | */ | 233 | */ |
234 | if (init_rcv_wnd && | 234 | if (init_rcv_wnd) |
235 | (*rcv_wnd > init_rcv_wnd * mss)) | 235 | *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss); |
236 | *rcv_wnd = init_rcv_wnd * mss; | 236 | else |
237 | else if (*rcv_wnd > init_cwnd * mss) | 237 | *rcv_wnd = min(*rcv_wnd, init_cwnd * mss); |
238 | *rcv_wnd = init_cwnd * mss; | ||
239 | } | 238 | } |
240 | 239 | ||
241 | /* Set the clamp no higher than max representable value */ | 240 | /* Set the clamp no higher than max representable value */ |
@@ -386,27 +385,30 @@ struct tcp_out_options { | |||
386 | */ | 385 | */ |
387 | static u8 tcp_cookie_size_check(u8 desired) | 386 | static u8 tcp_cookie_size_check(u8 desired) |
388 | { | 387 | { |
389 | if (desired > 0) { | 388 | int cookie_size; |
389 | |||
390 | if (desired > 0) | ||
390 | /* previously specified */ | 391 | /* previously specified */ |
391 | return desired; | 392 | return desired; |
392 | } | 393 | |
393 | if (sysctl_tcp_cookie_size <= 0) { | 394 | cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size); |
395 | if (cookie_size <= 0) | ||
394 | /* no default specified */ | 396 | /* no default specified */ |
395 | return 0; | 397 | return 0; |
396 | } | 398 | |
397 | if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) { | 399 | if (cookie_size <= TCP_COOKIE_MIN) |
398 | /* value too small, specify minimum */ | 400 | /* value too small, specify minimum */ |
399 | return TCP_COOKIE_MIN; | 401 | return TCP_COOKIE_MIN; |
400 | } | 402 | |
401 | if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) { | 403 | if (cookie_size >= TCP_COOKIE_MAX) |
402 | /* value too large, specify maximum */ | 404 | /* value too large, specify maximum */ |
403 | return TCP_COOKIE_MAX; | 405 | return TCP_COOKIE_MAX; |
404 | } | 406 | |
405 | if (0x1 & sysctl_tcp_cookie_size) { | 407 | if (cookie_size & 1) |
406 | /* 8-bit multiple, illegal, fix it */ | 408 | /* 8-bit multiple, illegal, fix it */ |
407 | return (u8)(sysctl_tcp_cookie_size + 0x1); | 409 | cookie_size++; |
408 | } | 410 | |
409 | return (u8)sysctl_tcp_cookie_size; | 411 | return (u8)cookie_size; |
410 | } | 412 | } |
411 | 413 | ||
412 | /* Write previously computed TCP options to the packet. | 414 | /* Write previously computed TCP options to the packet. |
@@ -1516,6 +1518,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
1516 | struct tcp_sock *tp = tcp_sk(sk); | 1518 | struct tcp_sock *tp = tcp_sk(sk); |
1517 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1519 | const struct inet_connection_sock *icsk = inet_csk(sk); |
1518 | u32 send_win, cong_win, limit, in_flight; | 1520 | u32 send_win, cong_win, limit, in_flight; |
1521 | int win_divisor; | ||
1519 | 1522 | ||
1520 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) | 1523 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) |
1521 | goto send_now; | 1524 | goto send_now; |
@@ -1547,13 +1550,14 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
1547 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) | 1550 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) |
1548 | goto send_now; | 1551 | goto send_now; |
1549 | 1552 | ||
1550 | if (sysctl_tcp_tso_win_divisor) { | 1553 | win_divisor = ACCESS_ONCE(sysctl_tcp_tso_win_divisor); |
1554 | if (win_divisor) { | ||
1551 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); | 1555 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); |
1552 | 1556 | ||
1553 | /* If at least some fraction of a window is available, | 1557 | /* If at least some fraction of a window is available, |
1554 | * just use it. | 1558 | * just use it. |
1555 | */ | 1559 | */ |
1556 | chunk /= sysctl_tcp_tso_win_divisor; | 1560 | chunk /= win_divisor; |
1557 | if (limit >= chunk) | 1561 | if (limit >= chunk) |
1558 | goto send_now; | 1562 | goto send_now; |
1559 | } else { | 1563 | } else { |