Skip to contentSkip to conversation

ss: mptcp: print out subflows_total counter

PATCH New Geliang Tang 1 participant 1 message Nov 30, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ss: mptcp: print out subflows_total counter

A new counter mptcpi_subflows_total has been added in mptcpi_flags to count the total amount of subflows from mptcp_info including the initial one into kernel in this commit:

6ebf6f90ab4a ("mptcp: add mptcpi_subflows_total counter")

This patch prints out this counter into mptcp_stats output.

---
 include/uapi/linux/mptcp.h | 1 +
 misc/ss.c                  | 2 ++
 2 files changed, 3 insertions(+)
include/uapi/linux/mptcp.h +1 -0
index 99b55575..c2e6f3be 100644
@@ -55,6 +55,7 @@ struct mptcp_info {
 	__u64	mptcpi_bytes_sent;
 	__u64	mptcpi_bytes_received;
 	__u64	mptcpi_bytes_acked;
+	__u8	mptcpi_subflows_total;
 };
 
 /* MPTCP Reset reason codes, rfc8684 */
misc/ss.c +2 -0
index 7e67dbe4..67363ec0 100644
@@ -3239,6 +3239,8 @@ static void mptcp_stats_print(struct mptcp_info *s)
 		out(" bytes_received:%llu", s->mptcpi_bytes_received);
 	if (s->mptcpi_bytes_acked)
 		out(" bytes_acked:%llu", s->mptcpi_bytes_acked);
+	if (s->mptcpi_subflows_total)
+		out(" subflows_total:%u", s->mptcpi_subflows_total);
 }
 
 static void mptcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
Signature · 1 line
2.35.3