[PATCH mptcp-next] ss: mptcp: print no_initial_subflow flag

Geliang Tang posted 1 patch 1 year, 1 month 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] ss: mptcp: print no_initial_subflow flag
Posted by Geliang Tang 1 year, 1 month ago
A new flag MPTCP_INFO_FLAG_NO_INITIAL_SUBFLOW has been added in
mptcpi_flags to know if the initial subflow has been removed. With
this bit, we can then compute the total amount of subflows from
mptcp_info including the initial one.

This patch prints a "no_initial_subflow" info into mptcp_stats output
to show the MPTCP_INFO_FLAG_NO_INITIAL_SUBFLOW has been set.

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..bae24690 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -105,6 +105,7 @@ enum {
 
 #define MPTCP_INFO_FLAG_FALLBACK		_BITUL(0)
 #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED	_BITUL(1)
+#define MPTCP_INFO_FLAG_NO_INITIAL_SUBFLOW	_BITUL(2)
 
 struct mptcp_info {
 	__u8	mptcpi_subflows;
diff --git a/misc/ss.c b/misc/ss.c
index 2a584015..e58f6087 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3247,6 +3247,8 @@ static void mptcp_stats_print(struct mptcp_info *s)
 		out(" fallback");
 	if (s->mptcpi_flags & MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED)
 		out(" remote_key");
+	if (s->mptcpi_flags & MPTCP_INFO_FLAG_NO_INITIAL_SUBFLOW)
+		out(" no_initial_subflow");
 	if (s->mptcpi_token)
 		out(" token:%x", s->mptcpi_token);
 	if (s->mptcpi_write_seq)
-- 
2.35.3