:p
atchew
Login
From: Geliang Tang <tanggeliang@kylinos.cn> 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 (2): Squash to "mptcp: check sk_stream_memory_free in loop" Squash to "selftests/bpf: Add bpf_burst scheduler & test" net/mptcp/protocol.c | 5 +++-- tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.45.2
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 XXXXXXX..XXXXXXX 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -XXX,XX +XXX,XX @@ 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)); @@ -XXX,XX +XXX,XX @@ 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
From: Geliang Tang <tanggeliang@kylinos.cn> Move sk_stream_memory_free check before "send_info[backup].subflow = subflow". Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c index XXXXXXX..XXXXXXX 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c @@ -XXX,XX +XXX,XX @@ 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; @@ -XXX,XX +XXX,XX @@ 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
From: Geliang Tang <tanggeliang@kylinos.cn> v2: - Use mptcp_stream_memory_free instead of using tcp_stream_memory_free. 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(-) -- 2.45.2
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 XXXXXXX..XXXXXXX 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -XXX,XX +XXX,XX @@ 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)); @@ -XXX,XX +XXX,XX @@ 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
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 XXXXXXX..XXXXXXX 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -XXX,XX +XXX,XX @@ __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); @@ -XXX,XX +XXX,XX @@ 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
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 XXXXXXX..XXXXXXX 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c @@ -XXX,XX +XXX,XX @@ 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; @@ -XXX,XX +XXX,XX @@ 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) @@ -XXX,XX +XXX,XX @@ 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; @@ -XXX,XX +XXX,XX @@ 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