[PATCH mptcp-next v4 0/7] BPF path manager, part 1

Geliang Tang posted 7 patches 2 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1733382222.git.tanggeliang@kylinos.cn
net/mptcp/pm_netlink.c   |  46 ++----
net/mptcp/pm_userspace.c | 296 +++++++++++++++++----------------------
net/mptcp/protocol.h     |   7 +-
3 files changed, 146 insertions(+), 203 deletions(-)
[PATCH mptcp-next v4 0/7] BPF path manager, part 1
Posted by Geliang Tang 2 weeks, 2 days ago
From: Geliang Tang <tanggeliang@kylinos.cn>

v4:
 - #4 drop "/* Called from the in-kernel PM only */" commend too.
 - #5 drop 'out' label and if-statement in mptcp_pm_remove_addr_entry.
 - drop #6 and #7.
 - the last patch, add 'release_sock' label as Matt suggested.

v3:
 - address Matt's comments in v2 (thanks)
 - only include cleanups and refactoring patches in this set.

v2:
 - add BPF-related code in this set (32-36).

In order to implement BPF userspace path manager, it is 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 userspace path manager
like this:

struct mptcp_pm_ops {
        int (*address_announce)(struct mptcp_sock *msk,
                                struct mptcp_pm_addr_entry *local);
        int (*address_remove)(struct mptcp_sock *msk, u8 id);
        int (*subflow_create)(struct mptcp_sock *msk,
                              struct mptcp_pm_addr_entry *local,
                              struct mptcp_addr_info *remote);
        int (*subflow_destroy)(struct mptcp_sock *msk,
                               struct mptcp_pm_addr_entry *local,
                               struct mptcp_addr_info *remote);
        int (*get_local_id)(struct mptcp_sock *msk,
                            struct mptcp_pm_addr_entry *local);
        u8 (*get_flags)(struct mptcp_sock *msk,
                        struct mptcp_addr_info *skc);
        struct mptcp_pm_addr_entry *(*get_addr)(struct mptcp_sock *msk,
                                                u8 id);
	int (*dump_addr)(struct mptcp_sock *msk,
			 mptcp_pm_addr_id_bitmap_t *bitmap);
        int (*set_flags)(struct mptcp_sock *msk,
                         struct mptcp_pm_addr_entry *local,
                         struct mptcp_addr_info *remote);

        u8                      type;
        struct module           *owner;
        struct list_head        list;

        void (*init)(struct mptcp_sock *msk);
        void (*release)(struct mptcp_sock *msk);
} ____cacheline_aligned_in_smp;

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/74

Geliang Tang (7):
  mptcp: add mptcp_userspace_pm_lookup_addr helper
  mptcp: add mptcp_for_each_userspace_pm_addr macro
  mptcp: add mptcp_userspace_pm_get_sock helper
  mptcp: move mptcp_pm_remove_addrs into pm_userspace
  mptcp: drop free_list for deleting entries
  mptcp: change local addr type of subflow_destroy
  mptcp: drop useless "err = 0" in subflow_destroy

 net/mptcp/pm_netlink.c   |  46 ++----
 net/mptcp/pm_userspace.c | 296 +++++++++++++++++----------------------
 net/mptcp/protocol.h     |   7 +-
 3 files changed, 146 insertions(+), 203 deletions(-)

-- 
2.45.2
Re: [PATCH mptcp-next v4 0/7] BPF path manager, part 1
Posted by Matthieu Baerts 2 weeks, 2 days ago
Hi Geliang,

On 05/12/2024 08:14, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - #4 drop "/* Called from the in-kernel PM only */" commend too.
>  - #5 drop 'out' label and if-statement in mptcp_pm_remove_addr_entry.
>  - drop #6 and #7.
>  - the last patch, add 'release_sock' label as Matt suggested.

Thank you for the v4!

Now in our tree (feat. for next). I fixed a few checkpatch issues, not
all of them:

https://github.com/multipath-tcp/mptcp_net-next/actions/runs/12175193283

New patches for t/upstream:
- ffb4c89ba1a7: mptcp: add mptcp_userspace_pm_lookup_addr helper
- 05fc5612a77e: mptcp: add mptcp_for_each_userspace_pm_addr macro
- 7acafff55e52: mptcp: add mptcp_userspace_pm_get_sock helper
- f6e0d82aa7dd: mptcp: move mptcp_pm_remove_addrs into pm_userspace
- 041f9316b371: mptcp: drop free_list for deleting entries
- b822c57caa24: mptcp: change local addr type of subflow_destroy
- 6de689515d74: mptcp: drop useless "err = 0" in subflow_destroy
- Results: d286b6bfc064..dfe7d0266fe7 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/76deea04b4904d17117c28e170a37c8d9ad7228a/checks


Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next v4 0/7] BPF path manager, part 1
Posted by Matthieu Baerts 2 weeks, 2 days ago
Hi Geliang,

On 05/12/2024 08:14, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - #4 drop "/* Called from the in-kernel PM only */" commend too.
>  - #5 drop 'out' label and if-statement in mptcp_pm_remove_addr_entry.
>  - drop #6 and #7.
>  - the last patch, add 'release_sock' label as Matt suggested.

Thank you for the new version, the individual changelog, and the replies!

There are a few complains from checkpatch.pl, probably I can fix some of
them when applying the patches

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

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next v4 0/7] BPF path manager, part 1
Posted by MPTCP CI 2 weeks, 2 days ago
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): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/12175193284

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/fb1a4a4e6dee
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=914798


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)