From patchwork Mon Jan 28 01:45:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nivedita Singhvi X-Patchwork-Id: 216094 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 0D0DC2C0093 for ; Mon, 28 Jan 2013 12:51:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757181Ab3A1Bvk (ORCPT ); Sun, 27 Jan 2013 20:51:40 -0500 Received: from mail-gg0-f169.google.com ([209.85.161.169]:40067 "EHLO mail-gg0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756371Ab3A1Bvi (ORCPT ); Sun, 27 Jan 2013 20:51:38 -0500 X-Greylist: delayed 327 seconds by postgrey-1.27 at vger.kernel.org; Sun, 27 Jan 2013 20:51:38 EST Received: by mail-gg0-f169.google.com with SMTP id j5so330005ggn.28 for ; Sun, 27 Jan 2013 17:51:38 -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=W3Sxik0mmGkHVXtZRH6BaM+tBe5f/pSncp3E3IbekNM=; b=YwNBwhQCP7G4qu8T1Y4USL2OebYlyAHZ54itqaIGN03KmYy/0nJAGL6HiLgvaMPiST KL+EPewEROGt/kZRlH/HgHPl4JTchpteKEf8LyCalXUhw9qnL9dX+YnHi+eM+gB8FvBW NQfmowBo5ov2TpVkKMH+vbOF6Kvfr+mMmep8FiWZYH94KC5LW4dLnwXCOH2np/pmW/WG I0e78gbI4RyAiNR3l4sDo3+lklam/vcLdP81q2s89HLjq/e524PLyX0D0jIM220qMeDf bMoTVGnZGwHpsIESKy6GhFme3PONOu8cPnyHzjn/zUH294UctfRjS08kScv2t1hECHWX 0DKQ== X-Received: by 10.100.76.16 with SMTP id y16mr366329ana.40.1359337570942; Sun, 27 Jan 2013 17:46:10 -0800 (PST) Received: from localhost.localdomain ([66.184.211.226]) by mx.google.com with ESMTPS id s1sm7575733anj.1.2013.01.27.17.46.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Jan 2013 17:46:09 -0800 (PST) From: Nivedita Singhvi To: netdev@vger.kernel.org, David Miller Cc: Vijay Subramanian , Nivedita Singhvi Subject: [PATCH] [PATCH] tcp: Increment of LINUX_MIB_LISTENOVERFLOWS in tcp_v4_conn_request() (updated) Date: Sun, 27 Jan 2013 17:45:50 -0800 Message-Id: <1359337550-3958-1-git-send-email-niveditasinghvi@gmail.com> X-Mailer: git-send-email 1.7.5.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nivedita Singhvi 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 counter so this isn't silent, for accurate stats and help in debugging. Signed-off-by: Nivedita Singhvi Acked-by: Vijay Subramanian --- net/ipv4/tcp_ipv4.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index bbbdcc5..49b4f50 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1502,8 +1502,10 @@ 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); goto drop; + } req = inet_reqsk_alloc(&tcp_request_sock_ops); if (!req)