diff options
author | David S. Miller <davem@davemloft.net> | 2019-04-17 14:26:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-17 14:26:25 -0400 |
commit | 6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b (patch) | |
tree | 0a7976054052e793da782c2b7ec34eccfbf66449 /net/ipv4/tcp_input.c | |
parent | cea0aa9cbd5ad4efe267e9487ed5d48d16756253 (diff) | |
parent | fe5cdef29e41c8bda8cd1a11545e7c6bfe25570e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflict resolution of af_smc.c from Stephen Rothwell.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 6660ce2a7333..97671bff597a 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -402,11 +402,12 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb) | |||
402 | static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) | 402 | static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) |
403 | { | 403 | { |
404 | struct tcp_sock *tp = tcp_sk(sk); | 404 | struct tcp_sock *tp = tcp_sk(sk); |
405 | int room; | ||
406 | |||
407 | room = min_t(int, tp->window_clamp, tcp_space(sk)) - tp->rcv_ssthresh; | ||
405 | 408 | ||
406 | /* Check #1 */ | 409 | /* Check #1 */ |
407 | if (tp->rcv_ssthresh < tp->window_clamp && | 410 | if (room > 0 && !tcp_under_memory_pressure(sk)) { |
408 | (int)tp->rcv_ssthresh < tcp_space(sk) && | ||
409 | !tcp_under_memory_pressure(sk)) { | ||
410 | int incr; | 411 | int incr; |
411 | 412 | ||
412 | /* Check #2. Increase window, if skb with such overhead | 413 | /* Check #2. Increase window, if skb with such overhead |
@@ -419,8 +420,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) | |||
419 | 420 | ||
420 | if (incr) { | 421 | if (incr) { |
421 | incr = max_t(int, incr, 2 * skb->len); | 422 | incr = max_t(int, incr, 2 * skb->len); |
422 | tp->rcv_ssthresh = min(tp->rcv_ssthresh + incr, | 423 | tp->rcv_ssthresh += min(room, incr); |
423 | tp->window_clamp); | ||
424 | inet_csk(sk)->icsk_ack.quick |= 1; | 424 | inet_csk(sk)->icsk_ack.quick |= 1; |
425 | } | 425 | } |
426 | } | 426 | } |