From: Daniel Borkmann <dborkman@redhat.com>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, Florian Westphal <fw@strlen.de>
Subject: [PATCH iproute2-next] ss: output dctcp diag information
Date: Mon, 29 Sep 2014 10:47:32 +0200 [thread overview]
Message-ID: <1411980452-4669-1-git-send-email-dborkman@redhat.com> (raw)
Dump useful DCTCP state/debug information gathered from diag.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
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 *
--
1.9.0
next reply other threads:[~2014-09-29 8:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 8:47 Daniel Borkmann [this message]
2014-10-30 5:53 ` [PATCH iproute2-next] ss: output dctcp diag information Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411980452-4669-1-git-send-email-dborkman@redhat.com \
--to=dborkman@redhat.com \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).