X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=net%2Fipv4%2Ftcp_output.c;h=f0723460753c5d035022ce705a8ba533ce9ab2b8;hb=f921a4a5bffa8a0005b190fb9421a7fc1fd716b6;hp=bbd85672fda70c8de259471311bf46fe5171c905;hpb=a0ca6b9dfef0b3cc83aa8bb485ed61a018f84982;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index bbd8567..f0723460 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2542,6 +2542,18 @@ static bool tcp_pacing_check(struct sock *sk) return true; } +static bool tcp_rtx_queue_empty_or_single_skb(const struct sock *sk) +{ + const struct rb_node *node = sk->tcp_rtx_queue.rb_node; + + /* No skb in the rtx queue. */ + if (!node) + return true; + + /* Only one skb in rtx queue. */ + return !node->rb_left && !node->rb_right; +} + /* TCP Small Queues : * Control number of packets in qdisc/devices to two packets / or ~1 ms. * (These limits are doubled for retransmits) @@ -2579,12 +2591,12 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb, limit += extra_bytes; } if (refcount_read(&sk->sk_wmem_alloc) > limit) { - /* Always send skb if rtx queue is empty. + /* Always send skb if rtx queue is empty or has one skb. * No need to wait for TX completion to call us back, * after softirq/tasklet schedule. * This helps when TX completions are delayed too much. */ - if (tcp_rtx_queue_empty(sk)) + if (tcp_rtx_queue_empty_or_single_skb(sk)) return false; set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags);