commit | c88d15e74e7bedba260a8ef7ee6920e02182477a | [log] [tgz] |
---|---|---|
author | Eric Dumazet <[email protected]> | Thu Dec 12 20:55:30 2019 |
committer | Commit Bot <[email protected]> | Tue Feb 18 21:41:59 2020 |
tree | 0d1b6088e77c28034195ac4309ac7cabeef34659 | |
parent | 4b69617e187bda6bead0e609bb76a1bba6949896 [diff] |
BACKPORT: tcp: refine tcp_write_queue_empty() implementation Due to how tcp_sendmsg() is implemented, we can have an empty skb at the tail of the write queue. Most [1] tcp_write_queue_empty() callers want to know if there is anything to send (payload and/or FIN) Instead of checking if the sk_write_queue is empty, we need to test if tp->write_seq == tp->snd_nxt [1] tcp_send_fin() was the only caller that expected to see if an skb was in the write queue, I have changed the code to reuse the tcp_write_queue_tail() result. Signed-off-by: Eric Dumazet <[email protected]> Cc: Neal Cardwell <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit ee2aabd3fc2eef4c1a0ebdadccc76fbff74b94fc) Signed-off-by: Xuewei Zhang <[email protected]> BUG=b:145232468 TEST=None Change-Id: I368d8e27b00d6cfb929b2e1b876c96590825eb33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1965628 Reviewed-by: Roy Yang <[email protected]> Commit-Queue: Xuewei Zhang <[email protected]> Tested-by: Xuewei Zhang <[email protected]>