From patchwork Thu Jan 31 18:24:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Subramanian X-Patchwork-Id: 217233 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 10A3F2C008D for ; Fri, 1 Feb 2013 05:24:22 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755132Ab3AaSYS (ORCPT ); Thu, 31 Jan 2013 13:24:18 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:47244 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752930Ab3AaSYQ (ORCPT ); Thu, 31 Jan 2013 13:24:16 -0500 Received: by mail-pb0-f47.google.com with SMTP id rp8so1730559pbb.20 for ; Thu, 31 Jan 2013 10:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=mXaWZtMvIFd1HA7cutDSgK7hNl08s61jxo3kpGSI4wI=; b=IZjT+xLjF5wShFz1YjtFwcySBvPoV9KBM5mbjmpcBdxTCDHUJxqAsDuMlBftWnl3xf 0REt8n+HYDaAGfN0ywQ1AwLCYEEzmM1wyrONpLPgiZqJdH2QCsjL18fUHyHtczeaJYQD 4NHkEG9+wTc10PR+ibXzUQDCrS9SjFxoGCktZMzubn0Vyb2oNuLBl8WbC588RLC+XF09 IAr6aqsTGzXcwlAnWvdw258rHYbNjUXH01I/I7eaVy2CC1PeFf8NPZSrkkMI6BnDSu+q 4VVU+da1Pqt6uMQvSbY0Z2bs5MNZ4CfLFLUGZSy3TQd37Kr03G+BWVexYFdf4shX6/km /9WA== X-Received: by 10.68.234.105 with SMTP id ud9mr24388824pbc.107.1359656655283; Thu, 31 Jan 2013 10:24:15 -0800 (PST) Received: from localhost.localdomain (c-50-136-206-76.hsd1.ca.comcast.net. [50.136.206.76]) by mx.google.com with ESMTPS id t7sm2740295pax.17.2013.01.31.10.24.13 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 31 Jan 2013 10:24:13 -0800 (PST) From: Vijay Subramanian To: netdev@vger.kernel.org Cc: davem@davemloft.net, eric.dumazet@gmail.com, niveditasinghvi@gmail.com, Vijay Subramanian Subject: [PATCH net v2] tcp: Update MIB counters for drops Date: Thu, 31 Jan 2013 10:24:06 -0800 Message-Id: <1359656646-29339-1-git-send-email-subramanian.vijay@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch updates LINUX_MIB_LISTENDROPS in tcp_v4_conn_request() and tcp_v4_err(). tcp_v4_conn_request() in particular can drop SYNs for various reasons which are not currently tracked. Signed-off-by: Vijay Subramanian --- Changes from V1: Removed one needless update to ListenOverflows. net/ipv4/tcp_ipv4.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 629937d..eadb693 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -496,6 +496,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) * errors returned from accept(). */ inet_csk_reqsk_queue_drop(sk, req, prev); + NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); goto out; case TCP_SYN_SENT: @@ -1502,7 +1503,6 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) */ 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; } @@ -1669,6 +1669,7 @@ drop_and_release: drop_and_free: reqsk_free(req); drop: + NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); return 0; } EXPORT_SYMBOL(tcp_v4_conn_request);