netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()
@ 2013-01-29  3:52 Nivedita Singhvi
  2013-01-29  6:16 ` Vijay Subramanian
  2013-01-29 20:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Nivedita Singhvi @ 2013-01-29  3:52 UTC (permalink / raw)
  To: netdev, David Miller; +Cc: Vijay Subramanian, Nivedita Singhvi

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(-)

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)
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()
  2013-01-29  3:52 [PATCH] tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request() Nivedita Singhvi
@ 2013-01-29  6:16 ` Vijay Subramanian
  2013-01-29 20:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Vijay Subramanian @ 2013-01-29  6:16 UTC (permalink / raw)
  To: Nivedita Singhvi; +Cc: netdev, David Miller, Nivedita Singhvi

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request()
  2013-01-29  3:52 [PATCH] tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request() Nivedita Singhvi
  2013-01-29  6:16 ` Vijay Subramanian
@ 2013-01-29 20:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-01-29 20:46 UTC (permalink / raw)
  To: niveditasinghvi; +Cc: netdev, subramanian.vijay, niv

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-29 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29  3:52 [PATCH] tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request() Nivedita Singhvi
2013-01-29  6:16 ` Vijay Subramanian
2013-01-29 20:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).