From: Mat Martineau <martineau@kernel.org>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v2 11/13] bpf: Export more bpf_burst related functions
Date: Thu, 27 Jul 2023 18:33:42 -0700 (PDT) [thread overview]
Message-ID: <c811701a-1cc1-85c5-2dbb-5a7a149b604b@kernel.org> (raw)
In-Reply-To: <cb16ad49ee7b95ef6c744af0cba5b0aba5718107.1689650435.git.geliang.tang@suse.com>
On Tue, 18 Jul 2023, Geliang Tang wrote:
> sk_stream_memory_free() and tcp_rtx_and_write_queues_empty() are needed
> to export into the BPF context for bpf_burst scheduler. But these two
> functions are inline ones. So this patch added two wrappers for them,
> and export the wrappers in the BPF context.
>
> Add more bpf_burst related functions into bpf_mptcp_sched_kfunc_set to make
> sure these helpers can be accessed from the BPF context.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/bpf.c | 16 ++++++++++++++++
> net/mptcp/protocol.c | 4 ++--
> net/mptcp/protocol.h | 4 ++++
> 3 files changed, 22 insertions(+), 2 deletions(-)
>
Patches 11-13 look good to add to the "features other trees" section of
the export branch for further testing:
Reviewed-by: Mat Martineau <martineau@kernel.org>
> diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
> index e6f94d5e22fb..12b747813dee 100644
> --- a/net/mptcp/bpf.c
> +++ b/net/mptcp/bpf.c
> @@ -144,11 +144,27 @@ struct bpf_struct_ops bpf_mptcp_sched_ops = {
> .name = "mptcp_sched_ops",
> };
>
> +bool bpf_mptcp_subflow_memory_free(const struct sock *sk)
> +{
> + return sk_stream_memory_free(sk);
> +}
> +
> +bool bpf_mptcp_subflow_queues_empty(const struct sock *sk)
> +{
> + return tcp_rtx_and_write_queues_empty(sk);
> +}
> +
> BTF_SET8_START(bpf_mptcp_sched_kfunc_ids)
> BTF_ID_FLAGS(func, mptcp_subflow_set_scheduled)
> BTF_ID_FLAGS(func, mptcp_subflow_set_stale)
> BTF_ID_FLAGS(func, mptcp_sched_data_set_contexts)
> BTF_ID_FLAGS(func, mptcp_subflow_ctx_by_pos)
> +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, bpf_mptcp_subflow_memory_free)
> +BTF_ID_FLAGS(func, bpf_mptcp_subflow_queues_empty)
> +BTF_ID_FLAGS(func, mptcp_pm_subflow_chk_stale)
> BTF_SET8_END(bpf_mptcp_sched_kfunc_ids)
>
> static const struct btf_kfunc_id_set bpf_mptcp_sched_kfunc_set = {
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 9f00a0288a0a..b4218108f17f 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -50,7 +50,7 @@ DEFINE_PER_CPU(struct mptcp_delegated_action, mptcp_delegated_actions);
> static struct net_device mptcp_napi_dev;
>
> /* Returns end sequence number of the receiver's advertised window */
> -static u64 mptcp_wnd_end(const struct mptcp_sock *msk)
> +u64 mptcp_wnd_end(const struct mptcp_sock *msk)
> {
> return READ_ONCE(msk->wnd_end);
> }
> @@ -494,7 +494,7 @@ static long mptcp_timeout_from_subflow(const struct mptcp_subflow_context *subfl
> inet_csk(ssk)->icsk_timeout - jiffies : 0;
> }
>
> -static void mptcp_set_timeout(struct sock *sk)
> +void mptcp_set_timeout(struct sock *sk)
> {
> struct mptcp_subflow_context *subflow;
> long tout = 0;
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 78b3beeb7d7a..cabda60f5f76 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -635,6 +635,10 @@ void __mptcp_subflow_send_ack(struct sock *ssk);
> void mptcp_subflow_reset(struct sock *ssk);
> void mptcp_subflow_queue_clean(struct sock *sk, struct sock *ssk);
> void mptcp_sock_graft(struct sock *sk, struct socket *parent);
> +u64 mptcp_wnd_end(const struct mptcp_sock *msk);
> +void mptcp_set_timeout(struct sock *sk);
> +bool bpf_mptcp_subflow_memory_free(const struct sock *sk);
> +bool bpf_mptcp_subflow_queues_empty(const struct sock *sk);
> struct sock *__mptcp_nmpc_sk(struct mptcp_sock *msk);
> bool __mptcp_close(struct sock *sk, long timeout);
> void mptcp_cancel_work(struct sock *sk);
> --
> 2.35.3
>
>
>
next prev parent reply other threads:[~2023-07-28 1:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 3:36 [PATCH mptcp-next v2 00/13] BPF packet scheduler updates part 2 Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 01/13] Squash to "bpf: Add bpf_mptcp_sched_ops" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 02/13] Squash to "selftests/bpf: Add bpf scheduler test" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 03/13] Squash to "selftests/bpf: Add bpf_first test" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 04/13] Squash to "selftests/bpf: Add bpf_bkup scheduler" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 05/13] Squash to "selftests/bpf: Add bpf_bkup test" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 06/13] Squash to "selftests/bpf: Add bpf_rr test" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 07/13] Squash to "selftests/bpf: Add bpf_red test" Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 08/13] mptcp: add subflow_set_stale helper Geliang Tang
2023-07-28 1:30 ` Mat Martineau
2023-07-28 15:55 ` Matthieu Baerts
2023-07-28 18:23 ` Mat Martineau
2023-07-18 3:36 ` [PATCH mptcp-next v2 09/13] selftests/bpf: Add bpf_stale scheduler Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 10/13] selftests/bpf: Add bpf_stale test Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 11/13] bpf: Export more bpf_burst related functions Geliang Tang
2023-07-28 1:33 ` Mat Martineau [this message]
2023-07-18 3:36 ` [PATCH mptcp-next v2 12/13] selftests/bpf: Add bpf_burst scheduler Geliang Tang
2023-07-18 3:36 ` [PATCH mptcp-next v2 13/13] selftests/bpf: Add bpf_burst test Geliang Tang
2023-07-18 5:01 ` selftests/bpf: Add bpf_burst test: Tests Results MPTCP CI
2023-07-28 2:56 ` MPTCP CI
2023-07-28 0:53 ` [PATCH mptcp-next v2 00/13] BPF packet scheduler updates part 2 Mat Martineau
2023-07-28 16:02 ` Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c811701a-1cc1-85c5-2dbb-5a7a149b604b@kernel.org \
--to=martineau@kernel.org \
--cc=geliang.tang@suse.com \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox