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

Geliang Tang posted 1 patch 1 month ago
Failed in applying to current master (apply log)
There is a newer version of this series
include/uapi/linux/mptcp.h | 4 ++++
misc/ss.c                  | 6 ++++++
2 files changed, 10 insertions(+)
[PATCH iproute2-next] ss: mptcp: print out last time counters
Posted by Geliang Tang 1 month ago
There new last time counters have been added in struct mptcp_info named
last_data_sent, last_data_recv and last_ack_recv into kernel in the commit
"mptcp: add last time fields in mptcp_info".

This patch prints out these counters into mptcp_stats output.

Signed-off-by: Geliang Tang <geliang@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
@@ -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,
-- 
2.40.1
Re: [PATCH iproute2-next] ss: mptcp: print out last time counters
Posted by Matthieu Baerts 1 month ago
Hi Geliang,

On 29/03/2024 10:42, Geliang Tang wrote:
> There new last time counters have been added in struct mptcp_info named

(I guess we can remove the "There" here above)

> last_data_sent, last_data_recv and last_ack_recv into kernel in the commit
> "mptcp: add last time fields in mptcp_info".
> 
> This patch prints out these counters into mptcp_stats output.

Thank you for this patch!

It looks good to me.

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

Of course, we will need to wait for the kernel patch to be in our tree,
then in net-next, before sending this one to IPRoute2 maintainers.

(if the kernel structure doesn't change in between)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH iproute2-next] ss: mptcp: print out last time counters
Posted by Matthieu Baerts 3 weeks ago
Hi Geliang,

On 29/03/2024 16:01, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 29/03/2024 10:42, Geliang Tang wrote:
>> There new last time counters have been added in struct mptcp_info named
> 
> (I guess we can remove the "There" here above)
> 
>> last_data_sent, last_data_recv and last_ack_recv into kernel in the commit
>> "mptcp: add last time fields in mptcp_info".
>>
>> This patch prints out these counters into mptcp_stats output.
> 
> Thank you for this patch!
> 
> It looks good to me.
> 
> Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> 
> Of course, we will need to wait for the kernel patch to be in our tree,
> then in net-next, before sending this one to IPRoute2 maintainers.

The kernel patch has been applied in net-next. Do you want to send this
patch to IPRoute2 maintainers, or do you prefer if I do that?

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH iproute2-next] ss: mptcp: print out last time counters
Posted by Geliang Tang 2 weeks, 6 days ago
Hi Matt,

On Thu, 2024-04-11 at 19:33 +0200, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 29/03/2024 16:01, Matthieu Baerts wrote:
> > Hi Geliang,
> > 
> > On 29/03/2024 10:42, Geliang Tang wrote:
> > > There new last time counters have been added in struct mptcp_info
> > > named
> > 
> > (I guess we can remove the "There" here above)

It should be "Three".

> > 
> > > last_data_sent, last_data_recv and last_ack_recv into kernel in
> > > the commit
> > > "mptcp: add last time fields in mptcp_info".
> > > 
> > > This patch prints out these counters into mptcp_stats output.
> > 
> > Thank you for this patch!
> > 
> > It looks good to me.
> > 
> > Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> > 
> > Of course, we will need to wait for the kernel patch to be in our
> > tree,
> > then in net-next, before sending this one to IPRoute2 maintainers.
> 
> The kernel patch has been applied in net-next. Do you want to send
> this
> patch to IPRoute2 maintainers, or do you prefer if I do that?

Please send it for me, thanks.

-Geliang

> 
> Cheers,
> Matt