All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
@ 2024-12-09  8:47 Geliang Tang
  2024-12-09  9:52 ` MPTCP CI
  2024-12-10 11:42 ` Matthieu Baerts
  0 siblings, 2 replies; 16+ messages in thread
From: Geliang Tang @ 2024-12-09  8:47 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

v4:
 - CI reports the following BUILD_BUG_ON fails on i386:

 BUILD_BUG_ON(sizeof(struct bpf_iter_mptcp_subflow_kern) !=
 	      sizeof(struct bpf_iter_mptcp_subflow))

 Just like in bpf_iter_task_new(), change this "!=" to ">".

v3:
 - check sock_owned_by_user_nocheck(sk)/spin_is_locked(&sk->sk_lock.slock),
   instead of lockdep_sock_is_held(sk).
 - add "sizeof" and "alignof" checks.
 - drop bpf_mptcp_sk() and bpf_mptcp_subflow_tcp_sock() definitions. Use
   bpf_skc_to_mptcp_sock() and mptcp_subflow_tcp_sock() in mptcp_subflow
   bpf_iter selftests instead.

v2:
 - add CONFIG_LOCKDEP check in patch 2 to fix the build error reported
   by CI.

Address Martin's comments in v1.

Geliang Tang (5):
  mptcp: update bpf_mptcp_sock_from_subflow
  bpf: Allow use of skc_to_mptcp_sock in cg_sockopt
  Squash to "bpf: Register mptcp common kfunc set"
  Squash to "bpf: Add mptcp_subflow bpf_iter"
  Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest"

 include/net/mptcp.h                           |  4 +--
 kernel/bpf/cgroup.c                           |  2 ++
 net/core/filter.c                             |  2 +-
 net/mptcp/bpf.c                               | 34 +++++++++----------
 tools/testing/selftests/bpf/progs/mptcp_bpf.h |  1 -
 .../selftests/bpf/progs/mptcp_bpf_iters.c     | 11 +++---
 6 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2024-12-09  8:47 Geliang Tang
@ 2024-12-09  9:52 ` MPTCP CI
  2024-12-10 11:42 ` Matthieu Baerts
  1 sibling, 0 replies; 16+ messages in thread
From: MPTCP CI @ 2024-12-09  9:52 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

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: Unstable: 1 failed test(s): selftest_mptcp_connect 🔴
- 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/12232272946

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


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)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2024-12-09  8:47 Geliang Tang
  2024-12-09  9:52 ` MPTCP CI
@ 2024-12-10 11:42 ` Matthieu Baerts
  1 sibling, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2024-12-10 11:42 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang,

On 09/12/2024 09:47, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - CI reports the following BUILD_BUG_ON fails on i386:
> 
>  BUILD_BUG_ON(sizeof(struct bpf_iter_mptcp_subflow_kern) !=
>  	      sizeof(struct bpf_iter_mptcp_subflow))
> 
>  Just like in bpf_iter_task_new(), change this "!=" to ">".
> 
> v3:
>  - check sock_owned_by_user_nocheck(sk)/spin_is_locked(&sk->sk_lock.slock),
>    instead of lockdep_sock_is_held(sk).
>  - add "sizeof" and "alignof" checks.
>  - drop bpf_mptcp_sk() and bpf_mptcp_subflow_tcp_sock() definitions. Use
>    bpf_skc_to_mptcp_sock() and mptcp_subflow_tcp_sock() in mptcp_subflow
>    bpf_iter selftests instead.

Thank you for the new versions. I have some additional questions, see my
comment on the individual patches.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
@ 2025-02-24  3:37 Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 1/5] Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock" Geliang Tang
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

v4:
 - drop sock_owned_by_user_nocheck and spin_is_locked. According to
   comments from Mat and Martin, in this set mptcp_subflow
   bpf_iter only used from a cg sockopt bpf prog, no need to add these
   check at this moment.

v3:
 - patch 3, continue to use sock_owned_by_user_nocheck() and spin_is_locked()
checks instead of using msk_owned_by_me().
 - patch 5, drop declaration of bpf_mptcp_subflow_tcp_sock. It's no longer
used.
 - patch 5, update the comment for mptcp_subflow_tcp_sock(), which is a BPF
helper, not a kfunc.

The commit log of "bpf: Register mptcp common kfunc set" doesn't match the
code, please update it as:

'''
bpf: Register mptcp common kfunc set

MPTCP helper mptcp_subflow_ctx() is used to convert struct sock to
struct mptcp_subflow_context. It will be used in MPTCP BPF programs.

This patch defines corresponding wrapper of this helper, and put it
into the newly defined mptcp common kfunc set and register this set
with the flag BPF_PROG_TYPE_CGROUP_SOCKOPT to let it accessible to
the 'cgroup/getsockopt' type of BPF programs.
'''

