* [PATCH mptcp-next v2 1/3] Squash to "mptcp: check sk_stream_memory_free in loop"
2024-10-24 10:22 [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 Geliang Tang
@ 2024-10-24 10:22 ` Geliang Tang
2024-10-24 10:22 ` [PATCH mptcp-next v2 2/3] Squash to "bpf: Export mptcp packet scheduler helpers" Geliang Tang
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2024-10-24 10:22 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
Fix mptcp_join.sh (22) and packetdrill errors reported by CI.
Move sk_stream_memory_free check before "send_info[backup].ssk = ssk".
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/protocol.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index f36e63b84b88..2ae9b8012dcd 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1444,8 +1444,7 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
trace_mptcp_subflow_get_send(subflow);
ssk = mptcp_subflow_tcp_sock(subflow);
- if (!mptcp_subflow_active(subflow) ||
- !sk_stream_memory_free(ssk))
+ if (!mptcp_subflow_active(subflow))
continue;
tout = max(tout, mptcp_timeout_from_subflow(subflow));
@@ -1461,6 +1460,8 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
linger_time = div_u64((u64)READ_ONCE(ssk->sk_wmem_queued) << 32, pace);
if (linger_time < send_info[backup].linger_time) {
+ if (!sk_stream_memory_free(ssk))
+ continue;
send_info[backup].ssk = ssk;
send_info[backup].linger_time = linger_time;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH mptcp-next v2 2/3] Squash to "bpf: Export mptcp packet scheduler helpers"
2024-10-24 10:22 [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 Geliang Tang
2024-10-24 10:22 ` [PATCH mptcp-next v2 1/3] Squash to "mptcp: check sk_stream_memory_free in loop" Geliang Tang
@ 2024-10-24 10:22 ` Geliang Tang
2024-10-24 10:22 ` [PATCH mptcp-next v2 3/3] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Geliang Tang
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2024-10-24 10:22 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
Should use mptcp_stream_memory_free in burst scheduler, not
tcp_stream_memory_free. Add a wrapper for it.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/bpf.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index 13bdcbe34e1f..72d8be2f3853 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -284,6 +284,11 @@ __bpf_kfunc static void bpf_mptcp_sock_release(struct mptcp_sock *msk)
WARN_ON_ONCE(!sk || !refcount_dec_not_one(&sk->sk_refcnt));
}
+__bpf_kfunc bool bpf_mptcp_stream_memory_free(const struct sock *sk, int wake)
+{
+ return mptcp_stream_memory_free(sk, wake);
+}
+
__bpf_kfunc static bool bpf_mptcp_subflow_queues_empty(struct sock *sk)
{
return tcp_rtx_queue_empty(sk);
@@ -311,7 +316,7 @@ BTF_KFUNCS_START(bpf_mptcp_sched_kfunc_ids)
BTF_ID_FLAGS(func, mptcp_subflow_active)
BTF_ID_FLAGS(func, mptcp_set_timeout)
BTF_ID_FLAGS(func, mptcp_wnd_end)
-BTF_ID_FLAGS(func, tcp_stream_memory_free)
+BTF_ID_FLAGS(func, bpf_mptcp_stream_memory_free)
BTF_ID_FLAGS(func, bpf_mptcp_subflow_queues_empty)
BTF_ID_FLAGS(func, mptcp_pm_subflow_chk_stale)
BTF_KFUNCS_END(bpf_mptcp_sched_kfunc_ids)
--
2.45.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH mptcp-next v2 3/3] Squash to "selftests/bpf: Add bpf_burst scheduler & test"
2024-10-24 10:22 [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 Geliang Tang
2024-10-24 10:22 ` [PATCH mptcp-next v2 1/3] Squash to "mptcp: check sk_stream_memory_free in loop" Geliang Tang
2024-10-24 10:22 ` [PATCH mptcp-next v2 2/3] Squash to "bpf: Export mptcp packet scheduler helpers" Geliang Tang
@ 2024-10-24 10:22 ` Geliang Tang
2024-10-24 10:53 ` [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 MPTCP CI
2024-10-25 8:34 ` Geliang Tang
4 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2024-10-24 10:22 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
Move sk_stream_memory_free check before "send_info[backup].subflow
= subflow".
Use mptcp_stream_memory_free instead of using tcp_stream_memory_free.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
index 6242430d0330..1157921d2f0b 100644
--- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
+++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
@@ -23,7 +23,7 @@ struct bpf_subflow_send_info {
extern bool mptcp_subflow_active(struct mptcp_subflow_context *subflow) __ksym;
extern void mptcp_set_timeout(struct sock *sk) __ksym;
extern __u64 mptcp_wnd_end(const struct mptcp_sock *msk) __ksym;
-extern bool tcp_stream_memory_free(const struct sock *sk, int wake) __ksym;
+extern bool bpf_mptcp_stream_memory_free(const struct sock *sk, int wake) __ksym;
extern bool bpf_mptcp_subflow_queues_empty(struct sock *sk) __ksym;
extern void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk) __ksym;
@@ -49,7 +49,7 @@ static __always_inline bool __sk_stream_memory_free(const struct sock *sk, int w
if (sk->sk_wmem_queued >= sk->sk_sndbuf)
return false;
- return tcp_stream_memory_free(sk, wake);
+ return bpf_mptcp_stream_memory_free(sk, wake);
}
static __always_inline bool sk_stream_memory_free(const struct sock *sk)
@@ -87,8 +87,7 @@ static int bpf_burst_get_send(struct mptcp_sock *msk)
bool backup = subflow->backup || subflow->request_bkup;
ssk = mptcp_subflow_tcp_sock(subflow);
- if (!mptcp_subflow_active(subflow) ||
- !sk_stream_memory_free(ssk))
+ if (!mptcp_subflow_active(subflow))
continue;
nr_active += !backup;
@@ -103,6 +102,8 @@ static int bpf_burst_get_send(struct mptcp_sock *msk)
linger_time = div_u64((__u64)ssk->sk_wmem_queued << 32, pace);
if (linger_time < send_info[backup].linger_time) {
+ if (!sk_stream_memory_free(ssk))
+ continue;
send_info[backup].subflow = subflow;
send_info[backup].linger_time = linger_time;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8
2024-10-24 10:22 [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 Geliang Tang
` (2 preceding siblings ...)
2024-10-24 10:22 ` [PATCH mptcp-next v2 3/3] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Geliang Tang
@ 2024-10-24 10:53 ` MPTCP CI
2024-10-25 8:34 ` Geliang Tang
4 siblings, 0 replies; 6+ messages in thread
From: MPTCP CI @ 2024-10-24 10:53 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
But sadly, our CI spotted some issues with it when trying to build it.
You can find more details there:
https://github.com/multipath-tcp/mptcp_net-next/actions/runs/11497633619
Status: failure
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/34d3a58b0bfa
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=902633
Feel free to reply to this email if you cannot access logs, if you need
some support to fix the error, if this doesn't seem to be caused by your
modifications or if the error is a false positive one.
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8
2024-10-24 10:22 [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 Geliang Tang
` (3 preceding siblings ...)
2024-10-24 10:53 ` [PATCH mptcp-next v2 0/3] Fixes for "use bpf_iter in bpf schedulers" v8 MPTCP CI
@ 2024-10-25 8:34 ` Geliang Tang
4 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2024-10-25 8:34 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
On Thu, 2024-10-24 at 18:22 +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> v2:
> - Use mptcp_stream_memory_free instead of using
> tcp_stream_memory_free.
Sorry, I made a mistake. The parameter of sk_stream_memory_free() is
ssk (subsocket), not sk (mptcp socket). We should use
tcp_stream_memory_free() here, not mptcp_stream_memory_free().
This set is deprecated and rolled back to the previous version (v1):
https://patchwork.kernel.org/project/mptcp/cover/cover.1729738008.git.tanggeliang@kylinos.cn/
Thanks,
-Geliang
>
> Fix mptcp_join.sh (22) and packetdrill errors in "use bpf_iter in bpf
> schedulers" (v8) reported by CI.
>
> Depends on:
> - "use bpf_iter in bpf schedulers" v8
>
> Based-on: <cover.1729676320.git.tanggeliang@kylinos.cn>
>
> Geliang Tang (3):
> Squash to "mptcp: check sk_stream_memory_free in loop"
> Squash to "bpf: Export mptcp packet scheduler helpers"
> Squash to "selftests/bpf: Add bpf_burst scheduler & test"
>
> net/mptcp/bpf.c | 7 ++++++-
> net/mptcp/protocol.c | 5 +++--
> tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c | 9 +++++----
> 3 files changed, 14 insertions(+), 7 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread