MPTCP Linux Development
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v4 01/10] Squash to "mptcp: add struct mptcp_sched_ops"
Date: Tue, 31 May 2022 17:38:56 -0700 (PDT)	[thread overview]
Message-ID: <8e7fff78-1f64-2757-c6c-a7ce826cef5a@linux.intel.com> (raw)
In-Reply-To: <fc0419737e68303ab2f9da821b740f5069d1da7e.1653987929.git.geliang.tang@suse.com>

On Tue, 31 May 2022, Geliang Tang wrote:

> Use bitmap instead of sock in struct mptcp_sched_data.
>
> Please update the commit log:
>
> '''
> This patch defines struct mptcp_sched_ops, which has three struct members,
> name, owner and list, and three function pointers, init, release and
> get_subflow.
>
> Add the scheduler registering, unregistering and finding functions to add,
> delete and find a packet scheduler on the global list mptcp_sched_list.
>
> The BPF scheduler function get_subflow() has a struct mptcp_sched_data
> parameter, which contains a mptcp_subflow_context array. Add a new member
> scheduled for mptcp_subflow_context, which will be set in the MPTCP
> scheduler context when the scheduler picks this subflow to send data.
> '''
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> include/net/mptcp.h                           |  7 ++++---
> net/mptcp/protocol.h                          |  1 +
> tools/testing/selftests/bpf/bpf_tcp_helpers.h | 11 ++++++++---
> 3 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index 6456ea26e4c7..7af7fd48acc7 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -97,14 +97,15 @@ struct mptcp_out_options {
> };
>
> #define MPTCP_SCHED_NAME_MAX	16
> +#define MPTCP_SUBFLOWS_MAX	8
>
> struct mptcp_sched_data {
> -	struct sock	*sock;
> -	bool		call_again;
> +	bool	reinject;
> +	struct mptcp_subflow_context *contexts[MPTCP_SUBFLOWS_MAX];

Ok - the BPF verifier is able to handle this array? That's good news.

> };
>
> struct mptcp_sched_ops {
> -	void (*get_subflow)(const struct mptcp_sock *msk, bool reinject,
> +	void (*get_subflow)(const struct mptcp_sock *msk,
> 			    struct mptcp_sched_data *data);
>
> 	char			name[MPTCP_SCHED_NAME_MAX];
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 8739794166d8..48c5261b7b15 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -469,6 +469,7 @@ struct mptcp_subflow_context {
> 		valid_csum_seen : 1;        /* at least one csum validated */
> 	enum mptcp_data_avail data_avail;
> 	bool	mp_fail_response_expect;
> +	bool	scheduled;
> 	u32	remote_nonce;
> 	u64	thmac;
> 	u32	local_nonce;
> diff --git a/tools/testing/selftests/bpf/bpf_tcp_helpers.h b/tools/testing/selftests/bpf/bpf_tcp_helpers.h
> index aca4e3c6ac48..a705054f38c5 100644
> --- a/tools/testing/selftests/bpf/bpf_tcp_helpers.h
> +++ b/tools/testing/selftests/bpf/bpf_tcp_helpers.h
> @@ -231,10 +231,15 @@ extern __u32 tcp_slow_start(struct tcp_sock *tp, __u32 acked) __ksym;
> extern void tcp_cong_avoid_ai(struct tcp_sock *tp, __u32 w, __u32 acked) __ksym;
>
> #define MPTCP_SCHED_NAME_MAX	16
> +#define MPTCP_SUBFLOWS_MAX	8
> +
> +struct mptcp_subflow_context {
> +	bool	scheduled;
> +} __attribute__((preserve_access_index));

Ah, is this the array "magic"?

>
> struct mptcp_sched_data {
> -	struct sock	*sock;
> -	bool		call_again;
> +	bool	reinject;
> +	struct mptcp_subflow_context *contexts[MPTCP_SUBFLOWS_MAX];
> };
>
> struct mptcp_sched_ops {
> @@ -243,7 +248,7 @@ struct mptcp_sched_ops {
> 	void (*init)(const struct mptcp_sock *msk);
> 	void (*release)(const struct mptcp_sock *msk);
>
> -	void (*get_subflow)(const struct mptcp_sock *msk, bool reinject,
> +	void (*get_subflow)(const struct mptcp_sock *msk,
> 			    struct mptcp_sched_data *data);
> 	void *owner;
> };
> -- 
> 2.34.1
>
>
>

--
Mat Martineau
Intel

  reply	other threads:[~2022-06-01  0:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31  9:09 [PATCH mptcp-next v4 00/10] BPF packet scheduler Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 01/10] Squash to "mptcp: add struct mptcp_sched_ops" Geliang Tang
2022-06-01  0:38   ` Mat Martineau [this message]
2022-05-31  9:09 ` [PATCH mptcp-next v4 02/10] Squash to "mptcp: add sched in mptcp_sock" Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 03/10] Squash to "mptcp: add get_subflow wrappers" Geliang Tang
2022-06-01  0:59   ` Mat Martineau
2022-05-31  9:09 ` [PATCH mptcp-next v4 04/10] Squash to "mptcp: add bpf_mptcp_sched_ops" Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 05/10] Squash to "selftests/bpf: add bpf_first scheduler" Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 06/10] Squash to "selftests/bpf: add bpf_first test" Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 07/10] selftests/bpf: add bpf_bkup scheduler Geliang Tang
2022-06-01  1:11   ` Mat Martineau
2022-05-31  9:09 ` [PATCH mptcp-next v4 08/10] selftests/bpf: add bpf_backup test Geliang Tang
2022-05-31  9:24   ` Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 09/10] selftests/bpf: add bpf_rr scheduler Geliang Tang
2022-05-31  9:09 ` [PATCH mptcp-next v4 10/10] selftests/bpf: add bpf_rr test Geliang Tang
2022-05-31  9:21   ` selftests/bpf: add bpf_rr test: Build Failure MPTCP CI
2022-05-31 10:39   ` selftests/bpf: add bpf_rr test: Tests Results MPTCP CI

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=8e7fff78-1f64-2757-c6c-a7ce826cef5a@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --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