Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1714864

Re: [PATCH net-next] tcp: export drops counter to /proc/net/tcp{,6}

Path csiph.com!news.redatomik.org!news.albasani.net!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next] tcp: export drops counter to /proc/net/tcp{,6}
Date Fri, 18 Aug 2017 14:20:02 +0200
Message-ID <ufOpQ-3Ax-11@gated-at.bofh.it> (permalink)
References <ufMHo-2h0-17@gated-at.bofh.it>
X-Original-To Stéphan Gorget <sgorget@fb.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=jylRJ0TKniWXmmnn28pbwgBMhG2myKX+NVS0Y/Qzd6I=; b=H+jHfB/WUBiiNUnFJFTIVdIpKvvOnjFEyIRLD3T0pPsUkHE72JmGcjM+Us42kKwT1R Y9BYMTELm9utZiIotd5DbD47Sj/tnKYTzkkYQ+XQtXYIn458ziB61/db1Mix+lzQiA0f N115Btz+r0wNADxT9RX43yojjh9wCr0Zvy5ezbPKZmyhAWnID9n8q0H4dZ7yolZ7EbG/ jyXJOXRRozpa9VeFChH3eloyIt8dato/1Ku8fMQPvg7sOJM2U3Xvt3GZjV/39DPJ7Wgb s28l29a06EyZLNnXmY2qWcqt7fVFaudlDGOSG6Vzssvi/VezCPnimomdBt1q6rnkbTUS 3Kxg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=jylRJ0TKniWXmmnn28pbwgBMhG2myKX+NVS0Y/Qzd6I=; b=ka3e3bYgek3bGkYdYqy3wrNt/p3xiD6pZomT86JzubSjXGdXd9WwQ76uf0K9O8CPcC 3mTENjsNW1m/GuEK4yN8VGusbtJQwv/FrWNgJz+GQm5WScmCrgdBvjrTzx5VZRTwjs8o Ubde3rVmllWHyvTpjrOWrHTnac2DuahEfhtIyCaRUZlyWHRjwxVBaS5PD7aKUaJAZ2xI Zl2EZfv+l5AFaKXDtl1y/KWtD2SSc6tMQLFoYbgwQY+KGg84CISuFu4xj+TPWZT1Rfrc CBsDq0Rz9NRocI5vVYPPFv7uOLGQJ0dTo3+/Hq6zD13ZTx1IPw0ebAE5HIaCvfOnvPTZ spTQ==
X-Gm-Message-State AHYfb5gtf6kfR9Gd1soVcma1WgWF73oeIIDtaGMCJASnyaMMTcTVB8bS ty1a5QgFXc+fYA==
X-Received by 10.84.211.7 with SMTP id b7mr3707074pli.382.1503058448037; Fri, 18 Aug 2017 05:14:08 -0700 (PDT)
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.10.4-0ubuntu2
MIME-Version 1.0
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 83
Organization linux.* mail to news gateway
X-Original-Cc netdev@vger.kernel.org, Jeethu Rao <jeethu@fb.com>, "David S . Miller" <davem@davemloft.net>, Alexei Starovoitov <ast@fb.com>, Eric Dumazet <edumazet@google.com>, kernel-team@fb.com, linux-kernel@vger.kernel.org
X-Original-Date Fri, 18 Aug 2017 05:14:04 -0700
X-Original-Message-ID <1503058444.4936.169.camel@edumazet-glaptop3.roam.corp.google.com>
X-Original-References <20170818102135.266832-1-sgorget@fb.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1714864

Show key headers only | View raw


On Fri, 2017-08-18 at 03:21 -0700, Stéphan Gorget wrote:
> Those counters are exported for raw and udp but not for tcp, though they
> are incremented.
> 
> An example where it is useful is chasing listen overflow. Listen overflow
> are counted as a global counter in LINUX_MIB_LISTENOVERFLOWS accessible
> in /proc/net/netstat but there is no way to find related drops in the
> information exported for tcp. With this patch it will make possible to
> correlate growth of LINUX_MIB_LISTENOVERFLOWS with growth of drops for
> a tcp socket.

Hi Stéphan.

Eons ago, the decision was taken to declare /proc interface frozen.

In linux-4.7 I provided all the information you need using the modern
inet_diag interface, [1]

Simply use iproute2/ss tool to access this information in a very
efficient way (like filtering done in the kernel, instead having to
parse a gigantic /proc output)

lpaa5:~# ss -tm state listening src :22
Recv-Q Send-Q Local Address:Port                 Peer Address:Port                
0      128             *:ssh                           *:*                    
	 skmem:(r0,rb8388608,t0,tb8388608,f0,w0,o0,bl0,d7)
0      128            :::ssh                          :::*                    
	 skmem:(r0,rb8388608,t0,tb8388608,f0,w0,o0,bl0,d0)

You can see here that the IPv4 listener for ssh had 7 drops.

Thanks.

[1] list of relevant commits.

commit 9caad864151e525929d323de96cad382da49c3b2
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri Apr 1 08:52:20 2016 -0700

    tcp: increment sk_drops for listeners
    
    Goal: packets dropped by a listener are accounted for.
    
    This adds tcp_listendrop() helper, and clears sk_drops in sk_clone_lock()
    so that children do not inherit their parent drop count.
    
    Note that we no longer increment LINUX_MIB_LISTENDROPS counter when
    sending a SYNCOOKIE, since the SYN packet generated a SYNACK.
    We already have a separate LINUX_MIB_SYNCOOKIESSENT
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 532182cd610782db8c18230c2747626562032205
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri Apr 1 08:52:19 2016 -0700

    tcp: increment sk_drops for dropped rx packets
    
    Now ss can report sk_drops, we can instruct TCP to increment
    this per socket counter when it drops an incoming frame, to refine
    monitoring and debugging.
    
    Following patch takes care of listeners drops.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 15239302edd46b184e758048253541fb211e315e
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri Apr 1 08:52:18 2016 -0700

    sock_diag: add SK_MEMINFO_DROPS
    
    Reporting sk_drops to user space was available for UDP
    sockets using /proc interface.
    
    Add this to sock_diag, so that we can have the same information
    available to ss users, and we'll be able to add sk_drops
    indications for TCP sockets as well.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH net-next] tcp: export drops counter to /proc/net/tcp{,6} Stéphan Gorget <sgorget@fb.com> - 2017-08-18 12:30 +0200
  Re: [PATCH net-next] tcp: export drops counter to /proc/net/tcp{,6} Eric Dumazet <eric.dumazet@gmail.com> - 2017-08-18 14:20 +0200

csiph-web