diff mbox series

[iproute2-next] ss: mptcp: print out last time counters

Message ID 20240412-upstream-iproute2-next-20240412-mptcp-last-time-info-v1-1-7985c7c395b9@kernel.org (mailing list archive)
State Mainlined, archived
Headers show
Series [iproute2-next] ss: mptcp: print out last time counters | expand

Commit Message

Matthieu Baerts (NGI0) April 12, 2024, 8:19 a.m. UTC
From: Geliang Tang <geliang@kernel.org>

Three new "last time" counters have been added to "struct mptcp_info":
last_data_sent, last_data_recv and last_ack_recv. They have been added
in commit 18d82cde7432 ("mptcp: add last time fields in mptcp_info") in
net-next recently.

This patch prints out these new counters into mptcp_stats output in ss.

Signed-off-by: Geliang Tang <geliang@kernel.org>
Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 include/uapi/linux/mptcp.h | 4 ++++
 misc/ss.c                  | 6 ++++++
 2 files changed, 10 insertions(+)


---
base-commit: 7a6d30c95da98fbb375e7f1520fad34c1e959441
change-id: 20240412-upstream-iproute2-next-20240412-mptcp-last-time-info-da09da8beacc

Best regards,

Comments

David Ahern April 13, 2024, 4:45 p.m. UTC | #1
On 4/12/24 2:19 AM, Matthieu Baerts (NGI0) wrote:
> From: Geliang Tang <geliang@kernel.org>
> 
> Three new "last time" counters have been added to "struct mptcp_info":
> last_data_sent, last_data_recv and last_ack_recv. They have been added
> in commit 18d82cde7432 ("mptcp: add last time fields in mptcp_info") in
> net-next recently.
> 
> This patch prints out these new counters into mptcp_stats output in ss.
> 
> Signed-off-by: Geliang Tang <geliang@kernel.org>
> Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
>  include/uapi/linux/mptcp.h | 4 ++++
>  misc/ss.c                  | 6 ++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
> index c2e6f3be..a0da2632 100644
> --- a/include/uapi/linux/mptcp.h
> +++ b/include/uapi/linux/mptcp.h

uapi headers are synced using scripts, meaning at best uapi updates
should be a separate patch (the updates can also be omitted).

> @@ -56,6 +56,10 @@ struct mptcp_info {
>  	__u64	mptcpi_bytes_received;
>  	__u64	mptcpi_bytes_acked;
>  	__u8	mptcpi_subflows_total;
> +	__u8	reserved[3];
> +	__u32	mptcpi_last_data_sent;
> +	__u32	mptcpi_last_data_recv;
> +	__u32	mptcpi_last_ack_recv;
>  };
>  
>  /* MPTCP Reset reason codes, rfc8684 */
> diff --git a/misc/ss.c b/misc/ss.c
> index 87008d7c..81b813c1 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -3279,6 +3279,12 @@ static void mptcp_stats_print(struct mptcp_info *s)
>  		out(" bytes_acked:%llu", s->mptcpi_bytes_acked);
>  	if (s->mptcpi_subflows_total)
>  		out(" subflows_total:%u", s->mptcpi_subflows_total);
> +	if (s->mptcpi_last_data_sent)
> +		out(" last_data_sent:%u", s->mptcpi_last_data_sent);
> +	if (s->mptcpi_last_data_recv)
> +		out(" last_data_recv:%u", s->mptcpi_last_data_recv);
> +	if (s->mptcpi_last_ack_recv)
> +		out(" last_ack_recv:%u", s->mptcpi_last_ack_recv);
>  }
>  

applied to iproute2-next
Matthieu Baerts (NGI0) April 16, 2024, 7:36 a.m. UTC | #2
Hi David,

