mbox series

[mptcp-next,v11,00/10] BPF path manager, part 5

Message ID cover.1741674285.git.tanggeliang@kylinos.cn (mailing list archive)
Headers show
Series BPF path manager, part 5 | expand

Message

Geliang Tang March 11, 2025, 6:31 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

v11:
 - add bitmap_fill(id_avail_bitmap) in mptcp_pm_kernel_init.
 - squash mptcp_pm_validate into "mptcp: pm: define struct
   mptcp_pm_ops".
 - map path_manager to pm_type after mptcp_set_path_manager().
 - change 'char *pm_name = "unknown"' to 'char *pm_name = ""'.
 - update pm mapping selftests.

v10:
 - drop pm->init in mptcp_pm_validate, move mptcp_pm_validate into a new
   patch.
 - remove tlb, use ctl instead in proc_pm_type.
 - use "strncmp() == 0" instead of "!strncmp()".
 - set pm_type __MPTCP_PM_TYPE_NR for other names.
 - add WARN_ON_ONCE in mptcp_pm_unregister.
 - drop mptcp_userspace_pm_init.
 - rename "struct mptcp_pm_ops *pm" to "struct mptcp_pm_ops *pm_ops".
 - drop pm_ops NULL check in mptcp_pm_release.
 - add struct_group for struct mptcp_pm_data.
 - move selftests into userspace_pm.sh.

v9:
 - rename mptcp_pm_nl_ prefix to mptcp_pm_kernel_.
 - rename mptcp_userspace_pm_ prefix to mptcp_pm_userspace_.
 - update commit logs.

v8:
 - address Matt's comments in v7.

v7:
 - addresss Matt's comments in v6 [1].
 - drop "type" from struct mptcp_pm_ops as Matt suggested.
 - map "pm_type" to new sysctl as Matt suggested.

v6:
 - add "name" in struct mptcp_pm_ops.
 - add some "sysctl" patches.
 - drop "struct mptcp_pm_param".
 - drop "pm_type" in mptcp_pm_data.

v5:
 - use "struct mptcp_pm_param *param" as unified parameters for all
   interfaces.
 - register in-kernel mptcp_pm_ops too.
 - only implement two interfaces "get_local_id" and "get_priority" in
   this set.

v4:
 - include a new patch "define BPF path manager type".

 - add new interfaces:
	created established closed
	listerner_created listener_closed

 - rename interfaces as:
	address_announced address_removed
	subflow_established subflow_closed
	get_priority set_priority

 - rename functions as:
	mptcp_pm_validate
	mptcp_pm_register
	mptcp_pm_unregister
	mptcp_pm_initialize
	mptcp_pm_release

v3:
 - rename the 2nd parameter of get_local_id() from 'local' to 'skc'.
 - keep the 'msk_sport' check in mptcp_userspace_pm_get_local_id().
 - return 'err' instead of '0' in userspace_pm_subflow_create().
 - drop 'ret' variable inmptcp_pm_data_reset().
 - fix typos in commit log.

v2:
 - update get_local_id interface in patch 2.

get_addr() and dump_addr() interfaces of BPF userspace pm are dropped
as Matt suggested.

In order to implement BPF path manager, it's necessary to unify the
interfaces of the path manager. This set contains some cleanups and
refactoring to unify the interfaces in kernel space. Finally, define
a struct mptcp_pm_ops for a path manager.

Geliang Tang (10):
  mptcp: pm: define struct mptcp_pm_ops
  mptcp: pm: register in-kernel and userspace PM
  mptcp: sysctl: set path manager by name
  mptcp: pm: init and release mptcp_pm_ops
  mptcp: pm: add get_local_id() interface
  mptcp: pm: add get_priority() interface
  mptcp: sysctl: map path_manager to pm_type
  mptcp: sysctl: map pm_type to path_manager
  mptcp: sysctl: add available_path_managers
  selftests: mptcp: add pm sysctl mapping tests

 Documentation/networking/mptcp-sysctl.rst     |  23 +++
 include/net/mptcp.h                           |  19 +++
 net/mptcp/ctrl.c                              | 113 +++++++++++++-
 net/mptcp/pm.c                                | 145 ++++++++++++++----
 net/mptcp/pm_kernel.c                         |  37 ++++-
 net/mptcp/pm_userspace.c                      |  26 +++-
 net/mptcp/protocol.h                          |  18 ++-
 .../selftests/net/mptcp/userspace_pm.sh       |  30 +++-
 8 files changed, 368 insertions(+), 43 deletions(-)

