mbox series

[net-next,v2,0/2] mptcp: add last time fields in mptcp_info

Message ID 20240410-upstream-net-next-20240405-mptcp-last-time-info-v2-0-f95bd6b33e51@kernel.org (mailing list archive)
Headers show
Series mptcp: add last time fields in mptcp_info | expand

Message

Matthieu Baerts (NGI0) April 10, 2024, 9:48 a.m. UTC
These patches from Geliang add support for the "last time" field in
MPTCP Info, and verify that the counters look valid.

Patch 1 adds these counters: last_data_sent, last_data_recv and
last_ack_recv. They are available in the MPTCP Info, so exposed via
getsockopt(MPTCP_INFO) and the Netlink Diag interface.

Patch 2 adds a test in diag.sh MPTCP selftest, to check that the
counters have moved by at least 250ms, after having waited twice that
time.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v2:
- Only patch 1/2 has been modified following Eric's suggestion, see the
  individual changelog for more details.
- Link to v1: https://lore.kernel.org/r/20240405-upstream-net-next-20240405-mptcp-last-time-info-v1-0-52dc49453649@kernel.org

---
Geliang Tang (2):
      mptcp: add last time fields in mptcp_info
      selftests: mptcp: test last time mptcp_info

 include/uapi/linux/mptcp.h                |  4 +++
 net/mptcp/options.c                       |  1 +
 net/mptcp/protocol.c                      |  7 ++++
 net/mptcp/protocol.h                      |  3 ++
 net/mptcp/sockopt.c                       | 16 +++++++---
 tools/testing/selftests/net/mptcp/diag.sh | 53 +++++++++++++++++++++++++++++++
 6 files changed, 79 insertions(+), 5 deletions(-)
---
base-commit: 2ecd487b670fcbb1ad4893fff1af4aafdecb6023
change-id: 20240405-upstream-net-next-20240405-mptcp-last-time-info-9b03618e08f1

Best regards,

Comments

Jakub Kicinski April 10, 2024, 6:34 p.m. UTC | #1
On Wed, 10 Apr 2024 11:48:23 +0200 Matthieu Baerts (NGI0) wrote:
> These patches from Geliang add support for the "last time" field in
> MPTCP Info, and verify that the counters look valid.
> 
> Patch 1 adds these counters: last_data_sent, last_data_recv and
> last_ack_recv. They are available in the MPTCP Info, so exposed via
> getsockopt(MPTCP_INFO) and the Netlink Diag interface.
> 
> Patch 2 adds a test in diag.sh MPTCP selftest, to check that the
> counters have moved by at least 250ms, after having waited twice that
> time.

Hi Mat, is this causing skips in selftests by any chance?

# 07 ....chk last_data_sent                            [SKIP] Feature probably not supported
# 08 ....chk last_data_recv                            [SKIP] Feature probably not supported
# 09 ....chk last_ack_recv                             [SKIP] Feature probably not supported

I'll "hide it" from patchwork for now..
Matthieu Baerts (NGI0) April 10, 2024, 7:31 p.m. UTC | #2
Hi Jakub,

Thank you for your email!

10 Apr 2024 20:34:54 Jakub Kicinski <kuba@kernel.org>:

> On Wed, 10 Apr 2024 11:48:23 +0200 Matthieu Baerts (NGI0) wrote:
>> These patches from Geliang add support for the "last time" field in
>> MPTCP Info, and verify that the counters look valid.
>>
>> Patch 1 adds these counters: last_data_sent, last_data_recv and
>> last_ack_recv. They are available in the MPTCP Info, so exposed via
>> getsockopt(MPTCP_INFO) and the Netlink Diag interface.
>>
>> Patch 2 adds a test in diag.sh MPTCP selftest, to check that the
>> counters have moved by at least 250ms, after having waited twice that
>> time.
>
> Hi Mat, is this causing skips in selftests by any chance?
>
> # 07 ....chk last_data_sent                            [SKIP] Feature probably not supported
> # 08 ....chk last_data_recv                            [SKIP] Feature probably not supported
> # 09 ....chk last_ack_recv                             [SKIP] Feature probably not supported

Yes it does, I should have added a note about that, sorry: that's because
SS needs to be patched as well to display the new counters.

https://patchwork.kernel.org/project/mptcp/patch/fd9e850f1e00691204f1dfebc63c01c6a4318c10.1711705327.git.geliang@kernel.org/

This patch will be sent when the kernel one will be accepted.

Is it an issue? The modification of the selftests can be applied later
if you prefer.

Earlier today, I was looking at changing NIPA not to mark the whole
selftest as "SKIP" but I saw it was not a bug: a check is there to
mark everything as skipped if one subtest is marked as skipped
from what I understood. So I guess we don't want to change that :)