On 13/04/2024 18:45, David Ahern wrote:
> On 4/12/24 2:19 AM, Matthieu Baerts (NGI0) wrote:
>> From: Geliang Tang <geliang@kernel.org>
>>
>> Three new "last time" counters have been added to "struct mptcp_info":
>> last_data_sent, last_data_recv and last_ack_recv. They have been added
>> in commit 18d82cde7432 ("mptcp: add last time fields in mptcp_info") in
>> net-next recently.
>>
>> This patch prints out these new counters into mptcp_stats output in ss.
>>
>> Signed-off-by: Geliang Tang <geliang@kernel.org>
>> Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> ---
>>  include/uapi/linux/mptcp.h | 4 ++++
>>  misc/ss.c                  | 6 ++++++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
>> index c2e6f3be..a0da2632 100644
>> --- a/include/uapi/linux/mptcp.h
>> +++ b/include/uapi/linux/mptcp.h
> 
> uapi headers are synced using scripts, meaning at best uapi updates
> should be a separate patch (the updates can also be omitted).

Sorry for that, I didn't know. Thank you for the explanation, noted!

>> @@ -56,6 +56,10 @@ struct mptcp_info {
>>  	__u64	mptcpi_bytes_received;
>>  	__u64	mptcpi_bytes_acked;
>>  	__u8	mptcpi_subflows_total;
>> +	__u8	reserved[3];
>> +	__u32	mptcpi_last_data_sent;
>> +	__u32	mptcpi_last_data_recv;
>> +	__u32	mptcpi_last_ack_recv;
>>  };
>>  
>>  /* MPTCP Reset reason codes, rfc8684 */
>> diff --git a/misc/ss.c b/misc/ss.c
>> index 87008d7c..81b813c1 100644
>> --- a/misc/ss.c
>> +++ b/misc/ss.c
>> @@ -3279,6 +3279,12 @@ static void mptcp_stats_print(struct mptcp_info *s)
>>  		out(" bytes_acked:%llu", s->mptcpi_bytes_acked);
>>  	if (s->mptcpi_subflows_total)
>>  		out(" subflows_total:%u", s->mptcpi_subflows_total);
>> +	if (s->mptcpi_last_data_sent)
>> +		out(" last_data_sent:%u", s->mptcpi_last_data_sent);
>> +	if (s->mptcpi_last_data_recv)
>> +		out(" last_data_recv:%u", s->mptcpi_last_data_recv);
>> +	if (s->mptcpi_last_ack_recv)
>> +		out(" last_ack_recv:%u", s->mptcpi_last_ack_recv);
>>  }
>>  
> 
> applied to iproute2-next
Thank you!

Cheers,
Matt
diff mbox series

Patch

diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index c2e6f3be..a0da2632 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -56,6 +56,10 @@  struct mptcp_info {
 	__u64	mptcpi_bytes_received;
 	__u64	mptcpi_bytes_acked;
 	__u8	mptcpi_subflows_total;
+	__u8	reserved[3];
+	__u32	mptcpi_last_data_sent;
+	__u32	mptcpi_last_data_recv;
+	__u32	mptcpi_last_ack_recv;
 };
 
 /* MPTCP Reset reason codes, rfc8684 */
diff --git a/misc/ss.c b/misc/ss.c
index 87008d7c..81b813c1 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3279,6 +3279,12 @@  static void mptcp_stats_print(struct mptcp_info *s)
 		out(" bytes_acked:%llu", s->mptcpi_bytes_acked);
 	if (s->mptcpi_subflows_total)
 		out(" subflows_total:%u", s->mptcpi_subflows_total);
+	if (s->mptcpi_last_data_sent)
+		out(" last_data_sent:%u", s->mptcpi_last_data_sent);
+	if (s->mptcpi_last_data_recv)
+		out(" last_data_recv:%u", s->mptcpi_last_data_recv);
+	if (s->mptcpi_last_ack_recv)
+		out(" last_ack_recv:%u", s->mptcpi_last_ack_recv);
 }
 
 static void mptcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,