Comments

Geliang Tang March 11, 2025, 6:59 a.m. UTC | #1
On Tue, 2025-03-11 at 14:31 +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v11:
>  - add bitmap_fill(id_avail_bitmap) in mptcp_pm_kernel_init.
>  - squash mptcp_pm_validate into "mptcp: pm: define struct
>    mptcp_pm_ops".
>  - map path_manager to pm_type after mptcp_set_path_manager().
>  - change 'char *pm_name = "unknown"' to 'char *pm_name = ""'.
>  - update pm mapping selftests.

Sorry, I forgot to add "Based-on" here. So I resend this v11 to trigger
CI tests. Sorry for the mess.

Thanks,
-Geliang

> 
> v10:
>  - drop pm->init in mptcp_pm_validate, move mptcp_pm_validate into a
> new
>    patch.
>  - remove tlb, use ctl instead in proc_pm_type.
>  - use "strncmp() == 0" instead of "!strncmp()".
>  - set pm_type __MPTCP_PM_TYPE_NR for other names.
>  - add WARN_ON_ONCE in mptcp_pm_unregister.
>  - drop mptcp_userspace_pm_init.
>  - rename "struct mptcp_pm_ops *pm" to "struct mptcp_pm_ops *pm_ops".
>  - drop pm_ops NULL check in mptcp_pm_release.
>  - add struct_group for struct mptcp_pm_data.
>  - move selftests into userspace_pm.sh.
> 
> v9:
>  - rename mptcp_pm_nl_ prefix to mptcp_pm_kernel_.
>  - rename mptcp_userspace_pm_ prefix to mptcp_pm_userspace_.
>  - update commit logs.
> 
> v8:
>  - address Matt's comments in v7.
> 
> v7:
>  - addresss Matt's comments in v6 [1].
>  - drop "type" from struct mptcp_pm_ops as Matt suggested.
>  - map "pm_type" to new sysctl as Matt suggested.
> 
> v6:
>  - add "name" in struct mptcp_pm_ops.
>  - add some "sysctl" patches.
>  - drop "struct mptcp_pm_param".
>  - drop "pm_type" in mptcp_pm_data.
> 
> v5:
>  - use "struct mptcp_pm_param *param" as unified parameters for all
>    interfaces.
>  - register in-kernel mptcp_pm_ops too.
>  - only implement two interfaces "get_local_id" and "get_priority" in
>    this set.
> 
> v4:
>  - include a new patch "define BPF path manager type".
> 
>  - add new interfaces:
> 	created established closed
> 	listerner_created listener_closed
> 
>  - rename interfaces as:
> 	address_announced address_removed
> 	subflow_established subflow_closed
> 	get_priority set_priority
> 
>  - rename functions as:
> 	mptcp_pm_validate
> 	mptcp_pm_register
> 	mptcp_pm_unregister
> 	mptcp_pm_initialize
> 	mptcp_pm_release
> 
> v3:
>  - rename the 2nd parameter of get_local_id() from 'local' to 'skc'.
>  - keep the 'msk_sport' check in mptcp_userspace_pm_get_local_id().
>  - return 'err' instead of '0' in userspace_pm_subflow_create().
>  - drop 'ret' variable inmptcp_pm_data_reset().
>  - fix typos in commit log.
> 
> v2:
>  - update get_local_id interface in patch 2.
> 
> get_addr() and dump_addr() interfaces of BPF userspace pm are dropped
> as Matt suggested.
> 
> In order to implement BPF path manager, it's necessary to unify the
> interfaces of the path manager. This set contains some cleanups and
> refactoring to unify the interfaces in kernel space. Finally, define
> a struct mptcp_pm_ops for a path manager.
> 
> Geliang Tang (10):
>   mptcp: pm: define struct mptcp_pm_ops
>   mptcp: pm: register in-kernel and userspace PM
>   mptcp: sysctl: set path manager by name
>   mptcp: pm: init and release mptcp_pm_ops
>   mptcp: pm: add get_local_id() interface
>   mptcp: pm: add get_priority() interface
>   mptcp: sysctl: map path_manager to pm_type
>   mptcp: sysctl: map pm_type to path_manager
>   mptcp: sysctl: add available_path_managers
>   selftests: mptcp: add pm sysctl mapping tests
> 
>  Documentation/networking/mptcp-sysctl.rst     |  23 +++
>  include/net/mptcp.h                           |  19 +++
>  net/mptcp/ctrl.c                              | 113 +++++++++++++-
>  net/mptcp/pm.c                                | 145 ++++++++++++++--
> --
>  net/mptcp/pm_kernel.c                         |  37 ++++-
>  net/mptcp/pm_userspace.c                      |  26 +++-
>  net/mptcp/protocol.h                          |  18 ++-
>  .../selftests/net/mptcp/userspace_pm.sh       |  30 +++-
>  8 files changed, 368 insertions(+), 43 deletions(-)
>
Matthieu Baerts March 11, 2025, 9:10 a.m. UTC | #2
Hi Geliang,

