netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tcp: ipv6: Update MIB counters for drops
@ 2013-01-30 22:58 Vijay Subramanian
  2013-01-31  2:18 ` Vijay Subramanian
  0 siblings, 1 reply; 2+ messages in thread
From: Vijay Subramanian @ 2013-01-30 22:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, niveditasinghvi, Vijay Subramanian

This patch updates LINUX_MIB_LISTENDROPS and LINUX_MIB_LISTENOVERFLOWS in
tcp_v6_conn_request() and tcp_v6_err(). tcp_v6_conn_request() in particular can
drop SYNs for various reasons which are not currently tracked.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
Ignored "line over 80 chars" warning for readability.

 net/ipv6/tcp_ipv6.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 93825dd..c85a31c 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -423,6 +423,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 		}
 
 		inet_csk_reqsk_queue_drop(sk, req, prev);
+		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
 		goto out;
 
 	case TCP_SYN_SENT:
@@ -954,12 +955,16 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 
 	if (inet_csk_reqsk_queue_is_full(sk) && !isn) {
 		want_cookie = tcp_syn_flood_action(sk, skb, "TCPv6");
-		if (!want_cookie)
+		if (!want_cookie) {
+			NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
 			goto drop;
+		}
 	}
 
-	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);
 		goto drop;
+	}
 
 	req = inet6_reqsk_alloc(&tcp6_request_sock_ops);
 	if (req == NULL)
@@ -1108,6 +1113,7 @@ drop_and_release:
 drop_and_free:
 	reqsk_free(req);
 drop:
+	NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
 	return 0; /* don't send reset */
 }
 
-- 
1.7.0.4

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

* Re: [PATCH net] tcp: ipv6: Update MIB counters for drops
  2013-01-30 22:58 [PATCH net] tcp: ipv6: Update MIB counters for drops Vijay Subramanian
@ 2013-01-31  2:18 ` Vijay Subramanian
  0 siblings, 0 replies; 2+ messages in thread
From: Vijay Subramanian @ 2013-01-31  2:18 UTC (permalink / raw)
  To: netdev; +Cc: davem, niveditasinghvi, Vijay Subramanian

On 30 January 2013 14:58, Vijay Subramanian <subramanian.vijay@gmail.com> wrote:
> This patch updates LINUX_MIB_LISTENDROPS and LINUX_MIB_LISTENOVERFLOWS in
> tcp_v6_conn_request() and tcp_v6_err(). tcp_v6_conn_request() in particular can
> drop SYNs for various reasons which are not currently tracked.
>
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>


Please drop this too. I will send V2.


Thanks,
Vijay

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

end of thread, other threads:[~2013-01-31  2:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 22:58 [PATCH net] tcp: ipv6: Update MIB counters for drops Vijay Subramanian
2013-01-31  2:18 ` Vijay Subramanian

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