From patchwork Tue Jun 25 20:29:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 254320 X-Patchwork-Delegate: shemminger@vyatta.com 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 A40A02C02BE for ; Wed, 26 Jun 2013 06:29:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752501Ab3FYU3M (ORCPT ); Tue, 25 Jun 2013 16:29:12 -0400 Received: from mail-ee0-f49.google.com ([74.125.83.49]:56307 "EHLO mail-ee0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752152Ab3FYU3F (ORCPT ); Tue, 25 Jun 2013 16:29:05 -0400 Received: by mail-ee0-f49.google.com with SMTP id b57so6922572eek.36 for ; Tue, 25 Jun 2013 13:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version; bh=qL7NAIsGK1f8nLHemIWtkk0g/bJWkvmHLTEXjxnmUnc=; b=vG3Hfxgn/ti/LqtbD7f2KwHoVre9zOwsjtBQ8ljaIdJnkIcFw6Q3PW2YRoys/CWHFJ Iy0t+CK2glw84ZmCg5AaxvXI22VsV54lnNmu8X5XJC7jdojJ60OzXUGXsr0i0x73xjgC oeg0GYmfbl1+pdOpRtxeaYHxYRfPLCyf321uJCSD75rbQV932bC75vKE/PnTDEd4UR8x xM6DPizzMNOJuZlgE2J5I+QPL8Vi/z0MBawEwxDFHlVSPmfHK6xVhkxy2AbmjyBu8/GS ivK0EA9Knmjq0vVNqjM9Nvev283zTXObGwlObLt+JfJ/pNchmmtAVjuNbTJK1JKFPaQD oZqA== X-Received: by 10.15.21.78 with SMTP id c54mr777293eeu.14.1372192144163; Tue, 25 Jun 2013 13:29:04 -0700 (PDT) Received: from [172.28.88.161] ([172.28.88.161]) by mx.google.com with ESMTPSA id n42sm38440597eeh.15.2013.06.25.13.29.02 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 25 Jun 2013 13:29:03 -0700 (PDT) Message-ID: <1372192157.3301.118.camel@edumazet-glaptop> Subject: [PATCH iproute2] ss: add more TCP_INFO components From: Eric Dumazet To: Stephen Hemminger Cc: netdev , Yuchung Cheng , Neal Cardwell Date: Tue, 25 Jun 2013 13:29:17 -0700 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet Allow ss -i to display more TCP informations : unacked:N Number of un-acked packets retrans:X/Y X: number of outstanding retransmit packets Y: total number of retransmits for the session lost:N Number of lost packets (tcpi_lost) sacked:N Number of sacked packets (tcpi_sacked) facked:N Number of facked packets (tcpi_facked) reordering:N Reordering level (if different of 3) Example : $ ss -emoi dst 10.7.7.83 tcp ESTAB 0 1154056 10.7.7.84:54127 10.7.7.83:34342 timer:(on,200ms,0) ino:57003 sk:ffff88063c51d0c0 <-> skmem:(r0,rb89280,t0,tb2097152,f726504,w1436184,o0,bl0) ts sack cubic wscale:7,6 rto:310 rtt:107.375/1 mss:1448 cwnd:568 ssthresh:108 send 61.3Mbps unacked:568 retrans:0/21 reordering:127 rcv_space:29200 Signed-off-by: Eric Dumazet Cc: Yuchung Cheng Cc: Neal Cardwell --- misc/ss.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/misc/ss.c b/misc/ss.c index e0d11ff..c0369f1 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1435,6 +1435,19 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, / rtt)); } + if (info->tcpi_unacked) + printf(" unacked:%u", info->tcpi_unacked); + if (info->tcpi_retrans || info->tcpi_total_retrans) + printf(" retrans:%u/%u", info->tcpi_retrans, + info->tcpi_total_retrans); + if (info->tcpi_lost) + printf(" lost:%u", info->tcpi_lost); + if (info->tcpi_sacked && r->idiag_state != SS_LISTEN) + printf(" sacked:%u", info->tcpi_sacked); + if (info->tcpi_fackets) + printf(" fackets:%u", info->tcpi_fackets); + if (info->tcpi_reordering != 3) + printf(" reordering:%d", info->tcpi_reordering); if (info->tcpi_rcv_rtt) printf(" rcv_rtt:%g", (double) info->tcpi_rcv_rtt/1000); if (info->tcpi_rcv_space)