diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 3c59ab42df2b..0d4a3cebfb46 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1512,6 +1512,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
1512 | struct tcp_sock *tp = tcp_sk(sk); | 1512 | struct tcp_sock *tp = tcp_sk(sk); |
1513 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1513 | const struct inet_connection_sock *icsk = inet_csk(sk); |
1514 | u32 send_win, cong_win, limit, in_flight; | 1514 | u32 send_win, cong_win, limit, in_flight; |
1515 | int win_divisor; | ||
1515 | 1516 | ||
1516 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) | 1517 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) |
1517 | goto send_now; | 1518 | goto send_now; |
@@ -1543,13 +1544,14 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
1543 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) | 1544 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) |
1544 | goto send_now; | 1545 | goto send_now; |
1545 | 1546 | ||
1546 | if (sysctl_tcp_tso_win_divisor) { | 1547 | win_divisor = ACCESS_ONCE(sysctl_tcp_tso_win_divisor); |
1548 | if (win_divisor) { | ||
1547 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); | 1549 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); |
1548 | 1550 | ||
1549 | /* If at least some fraction of a window is available, | 1551 | /* If at least some fraction of a window is available, |
1550 | * just use it. | 1552 | * just use it. |
1551 | */ | 1553 | */ |
1552 | chunk /= sysctl_tcp_tso_win_divisor; | 1554 | chunk /= win_divisor; |
1553 | if (limit >= chunk) | 1555 | if (limit >= chunk) |
1554 | goto send_now; | 1556 | goto send_now; |
1555 | } else { | 1557 | } else { |