v2:
 - Drop bpf_skc_to_mptcp_sock
 - Check the owner before assigning the msk as Mat suggested.
 - Use bpf_core_cast() in mptcp_subflow bpf_iter subtest instead of
using bpf_skc_to_mptcp_sock().

Address Martin's suggestions for "Add mptcp_subflow bpf_iter support" v2.

Geliang Tang (5):
  Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock"
  Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt"
  Squash to "bpf: Add mptcp_subflow bpf_iter"
  Revert "bpf: Acquire and release mptcp socket"
  Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest"

 include/net/mptcp.h                           |  4 +-
 kernel/bpf/cgroup.c                           |  2 -
 net/core/filter.c                             |  2 +-
 net/mptcp/bpf.c                               | 41 ++++---------------
 .../testing/selftests/bpf/bpf_experimental.h  |  2 +-
 tools/testing/selftests/bpf/progs/mptcp_bpf.h |  5 ---
 .../selftests/bpf/progs/mptcp_bpf_iters.c     | 10 ++---
 7 files changed, 15 insertions(+), 51 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH mptcp-next v4 1/5] Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
@ 2025-02-24  3:37 ` Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 2/5] Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt" Geliang Tang
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

bpf_core_cast() can be used in mptcp_subflow bpf_iter selftests to get the
msk, instead of using bpf_skc_to_mptcp_sock(). No need to add this patch
anymore, revert it.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 include/net/mptcp.h |  4 ++--
 net/core/filter.c   |  2 +-
 net/mptcp/bpf.c     | 10 ++--------
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index bcddaf0a588a..6586906701aa 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -362,9 +362,9 @@ static inline void mptcpv6_handle_mapped(struct sock *sk, bool mapped) { }
 #endif
 
 #if defined(CONFIG_MPTCP) && defined(CONFIG_BPF_SYSCALL)
-struct mptcp_sock *bpf_mptcp_sock_from_sock(struct sock *sk);
+struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
 #else
-static inline struct mptcp_sock *bpf_mptcp_sock_from_sock(struct sock *sk) { return NULL; }
+static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; }
 #endif
 
 #if !IS_ENABLED(CONFIG_MPTCP)
diff --git a/net/core/filter.c b/net/core/filter.c
index fc094e8d53d3..2ec162dd83c4 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -11843,7 +11843,7 @@ const struct bpf_func_proto bpf_skc_to_unix_sock_proto = {
 BPF_CALL_1(bpf_skc_to_mptcp_sock, struct sock *, sk)
 {
 	BTF_TYPE_EMIT(struct mptcp_sock);
-	return (unsigned long)bpf_mptcp_sock_from_sock(sk);
+	return (unsigned long)bpf_mptcp_sock_from_subflow(sk);
 }
 
 const struct bpf_func_proto bpf_skc_to_mptcp_sock_proto = {
diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index be222fa5f308..7e9d9c9a04cf 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -195,15 +195,9 @@ static struct bpf_struct_ops bpf_mptcp_sched_ops = {
 };
 #endif /* CONFIG_BPF_JIT */
 
-struct mptcp_sock *bpf_mptcp_sock_from_sock(struct sock *sk)
+struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk)
 {
-	if (unlikely(!sk || !sk_fullsock(sk)))
-		return NULL;
-
-	if (sk->sk_protocol == IPPROTO_MPTCP)
-		return mptcp_sk(sk);
-
-	if (sk->sk_protocol == IPPROTO_TCP && sk_is_mptcp(sk))
+	if (sk && sk_fullsock(sk) && sk->sk_protocol == IPPROTO_TCP && sk_is_mptcp(sk))
 		return mptcp_sk(mptcp_subflow_ctx(sk)->conn);
 
 	return NULL;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH mptcp-next v4 2/5] Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 1/5] Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock" Geliang Tang
@ 2025-02-24  3:37 ` Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 3/5] Squash to "bpf: Add mptcp_subflow bpf_iter" Geliang Tang
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

bpf_core_cast() can be used in mptcp_subflow bpf_iter selftests to get the
msk, instead of using bpf_skc_to_mptcp_sock(). No need to add this patch
anymore, revert it.

This reverts commit d8d42f5a4542c2dc31e4e00c58508a821c6ab789.
---
 kernel/bpf/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 1ca22e4842cf..46e5db65dbc8 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -2358,8 +2358,6 @@ cg_sockopt_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
 #ifdef CONFIG_INET
 	case BPF_FUNC_tcp_sock:
 		return &bpf_tcp_sock_proto;
