From patchwork Mon Sep 29 08:47:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 394307 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 07D4A1400AA for ; Mon, 29 Sep 2014 18:47:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbaI2Irj (ORCPT ); Mon, 29 Sep 2014 04:47:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57977 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbaI2Irj (ORCPT ); Mon, 29 Sep 2014 04:47:39 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8T8lYHJ011897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Sep 2014 04:47:34 -0400 Received: from localhost (vpn1-5-69.ams2.redhat.com [10.36.5.69]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8T8lWwP028622; Mon, 29 Sep 2014 04:47:33 -0400 From: Daniel Borkmann To: stephen@networkplumber.org Cc: netdev@vger.kernel.org, Florian Westphal Subject: [PATCH iproute2-next] ss: output dctcp diag information Date: Mon, 29 Sep 2014 10:47:32 +0200 Message-Id: <1411980452-4669-1-git-send-email-dborkman@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Dump useful DCTCP state/debug information gathered from diag. Signed-off-by: Daniel Borkmann Signed-off-by: Florian Westphal --- include/linux/inet_diag.h | 13 +++++++++++-- misc/ss.c | 13 +++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h index e34f247..7438dad 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h @@ -110,10 +110,10 @@ enum { INET_DIAG_TCLASS, INET_DIAG_SKMEMINFO, INET_DIAG_SHUTDOWN, + INET_DIAG_DCTCPINFO, }; -#define INET_DIAG_MAX INET_DIAG_SHUTDOWN - +#define INET_DIAG_MAX INET_DIAG_DCTCPINFO /* INET_DIAG_MEM */ @@ -133,5 +133,14 @@ struct tcpvegas_info { __u32 tcpv_minrtt; }; +/* INET_DIAG_DCTCPINFO */ + +struct tcp_dctcp_info { + __u16 dctcp_enabled; + __u16 dctcp_ce_state; + __u32 dctcp_alpha; + __u32 dctcp_ab_ecn; + __u32 dctcp_ab_tot; +}; #endif /* _INET_DIAG_H_ */ diff --git a/misc/ss.c b/misc/ss.c index c847954..f5019e1 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1576,6 +1576,19 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, rtt = vinfo->tcpv_rtt; } + if (tb[INET_DIAG_DCTCPINFO]) { + const struct tcp_dctcp_info *dinfo + = RTA_DATA(tb[INET_DIAG_DCTCPINFO]); + + if (dinfo->dctcp_enabled) { + printf(" ce_state %u alpha %u ab_ecn %u ab_tot %u", + dinfo->dctcp_ce_state, dinfo->dctcp_alpha, + dinfo->dctcp_ab_ecn, dinfo->dctcp_ab_tot); + } else { + printf(" fallback_mode"); + } + } + if (rtt > 0 && info->tcpi_snd_mss && info->tcpi_snd_cwnd) { printf(" send %sbps", sprint_bw(b1, (double) info->tcpi_snd_cwnd *