aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorYafang Shao <laoar.shao@gmail.com>2018-06-24 10:02:54 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-25 22:49:08 -0400
commitfb223502ec0889444965f602f57b1f45f9e9845e (patch)
tree08a4895a31a307722691a1f6abdb1e44c658dece /net/ipv4/tcp_input.c
parent7e55052783fd3a9202e9f7c4c480629a7270645f (diff)
tcp: add SNMP counter for zero-window drops
It will be helpful if we could display the drops due to zero window or no enough window space. So a new SNMP MIB entry is added to track this behavior. This entry is named LINUX_MIB_TCPZEROWINDOWDROP and published in /proc/net/netstat in TcpExt line as TCPZeroWindowDrop. Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 76ca88f63b70..9c5b3415413f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4668,8 +4668,10 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
4668 * Out of sequence packets to the out_of_order_queue. 4668 * Out of sequence packets to the out_of_order_queue.
4669 */ 4669 */
4670 if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) { 4670 if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) {
4671 if (tcp_receive_window(tp) == 0) 4671 if (tcp_receive_window(tp) == 0) {
4672 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPZEROWINDOWDROP);
4672 goto out_of_window; 4673 goto out_of_window;
4674 }
4673 4675
4674 /* Ok. In sequence. In window. */ 4676 /* Ok. In sequence. In window. */
4675queue_and_out: 4677queue_and_out:
@@ -4735,8 +4737,10 @@ drop:
4735 /* If window is closed, drop tail of packet. But after 4737 /* If window is closed, drop tail of packet. But after
4736 * remembering D-SACK for its head made in previous line. 4738 * remembering D-SACK for its head made in previous line.
4737 */ 4739 */
4738 if (!tcp_receive_window(tp)) 4740 if (!tcp_receive_window(tp)) {
4741 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPZEROWINDOWDROP);
4739 goto out_of_window; 4742 goto out_of_window;
4743 }
4740 goto queue_and_out; 4744 goto queue_and_out;
4741 } 4745 }
4742 4746