-	case BPF_FUNC_skc_to_mptcp_sock:
-		return &bpf_skc_to_mptcp_sock_proto;
 #endif
 	case BPF_FUNC_perf_event_output:
 		return &bpf_event_output_data_proto;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH mptcp-next v4 3/5] Squash to "bpf: Add mptcp_subflow bpf_iter"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 1/5] Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock" Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 2/5] Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt" Geliang Tang
@ 2025-02-24  3:37 ` Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 4/5] Revert "bpf: Acquire and release mptcp socket" Geliang Tang
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Drop the NULL check for 'msk' as Martin suggested, add more checks
for 'sk'.

Use the "struct sock *sk" instead of "struct mptcp-sock *msk" as the
argument in the bpf_iter_mptcp_subflow_new as Martin suggested.

v4:
 - drop sock_owned_by_user_nocheck and spin_is_locked. According to
   comments from Mat [2] and Martin [1], in this set mptcp_subflow
   bpf_iter only used from a cg sockopt bpf prog, no need to add these
   check at this moment.

[1]
https://lore.kernel.org/all/fdf0ddbe-e007-4a5f-bbdf-9a144e8fbe35@linux.dev/
[2]
https://patchwork.kernel.org/project/mptcp/patch/f6469225598beecbf0bda12a4c33fafa86c0ff15.1739787744.git.tanggeliang@kylinos.cn/

v3:
 - continue to use sock_owned_by_user_nocheck and spin_is_locked
checks instead of using msk_owned_by_me().

v2:
 - check the owner before assigning the msk as Mat suggested.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/bpf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index 7e9d9c9a04cf..a6b07aaddcb2 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -235,24 +235,24 @@ bpf_mptcp_subflow_ctx(const struct sock *sk)
 
 __bpf_kfunc static int
 bpf_iter_mptcp_subflow_new(struct bpf_iter_mptcp_subflow *it,
-			   struct mptcp_sock *msk)
+			   struct sock *sk)
 {
 	struct bpf_iter_mptcp_subflow_kern *kit = (void *)it;
-	struct sock *sk = (struct sock *)msk;
+	struct mptcp_sock *msk;
 
 	BUILD_BUG_ON(sizeof(struct bpf_iter_mptcp_subflow_kern) >
 		     sizeof(struct bpf_iter_mptcp_subflow));
 	BUILD_BUG_ON(__alignof__(struct bpf_iter_mptcp_subflow_kern) !=
 		     __alignof__(struct bpf_iter_mptcp_subflow));
 
-	kit->msk = msk;
-	if (!msk)
+	if (unlikely(!sk || !sk_fullsock(sk)))
 		return -EINVAL;
 
-	if (!sock_owned_by_user_nocheck(sk) &&
-	    !spin_is_locked(&sk->sk_lock.slock))
+	if (sk->sk_protocol != IPPROTO_MPTCP)
 		return -EINVAL;
 
+	msk = mptcp_sk(sk);
+	kit->msk = msk;
 	kit->pos = &msk->conn_list;
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH mptcp-next v4 4/5] Revert "bpf: Acquire and release mptcp socket"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (2 preceding siblings ...)
  2025-02-24  3:37 ` [PATCH mptcp-next v4 3/5] Squash to "bpf: Add mptcp_subflow bpf_iter" Geliang Tang
@ 2025-02-24  3:37 ` Geliang Tang
  2025-02-24  3:37 ` [PATCH mptcp-next v4 5/5] Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest" Geliang Tang
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Drop this patch as Martin suggested.

From Martin's review [1], this mptcp_sock_acquire() helper was a workaround
only to please the verifier, but they were not needed.

[1]
https://lore.kernel.org/9b373a23-c093-42d8-b4ae-99f2e62e7681@linux.dev

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/bpf.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index a6b07aaddcb2..ac7744c6006f 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -274,23 +274,6 @@ bpf_iter_mptcp_subflow_destroy(struct bpf_iter_mptcp_subflow *it)
 {
 }
 
-__bpf_kfunc static struct
-mptcp_sock *bpf_mptcp_sock_acquire(struct mptcp_sock *msk)
-{
-	struct sock *sk = (struct sock *)msk;
-
-	if (sk && refcount_inc_not_zero(&sk->sk_refcnt))
-		return msk;
-	return NULL;
-}
-
-__bpf_kfunc static void bpf_mptcp_sock_release(struct mptcp_sock *msk)
-{
-	struct sock *sk = (struct sock *)msk;
-
-	WARN_ON_ONCE(!sk || !refcount_dec_not_one(&sk->sk_refcnt));
-}
-
 __bpf_kfunc struct mptcp_subflow_context *
 bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
 {
@@ -311,8 +294,6 @@ BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx, KF_RET_NULL)
 BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new, KF_ITER_NEW | KF_TRUSTED_ARGS)
 BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_next, KF_ITER_NEXT | KF_RET_NULL)
 BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_destroy, KF_ITER_DESTROY)