> I'll "hide it" from patchwork for now..
> --
> pw-bot: defer

Thank you! Do you prefer if I resend only patch 1/2 for now?

Cheers,
Matt
Jakub Kicinski April 10, 2024, 9:01 p.m. UTC | #3
On Wed, 10 Apr 2024 21:31:13 +0200 (GMT+02:00) Matthieu Baerts wrote:
> > Hi Mat, is this causing skips in selftests by any chance?
> >
> > # 07 ....chk last_data_sent                            [SKIP] Feature probably not supported
> > # 08 ....chk last_data_recv                            [SKIP] Feature probably not supported
> > # 09 ....chk last_ack_recv                             [SKIP] Feature probably not supported  
> 
> Yes it does, I should have added a note about that, sorry: that's because
> SS needs to be patched as well to display the new counters.
> 
> https://patchwork.kernel.org/project/mptcp/patch/fd9e850f1e00691204f1dfebc63c01c6a4318c10.1711705327.git.geliang@kernel.org/
> 
> This patch will be sent when the kernel one will be accepted.

I see, applied locally now, thanks!

> Is it an issue? The modification of the selftests can be applied later
> if you prefer.

Not sure. If it doesn't happen super often maybe co-post the iproute2
patch as described:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#co-posting-changes-to-user-space-components
and I'll apply it on the worker machines manually.

> Earlier today, I was looking at changing NIPA not to mark the whole
> selftest as "SKIP" but I saw it was not a bug: a check is there to
> mark everything as skipped if one subtest is marked as skipped
> from what I understood. So I guess we don't want to change that :)

Correct :) It's working as intended :)

> > I'll "hide it" from patchwork for now..
> > --
> > pw-bot: defer  
> 
> Thank you! Do you prefer if I resend only patch 1/2 for now?

No need, restored the patches back, let's see if next run is clean.
Matthieu Baerts (NGI0) April 11, 2024, 9:17 a.m. UTC | #4
Hi Jakub,

On 10/04/2024 23:01, Jakub Kicinski wrote:
> On Wed, 10 Apr 2024 21:31:13 +0200 (GMT+02:00) Matthieu Baerts wrote:
>>> Hi Mat, is this causing skips in selftests by any chance?
>>>
>>> # 07 ....chk last_data_sent                            [SKIP] Feature probably not supported
>>> # 08 ....chk last_data_recv                            [SKIP] Feature probably not supported
>>> # 09 ....chk last_ack_recv                             [SKIP] Feature probably not supported  
>>
>> Yes it does, I should have added a note about that, sorry: that's because
>> SS needs to be patched as well to display the new counters.
>>
>> https://patchwork.kernel.org/project/mptcp/patch/fd9e850f1e00691204f1dfebc63c01c6a4318c10.1711705327.git.geliang@kernel.org/
>>
>> This patch will be sent when the kernel one will be accepted.
> 
> I see, applied locally now, thanks!

Thank you!

>> Is it an issue? The modification of the selftests can be applied later
>> if you prefer.
> 
> Not sure. If it doesn't happen super often maybe co-post the iproute2
> patch as described:
> https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#co-posting-changes-to-user-space-components
> and I'll apply it on the worker machines manually.

I missed that. Indeed, that should be rare. We will do that next time!

>> Earlier today, I was looking at changing NIPA not to mark the whole
>> selftest as "SKIP" but I saw it was not a bug: a check is there to
>> mark everything as skipped if one subtest is marked as skipped
>> from what I understood. So I guess we don't want to change that :)
> 
> Correct :) It's working as intended :)

It can maybe be modified when we can re-use the option to parse embedded
TAP results :)

>>> I'll "hide it" from patchwork for now..
>>> --
>>> pw-bot: defer  
>>
>> Thank you! Do you prefer if I resend only patch 1/2 for now?
> 
> No need, restored the patches back, let's see if next run is clean.

Thank you! It looks like they are OK now!

Cheers,
Matt
patchwork-bot+netdevbpf@kernel.org April 11, 2024, 5:30 p.m. UTC | #5
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 10 Apr 2024 11:48:23 +0200 you wrote:
> These patches from Geliang add support for the "last time" field in
> MPTCP Info, and verify that the counters look valid.
> 
> Patch 1 adds these counters: last_data_sent, last_data_recv and
> last_ack_recv. They are available in the MPTCP Info, so exposed via
> getsockopt(MPTCP_INFO) and the Netlink Diag interface.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/2] mptcp: add last time fields in mptcp_info
    https://git.kernel.org/netdev/net-next/c/18d82cde7432
  - [net-next,v2,2/2] selftests: mptcp: test last time mptcp_info
    https://git.kernel.org/netdev/net-next/c/22724c89892f

You are awesome, thank you!