Skip to content

Commit

Permalink
Squash to "selftests/bpf: Add bpf_burst scheduler"
Browse files Browse the repository at this point in the history
Drop data_init interface.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang authored and intel-lab-lkp committed Aug 15, 2023
1 parent e38a26e commit 38a5ecc
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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",
};

0 comments on commit 38a5ecc

Please sign in to comment.