-BTF_ID_FLAGS(func, bpf_mptcp_sock_acquire, KF_ACQUIRE | KF_RET_NULL)
-BTF_ID_FLAGS(func, bpf_mptcp_sock_release, KF_RELEASE)
 BTF_KFUNCS_END(bpf_mptcp_common_kfunc_ids)
 
 static const struct btf_kfunc_id_set bpf_mptcp_common_kfunc_set = {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH mptcp-next v4 5/5] Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (3 preceding siblings ...)
  2025-02-24  3:37 ` [PATCH mptcp-next v4 4/5] Revert "bpf: Acquire and release mptcp socket" Geliang Tang
@ 2025-02-24  3:37 ` Geliang Tang
  2025-02-24  3:56 ` [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Use bpf_core_cast() instead of bpf_skc_to_mptcp_sock().
Change the 2nd parameter type of bpf_for_each() as 'struct sock'.
Drop use of bpf_mptcp_sock_acquire/release.
Drop declaration of bpf_mptcp_subflow_tcp_sock. It's no longer used.
Update the comment for mptcp_subflow_tcp_sock(), which is a BPF helper,
not a kfunc.

Please update the commit log as:

'''
This patch adds a "cgroup/getsockopt" program "iters_subflow" to test the
newly added mptcp_subflow bpf_iter.

Export mptcp_subflow helpers bpf_iter_mptcp_subflow_new/_next/_destroy
and other helpers into bpf_experimental.h.

Use bpf_for_each() to walk the subflow list of this msk. MPTCP-specific
packet scheduler kfunc can be called in the loop. In this test, just
add all subflow ids to local variable local_ids, then invoke the helper
mptcp_subflow_tcp_sock() in the loop to pick a subsocket.

Out of the loop, use bpf_mptcp_subflow_ctx() to get the subflow context
of the picked subsocket and do some verification. Finally, assign
local_ids to global variable ids so that the application can obtain this
value.

Add a subtest named test_iters_subflow to load and verify the newly added
mptcp_subflow type bpf_iter example in test_mptcp. Use the helper
endpoint_init() to add 3 new subflow endpoints. Send a byte of message
to start the mptcp connection, and wait for new subflows to be added.
getsockopt() is invoked to trigger the "cgroup/getsockopt" test program
"iters_subflow". Check if skel->bss->ids equals 10 to verify whether this
mptcp_subflow bpf_iter loops correctly as expected.
'''

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/bpf/bpf_experimental.h      |  2 +-
 tools/testing/selftests/bpf/progs/mptcp_bpf.h       |  5 -----
 tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c | 10 +++-------
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/tools/testing/selftests/bpf/bpf_experimental.h b/tools/testing/selftests/bpf/bpf_experimental.h
index 2ab3f0063c0f..6a96c56f0725 100644
--- a/tools/testing/selftests/bpf/bpf_experimental.h
+++ b/tools/testing/selftests/bpf/bpf_experimental.h
@@ -577,7 +577,7 @@ extern void bpf_iter_css_destroy(struct bpf_iter_css *it) __weak __ksym;
 
 struct bpf_iter_mptcp_subflow;
 extern int bpf_iter_mptcp_subflow_new(struct bpf_iter_mptcp_subflow *it,
-				      struct mptcp_sock *msk) __weak __ksym;
+				      struct sock *sk) __weak __ksym;
 extern struct mptcp_subflow_context *
 bpf_iter_mptcp_subflow_next(struct bpf_iter_mptcp_subflow *it) __weak __ksym;
 extern void
diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf.h b/tools/testing/selftests/bpf/progs/mptcp_bpf.h
index b1f6e1fb467e..72263672510a 100644
--- a/tools/testing/selftests/bpf/progs/mptcp_bpf.h
+++ b/tools/testing/selftests/bpf/progs/mptcp_bpf.h
@@ -43,13 +43,8 @@ mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow)
 }
 
 /* ksym */
-extern struct mptcp_sock *bpf_mptcp_sock_acquire(struct mptcp_sock *msk) __ksym;
-extern void bpf_mptcp_sock_release(struct mptcp_sock *msk) __ksym;
-
 extern struct mptcp_subflow_context *
 bpf_mptcp_subflow_ctx(const struct sock *sk) __ksym;
-extern struct sock *
-bpf_mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow) __ksym;
 
 extern void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,
 					bool scheduled) __ksym;
diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c
index fd5691a4073b..a1d8f9b20259 100644
--- a/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c
+++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c
@@ -24,14 +24,11 @@ int iters_subflow(struct bpf_sockopt *ctx)
 	if (ctx->level != SOL_TCP || ctx->optname != TCP_IS_MPTCP)
 		return 1;
 
-	msk = bpf_skc_to_mptcp_sock(sk);
+	msk = bpf_core_cast(sk, struct mptcp_sock);
 	if (!msk || msk->pm.server_side || !msk->pm.subflows)
 		return 1;
 
-	msk = bpf_mptcp_sock_acquire(msk);
-	if (!msk)
-		return 1;
-	bpf_for_each(mptcp_subflow, subflow, msk) {
+	bpf_for_each(mptcp_subflow, subflow, (struct sock *)sk) {
 		/* Here MPTCP-specific packet scheduler kfunc can be called:
 		 * this test is not doing anything really useful, only to
 		 * verify the iteration works.
@@ -39,7 +36,7 @@ int iters_subflow(struct bpf_sockopt *ctx)
 
 		local_ids += subflow->subflow_id;
 
-		/* only to check the following kfunc works */
+		/* only to check the following helper works */
 		ssk = mptcp_subflow_tcp_sock(subflow);
 	}
 
@@ -58,6 +55,5 @@ int iters_subflow(struct bpf_sockopt *ctx)
 	ids = local_ids;
 
 out:
-	bpf_mptcp_sock_release(msk);
 	return 1;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (4 preceding siblings ...)
  2025-02-24  3:37 ` [PATCH mptcp-next v4 5/5] Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest" Geliang Tang
