Skip to contentSkip to conversation

tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()

PATCH Applied Nivedita Singhvi 3 participants 3 messages Jan 29, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()

From: Nivedita Singhvi <[email protected]>

We drop a connection request if the accept backlog is full and there are sufficient packets in the syn queue to warrant starting drops. Increment the appropriate counters so this isn't silent, for accurate stats and help in debugging.

This patch assumes LINUX_MIB_LISTENDROPS is a superset of/includes the counter LINUX_MIB_LISTENOVERFLOWS.

---
 net/ipv4/tcp_ipv4.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
net/ipv4/tcp_ipv4.c +4 -1
index bbbdcc5..df8ed59 100644
@@ -1502,8 +1502,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 	 * clogging syn queue with openreqs with exponentially increasing
 	 * timeout.
 	 */
-	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
+	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
+		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
+		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
 		goto drop;
+	}
 
 	req = inet_reqsk_alloc(&tcp_request_sock_ops);
 	if (!req)
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Nivedita Singhvi

From: Nivedita Singhvi <[email protected]>

We drop a connection request if the accept backlog is full and there are sufficient packets in the syn queue to warrant starting drops. Increment the appropriate counters so this isn't silent, for accurate stats and help in debugging.

Quoted 5 lines

This patch assumes LINUX_MIB_LISTENDROPS is a superset of/includes the counter LINUX_MIB_LISTENOVERFLOWS.

---

Thanks !

Please do add version number of patch in subject line and changes since last version in future to avoid confusion. Regards,
Vijay

maintainer Applied
#2 lore raw
In reply to Nivedita Singhvi

From: Nivedita Singhvi <[email protected]>
Date: Mon, 28 Jan 2013 19:52:37 -0800

Quoted 11 lines

From: Nivedita Singhvi <[email protected]>

We drop a connection request if the accept backlog is full and there are sufficient packets in the syn queue to warrant starting drops. Increment the appropriate counters so this isn't silent, for accurate stats and help in debugging.

This patch assumes LINUX_MIB_LISTENDROPS is a superset of/includes the counter LINUX_MIB_LISTENOVERFLOWS.

Applied.