[PATCH mptcp-next 9/9] Squash to "selftests/bpf: Add bpf_burst scheduler"

Geliang Tang posted 9 patches 1 year, 3 months ago
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, Song Liu <song@kernel.org>, Yonghong Song <yonghong.song@linux.dev>, John Fastabend <john.fastabend@gmail.com>, KP Singh <kpsingh@kernel.org>, Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>, Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>
[PATCH mptcp-next 9/9] Squash to "selftests/bpf: Add bpf_burst scheduler"
Posted by Geliang Tang 1 year, 3 months ago
Drop data_init interface.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 .../testing/selftests/bpf/progs/mptcp_bpf_burst.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
index 8cf2ab32c159..2962067568e7 100644
--- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
+++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
@@ -77,14 +77,8 @@ void BPF_PROG(mptcp_sched_burst_release, struct mptcp_sock *msk)
 	bpf_sk_storage_delete(&mptcp_burst_map, msk);
 }
 
-void BPF_STRUCT_OPS(bpf_burst_data_init, struct mptcp_sock *msk,
-		    struct mptcp_sched_data *data)
-{
-	mptcp_sched_data_set_contexts(msk, data);
-}
-
 static int bpf_burst_get_send(struct mptcp_sock *msk,
-			      const struct mptcp_sched_data *data)
+			      struct mptcp_sched_data *data)
 {
 	struct subflow_send_info send_info[SSK_MODE_MAX];
 	struct mptcp_subflow_context *subflow;
@@ -157,7 +151,7 @@ static int bpf_burst_get_send(struct mptcp_sock *msk,
 }
 
 static int bpf_burst_get_retrans(struct mptcp_sock *msk,
-				 const struct mptcp_sched_data *data)
+				 struct mptcp_sched_data *data)
 {
 	int backup = MPTCP_SUBFLOWS_MAX, pick = MPTCP_SUBFLOWS_MAX, subflow_id;
 	struct mptcp_subflow_context *subflow;
@@ -205,8 +199,10 @@ static int bpf_burst_get_retrans(struct mptcp_sock *msk,
 }
 
 int BPF_STRUCT_OPS(bpf_burst_get_subflow, struct mptcp_sock *msk,
-		   const struct mptcp_sched_data *data)
+		   struct mptcp_sched_data *data)
 {
+	mptcp_sched_data_set_contexts(msk, data);
+
 	if (data->reinject)
 		return bpf_burst_get_retrans(msk, data);
 	return bpf_burst_get_send(msk, data);
@@ -216,7 +212,6 @@ SEC(".struct_ops")
 struct mptcp_sched_ops burst = {
 	.init		= (void *)mptcp_sched_burst_init,
 	.release	= (void *)mptcp_sched_burst_release,
-	.data_init	= (void *)bpf_burst_data_init,
 	.get_subflow	= (void *)bpf_burst_get_subflow,
 	.name		= "bpf_burst",
 };
-- 
2.35.3