@ 2025-02-24  3:56 ` Geliang Tang
  2025-02-24  4:47 ` MPTCP CI
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2025-02-24  3:56 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

On Mon, 2025-02-24 at 11:37 +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - drop sock_owned_by_user_nocheck and spin_is_locked. According to
>    comments from Mat and Martin, in this set mptcp_subflow
>    bpf_iter only used from a cg sockopt bpf prog, no need to add
> these
>    check at this moment.

The commit log of "bpf: Register mptcp common kfunc set" doesn't match
the code, please update it as:

'''
bpf: Register mptcp common kfunc set

MPTCP helper mptcp_subflow_ctx() is used to convert struct sock to
struct mptcp_subflow_context. It will be used in MPTCP BPF programs.

This patch defines corresponding wrapper of this helper, and put it
into the newly defined mptcp common kfunc set and register this set
with the flag BPF_PROG_TYPE_CGROUP_SOCKOPT to let it accessible to
the 'cgroup/getsockopt' type of BPF programs.
'''

Thanks,
-Geliang

> 
> v3:
>  - patch 3, continue to use sock_owned_by_user_nocheck() and
> spin_is_locked()
> checks instead of using msk_owned_by_me().
>  - patch 5, drop declaration of bpf_mptcp_subflow_tcp_sock. It's no
> longer
> used.
>  - patch 5, update the comment for mptcp_subflow_tcp_sock(), which is
> a BPF
> helper, not a kfunc.
> 
> The commit log of "bpf: Register mptcp common kfunc set" doesn't
> match the
> code, please update it as:
> 
> '''
> bpf: Register mptcp common kfunc set
> 
> MPTCP helper mptcp_subflow_ctx() is used to convert struct sock to
> struct mptcp_subflow_context. It will be used in MPTCP BPF programs.
> 
> This patch defines corresponding wrapper of this helper, and put it
> into the newly defined mptcp common kfunc set and register this set
> with the flag BPF_PROG_TYPE_CGROUP_SOCKOPT to let it accessible to
> the 'cgroup/getsockopt' type of BPF programs.
> '''
> 
> v2:
>  - Drop bpf_skc_to_mptcp_sock
>  - Check the owner before assigning the msk as Mat suggested.
>  - Use bpf_core_cast() in mptcp_subflow bpf_iter subtest instead of
> using bpf_skc_to_mptcp_sock().
> 
> Address Martin's suggestions for "Add mptcp_subflow bpf_iter support"
> v2.
> 
> Geliang Tang (5):
>   Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock"
>   Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt"
>   Squash to "bpf: Add mptcp_subflow bpf_iter"
>   Revert "bpf: Acquire and release mptcp socket"
>   Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest"
> 
>  include/net/mptcp.h                           |  4 +-
>  kernel/bpf/cgroup.c                           |  2 -
>  net/core/filter.c                             |  2 +-
>  net/mptcp/bpf.c                               | 41 ++++-------------
> --
>  .../testing/selftests/bpf/bpf_experimental.h  |  2 +-
>  tools/testing/selftests/bpf/progs/mptcp_bpf.h |  5 ---
>  .../selftests/bpf/progs/mptcp_bpf_iters.c     | 10 ++---
>  7 files changed, 15 insertions(+), 51 deletions(-)
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (5 preceding siblings ...)
  2025-02-24  3:56 ` [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
@ 2025-02-24  4:47 ` MPTCP CI
  2025-02-24 11:59 ` Matthieu Baerts
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: MPTCP CI @ 2025-02-24  4:47 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

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/13490473539

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


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)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (6 preceding siblings ...)
  2025-02-24  4:47 ` MPTCP CI
