[PATCH mptcp-next v2] ss: mptcp: print out subflows_total counter

Geliang Tang posted 1 patch 7 months, 2 weeks ago
Failed in applying to current master (apply log)
include/uapi/linux/mptcp.h | 1 +
misc/ss.c                  | 2 ++
2 files changed, 3 insertions(+)
[PATCH mptcp-next v2] ss: mptcp: print out subflows_total counter
Posted by Geliang Tang 7 months, 2 weeks ago
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. This patch prints out it into mptcp_stats output.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 include/uapi/linux/mptcp.h | 1 +
 misc/ss.c                  | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index 159d32f0..c110c183 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -126,6 +126,7 @@ struct mptcp_info {
 	__u64	mptcpi_bytes_sent;
 	__u64	mptcpi_bytes_received;
 	__u64	mptcpi_bytes_acked;
+	__u8	mptcpi_subflows_total;
 };
 
 /*
diff --git a/misc/ss.c b/misc/ss.c
index 2a584015..77fdd6e2 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3271,6 +3271,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,
-- 
2.35.3
Re: [PATCH mptcp-next v2] ss: mptcp: print out subflows_total counter
Posted by Matthieu Baerts 7 months ago
Hi Geliang,

On 15/09/2023 09:45, Geliang Tang wrote:
> 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. This patch prints out it into mptcp_stats output.

Thank you for the patch! It looks good to me:

Acked-by: Matthieu Baerts <matttbe@kernel.org>

I guess this can be sent to iproute-next when the corresponding kernel
patches are in net-next.

Cheers,
Matt