diff mbox

tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()

Message ID 1359431557-4587-1-git-send-email-niveditasinghvi@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Nivedita Singhvi Jan. 29, 2013, 3:52 a.m. UTC
From: Nivedita Singhvi <niv@us.ibm.com>

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.

Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
---
 net/ipv4/tcp_ipv4.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Vijay Subramanian Jan. 29, 2013, 6:16 a.m. UTC | #1
On 28 January 2013 19:52, Nivedita Singhvi <niveditasinghvi@gmail.com> wrote:
> From: Nivedita Singhvi <niv@us.ibm.com>
>
> 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.
>
> Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
> ---

Thanks !

Acked-by: Vijay Subramanian <subramanian.vijay@gmail.com>

Please do add version number of patch in subject line and changes
since last version in future to avoid confusion.
Regards,
Vijay
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 29, 2013, 8:46 p.m. UTC | #2
From: Nivedita Singhvi <niveditasinghvi@gmail.com>
Date: Mon, 28 Jan 2013 19:52:37 -0800

> From: Nivedita Singhvi <niv@us.ibm.com>
> 
> 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.
> 
> Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index bbbdcc5..df8ed59 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -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)