@ 2025-02-24 11:59 ` Matthieu Baerts
  2025-02-26  1:05 ` Mat Martineau
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2025-02-24 11:59 UTC (permalink / raw)
  To: Geliang Tang, Mat Martineau; +Cc: Geliang Tang, mptcp

Hi Geliang, Mat,

On 24/02/2025 04:37, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - drop sock_owned_by_user_nocheck and spin_is_locked. According to
>    comments from Mat and Martin, in this set mptcp_subflow
>    bpf_iter only used from a cg sockopt bpf prog, no need to add these
>    check at this moment.

The v4 looks OK to me, but I prefer to wait for Mat's ACK, if that's OK,
because he reviewed the original series.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (7 preceding siblings ...)
  2025-02-24 11:59 ` Matthieu Baerts
@ 2025-02-26  1:05 ` Mat Martineau
  2025-03-05 15:31 ` Matthieu Baerts
  2025-03-06  1:50 ` Geliang Tang
  10 siblings, 0 replies; 16+ messages in thread
From: Mat Martineau @ 2025-02-26  1:05 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp, Geliang Tang

On Mon, 24 Feb 2025, Geliang Tang wrote:

> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> v4:
> - drop sock_owned_by_user_nocheck and spin_is_locked. According to
>   comments from Mat and Martin, in this set mptcp_subflow
>   bpf_iter only used from a cg sockopt bpf prog, no need to add these
>   check at this moment.

Hi Geliang -

Sorry to continue the churn on this. I looked at Martin's comment in 
https://lore.kernel.org/mptcp/fdf0ddbe-e007-4a5f-bbdf-9a144e8fbe35@linux.dev/ 
where he says:

"For the cg get/setsockopt hook here, the lock should have already been 
held earlier in the kernel."

For the getsockopt case, there is a file layer lock held that ensures the 
'struct socket' remains valid while this hook is run, but no lock is 
acquired that prevents changes to msk->conn_list. It's not safe to iterate 
over the conn_list without protection from lock_sock() / unlock_sock().

As Matthieu noted in 
https://lore.kernel.org/mptcp/3b5af48e-4155-4b98-b67b-b75d9fb6285e@kernel.org/, 
when used in a bpf scheduler the msk lock will be held. But the test code 
called via getsockopt is a case where it's not protected, and a change to 
the linked list during iteration could lead to undefined behavior.

I'll talk about it with Matthieu in the meeting this week too.

- Mat