On 11/03/2025 07:59, Geliang Tang wrote:
> On Tue, 2025-03-11 at 14:31 +0800, Geliang Tang wrote:
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> v11:
>>  - add bitmap_fill(id_avail_bitmap) in mptcp_pm_kernel_init.
>>  - squash mptcp_pm_validate into "mptcp: pm: define struct
>>    mptcp_pm_ops".
>>  - map path_manager to pm_type after mptcp_set_path_manager().
>>  - change 'char *pm_name = "unknown"' to 'char *pm_name = ""'.
>>  - update pm mapping selftests.
> 
> Sorry, I forgot to add "Based-on" here. So I resend this v11 to trigger
> CI tests. Sorry for the mess.

No problem, I forced things to get it working. The CI should start soon.

To get this working next time, simply send me an email, and if I'm not
responding, you need to send a new version if anything is being changed
in the patches, including the inclusion of this "Based-on" tag.

Cheers,
Matt
MPTCP CI March 11, 2025, 10:17 a.m. UTC | #3
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Unstable: 1 failed test(s): bpftest_test_progs_mptcp 
Matthieu Baerts March 11, 2025, 10:03 p.m. UTC | #4
Hi Geliang,

On 11/03/2025 07:31, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v11:
>  - add bitmap_fill(id_avail_bitmap) in mptcp_pm_kernel_init.
>  - squash mptcp_pm_validate into "mptcp: pm: define struct
>    mptcp_pm_ops".
>  - map path_manager to pm_type after mptcp_set_path_manager().
>  - change 'char *pm_name = "unknown"' to 'char *pm_name = ""'.
>  - update pm mapping selftests.

Thank you for the new version!

It looks good to me:

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

Cheers,
Matt
Matthieu Baerts March 11, 2025, 10:39 p.m. UTC | #5
On 11/03/2025 23:03, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 11/03/2025 07:31, Geliang Tang wrote:
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> v11:
>>  - add bitmap_fill(id_avail_bitmap) in mptcp_pm_kernel_init.
>>  - squash mptcp_pm_validate into "mptcp: pm: define struct
>>    mptcp_pm_ops".
>>  - map path_manager to pm_type after mptcp_set_path_manager().
>>  - change 'char *pm_name = "unknown"' to 'char *pm_name = ""'.
>>  - update pm mapping selftests.
> 
> Thank you for the new version!

Now in our tree (feat. for net-next):

New patches for t/upstream:
- 65af42fa552d: mptcp: pm: define struct mptcp_pm_ops
- 60dbf3c5392c: mptcp: pm: register in-kernel and userspace PM
- 16f4a1ec2359: mptcp: sysctl: set path manager by name
- 59f4fd0d9b0b: mptcp: sysctl: map path_manager to pm_type
- 7e3dbe52536d: mptcp: sysctl: map pm_type to path_manager
- ae2be6b1ab64: mptcp: sysctl: add available_path_managers
- dc69452c20e5: selftests: mptcp: add pm sysctl mapping tests
- 9c827852b057: mptcp: pm: init and release mptcp_pm_ops
- cc6386364b56: mptcp: pm: add get_local_id() interface
- 75a9b54d9647: mptcp: pm: add get_priority() interface
- Results: 336906910afb..ef50eaa97a0c (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/153a4b172efa4822ab857d7298e29fac02df6c13/checks


I slightly changed the order to regroup the sysctl ones, because I might
need to split the series when sending this upstream with other patches.

Cheers,
Matt