All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliang.tang@suse.com>
To: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next] Squash to "selftests/bpf: Add bpf_rr scheduler"
Date: Mon, 10 Oct 2022 19:18:54 +0800	[thread overview]
Message-ID: <20221010111854.GA4614@bogon> (raw)
In-Reply-To: <20221009154531.11543-1-geliang.tang@suse.com>

On Sun, Oct 09, 2022 at 11:45:31PM +0800, Geliang Tang wrote:
> Use last_snd instead of msk->last_snd, then last_snd of mptcp_sock could
> be removed.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
>  tools/testing/selftests/bpf/bpf_tcp_helpers.h    | 1 -
>  tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c | 7 +++++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/bpf_tcp_helpers.h b/tools/testing/selftests/bpf/bpf_tcp_helpers.h
> index c7d4a9a69cfc..c8792e6f125a 100644
> --- a/tools/testing/selftests/bpf/bpf_tcp_helpers.h
> +++ b/tools/testing/selftests/bpf/bpf_tcp_helpers.h
> @@ -257,7 +257,6 @@ struct mptcp_sched_ops {
>  struct mptcp_sock {
>  	struct inet_connection_sock	sk;
>  
> -	struct sock	*last_snd;
>  	__u32		token;
>  	struct sock	*first;
>  	char		ca_name[TCP_CA_NAME_MAX];
> diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
> index ce4e98f83e43..65d4f7f41bc2 100644
> --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
> +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
> @@ -5,10 +5,12 @@
>  #include "bpf_tcp_helpers.h"
>  
>  char _license[] SEC("license") = "GPL";
> +struct sock *last_snd = NULL;
>  
>  SEC("struct_ops/mptcp_sched_rr_init")
>  void BPF_PROG(mptcp_sched_rr_init, const struct mptcp_sock *msk)
>  {
> +	last_snd = msk->first;

This line should be dropped. Will update in v6.

-Geliang

>  }
>  
>  SEC("struct_ops/mptcp_sched_rr_release")
> @@ -22,10 +24,10 @@ void BPF_STRUCT_OPS(bpf_rr_get_subflow, const struct mptcp_sock *msk,
>  	int nr = 0;
>  
>  	for (int i = 0; i < MPTCP_SUBFLOWS_MAX; i++) {
> -		if (!msk->last_snd || !data->contexts[i])
> +		if (!last_snd || !data->contexts[i])
>  			break;
>  
> -		if (data->contexts[i]->tcp_sock == msk->last_snd) {
> +		if (data->contexts[i]->tcp_sock == last_snd) {
>  			if (i + 1 == MPTCP_SUBFLOWS_MAX || !data->contexts[i + 1])
>  				break;
>  
> @@ -35,6 +37,7 @@ void BPF_STRUCT_OPS(bpf_rr_get_subflow, const struct mptcp_sock *msk,
>  	}
>  
>  	mptcp_subflow_set_scheduled(data->contexts[nr], true);
> +	last_snd = data->contexts[nr]->tcp_sock;
>  }
>  
>  SEC(".struct_ops")
> -- 
> 2.35.3
> 

      parent reply	other threads:[~2022-10-10 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 15:45 [PATCH mptcp-next] Squash to "selftests/bpf: Add bpf_rr scheduler" Geliang Tang
2022-10-09 17:24 ` Squash to "selftests/bpf: Add bpf_rr scheduler": Tests Results MPTCP CI
2022-10-10 11:18 ` Geliang Tang [this message]

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=20221010111854.GA4614@bogon \
    --to=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 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.