>
> v3:
> - patch 3, continue to use sock_owned_by_user_nocheck() and spin_is_locked()
> checks instead of using msk_owned_by_me().
> - patch 5, drop declaration of bpf_mptcp_subflow_tcp_sock. It's no longer
> used.
> - patch 5, update the comment for mptcp_subflow_tcp_sock(), which is a BPF
> helper, not a kfunc.
>
> The commit log of "bpf: Register mptcp common kfunc set" doesn't match the
> code, please update it as:
>
> '''
> bpf: Register mptcp common kfunc set
>
> MPTCP helper mptcp_subflow_ctx() is used to convert struct sock to
> struct mptcp_subflow_context. It will be used in MPTCP BPF programs.
>
> This patch defines corresponding wrapper of this helper, and put it
> into the newly defined mptcp common kfunc set and register this set
> with the flag BPF_PROG_TYPE_CGROUP_SOCKOPT to let it accessible to
> the 'cgroup/getsockopt' type of BPF programs.
> '''
>
> v2:
> - Drop bpf_skc_to_mptcp_sock
> - Check the owner before assigning the msk as Mat suggested.
> - Use bpf_core_cast() in mptcp_subflow bpf_iter subtest instead of
> using bpf_skc_to_mptcp_sock().
>
> Address Martin's suggestions for "Add mptcp_subflow bpf_iter support" v2.
>
> Geliang Tang (5):
>  Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock"
>  Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt"
>  Squash to "bpf: Add mptcp_subflow bpf_iter"
>  Revert "bpf: Acquire and release mptcp socket"
>  Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest"
>
> include/net/mptcp.h                           |  4 +-
> kernel/bpf/cgroup.c                           |  2 -
> net/core/filter.c                             |  2 +-
> net/mptcp/bpf.c                               | 41 ++++---------------
> .../testing/selftests/bpf/bpf_experimental.h  |  2 +-
> tools/testing/selftests/bpf/progs/mptcp_bpf.h |  5 ---
> .../selftests/bpf/progs/mptcp_bpf_iters.c     | 10 ++---
> 7 files changed, 15 insertions(+), 51 deletions(-)
>
> -- 
> 2.43.0
>
>
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (8 preceding siblings ...)
  2025-02-26  1:05 ` Mat Martineau
@ 2025-03-05 15:31 ` Matthieu Baerts
  2025-03-06  1:50 ` Geliang Tang
  10 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2025-03-05 15:31 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang, Mat,

On 24/02/2025 04:37, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - drop sock_owned_by_user_nocheck and spin_is_locked. According to
>    comments from Mat and Martin, in this set mptcp_subflow
>    bpf_iter only used from a cg sockopt bpf prog, no need to add these
>    check at this moment.

Thank you for the patches and the reviews!

Now in our tree:

New patches for t/upstream:
- fe0c24467a00: "squashed" patch 1/5 in "bpf: Extend
bpf_skc_to_mptcp_sock to MPTCP sock"
- 83bb4052ab8a: "squashed" patch 2/5 in "bpf: Allow use of
skc_to_mptcp_sock in cg_sockopt"
- dd8797c750fe: "squashed" patch 3/5 in "bpf: Add mptcp_subflow bpf_iter"
- a5e732a840e2: "squashed" my patch in "bpf: Add mptcp_subflow bpf_iter"
- 23094de26cb5: "squashed" (with conflicts) patch 4/5 in "bpf: Acquire
and release mptcp socket"
- 5a1d91403efd: "squashed" patch 5/5 in "selftests/bpf: Add
mptcp_subflow bpf_iter subtest"
- 29cc864a2cc6: tg:msg: update after the recent squash-to patch
- da6054a670da: conflict in t/mptcp-add-sched_data-helpers-2
- 401780491d45: conflict in t/mptcp-add-bpf_mptcp_sched_ops
- Results: e1315f2b7271..bf7e42dbc2fa (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/0447c3073f646734cffeec271b1a6b03a53103ef/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
                   ` (9 preceding siblings ...)
  2025-03-05 15:31 ` Matthieu Baerts
@ 2025-03-06  1:50 ` Geliang Tang
  2025-03-06  8:38   ` Matthieu Baerts
  10 siblings, 1 reply; 16+ messages in thread
From: Geliang Tang @ 2025-03-06  1:50 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

Hi Matt,

On Mon, 2025-02-24 at 11:37 +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v4:
>  - drop sock_owned_by_user_nocheck and spin_is_locked. According to
>    comments from Mat and Martin, in this set mptcp_subflow
>    bpf_iter only used from a cg sockopt bpf prog, no need to add
> these
>    check at this moment.
> 
> v3:
>  - patch 3, continue to use sock_owned_by_user_nocheck() and
> spin_is_locked()
> checks instead of using msk_owned_by_me().
>  - patch 5, drop declaration of bpf_mptcp_subflow_tcp_sock. It's no
> longer
> used.
>  - patch 5, update the comment for mptcp_subflow_tcp_sock(), which is
> a BPF
> helper, not a kfunc.
> 
> The commit log of "bpf: Register mptcp common kfunc set" doesn't
> match the
> code, please update it as:
> 
> '''
> bpf: Register mptcp common kfunc set
> 
> MPTCP helper mptcp_subflow_ctx() is used to convert struct sock to
> struct mptcp_subflow_context. It will be used in MPTCP BPF programs.
> 
> This patch defines corresponding wrapper of this helper, and put it
> into the newly defined mptcp common kfunc set and register this set
> with the flag BPF_PROG_TYPE_CGROUP_SOCKOPT to let it accessible to
> the 'cgroup/getsockopt' type of BPF programs.
> '''

Thanks for applying this set. Please update this commit log too.

-Geliang

> 
> v2:
>  - Drop bpf_skc_to_mptcp_sock
>  - Check the owner before assigning the msk as Mat suggested.
>  - Use bpf_core_cast() in mptcp_subflow bpf_iter subtest instead of
> using bpf_skc_to_mptcp_sock().
> 
> Address Martin's suggestions for "Add mptcp_subflow bpf_iter support"
> v2.
> 
> Geliang Tang (5):
>   Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock"
>   Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt"
>   Squash to "bpf: Add mptcp_subflow bpf_iter"
>   Revert "bpf: Acquire and release mptcp socket"
>   Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest"
> 
>  include/net/mptcp.h                           |  4 +-
>  kernel/bpf/cgroup.c                           |  2 -
>  net/core/filter.c                             |  2 +-
>  net/mptcp/bpf.c                               | 41 ++++-------------
> --
>  .../testing/selftests/bpf/bpf_experimental.h  |  2 +-
>  tools/testing/selftests/bpf/progs/mptcp_bpf.h |  5 ---
>  .../selftests/bpf/progs/mptcp_bpf_iters.c     | 10 ++---
>  7 files changed, 15 insertions(+), 51 deletions(-)
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support"
  2025-03-06  1:50 ` Geliang Tang
@ 2025-03-06  8:38   ` Matthieu Baerts
  0 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2025-03-06  8:38 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang,

On 06/03/2025 02:50, Geliang Tang wrote:
> Hi Matt,
> 
> On Mon, 2025-02-24 at 11:37 +0800, Geliang Tang wrote:
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> v4:
>>  - drop sock_owned_by_user_nocheck and spin_is_locked. According to
>>    comments from Mat and Martin, in this set mptcp_subflow
>>    bpf_iter only used from a cg sockopt bpf prog, no need to add
>> these
>>    check at this moment.
>>
>> v3:
>>  - patch 3, continue to use sock_owned_by_user_nocheck() and
>> spin_is_locked()
>> checks instead of using msk_owned_by_me().
>>  - patch 5, drop declaration of bpf_mptcp_subflow_tcp_sock. It's no
>> longer
>> used.
>>  - patch 5, update the comment for mptcp_subflow_tcp_sock(), which is
>> a BPF
>> helper, not a kfunc.
>>
>> The commit log of "bpf: Register mptcp common kfunc set" doesn't
>> match the
>> code, please update it as:
>>
>> '''
>> bpf: Register mptcp common kfunc set
>>
>> MPTCP helper mptcp_subflow_ctx() is used to convert struct sock to
>> struct mptcp_subflow_context. It will be used in MPTCP BPF programs.
>>
>> This patch defines corresponding wrapper of this helper, and put it
>> into the newly defined mptcp common kfunc set and register this set
>> with the flag BPF_PROG_TYPE_CGROUP_SOCKOPT to let it accessible to
>> the 'cgroup/getsockopt' type of BPF programs.
>> '''
> 
> Thanks for applying this set. Please update this commit log too.

Done. The modification will be visible soon:

New patches for t/upstream:
- 061566ebfca8: tg:msg: adapt 'bpf: Register mptcp common kfunc set'
- Results: 6c4b1c674680..ccf37aa90567 (export)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-03-06  8:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24  3:37 [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
2025-02-24  3:37 ` [PATCH mptcp-next v4 1/5] Revert "bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock" Geliang Tang
2025-02-24  3:37 ` [PATCH mptcp-next v4 2/5] Revert "bpf: Allow use of skc_to_mptcp_sock in cg_sockopt" Geliang Tang
2025-02-24  3:37 ` [PATCH mptcp-next v4 3/5] Squash to "bpf: Add mptcp_subflow bpf_iter" Geliang Tang
2025-02-24  3:37 ` [PATCH mptcp-next v4 4/5] Revert "bpf: Acquire and release mptcp socket" Geliang Tang
2025-02-24  3:37 ` [PATCH mptcp-next v4 5/5] Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest" Geliang Tang
2025-02-24  3:56 ` [PATCH mptcp-next v4 0/5] Squash to "Add mptcp_subflow bpf_iter support" Geliang Tang
2025-02-24  4:47 ` MPTCP CI
2025-02-24 11:59 ` Matthieu Baerts
2025-02-26  1:05 ` Mat Martineau
2025-03-05 15:31 ` Matthieu Baerts
2025-03-06  1:50 ` Geliang Tang
2025-03-06  8:38   ` Matthieu Baerts
  -- strict thread matches above, loose matches on Subject: below --
2024-12-09  8:47 Geliang Tang
2024-12-09  9:52 ` MPTCP CI
2024-12-10 11:42 ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.