Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang committed Dec 21, 2024
1 parent 47ea74c commit 4ad7e2a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 70 deletions.
2 changes: 2 additions & 0 deletions net/mptcp/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,7 @@ int mptcp_sched_get_retrans(struct mptcp_sock *msk)

if (msk->sched == &mptcp_sched_default || !msk->sched)
return mptcp_sched_default_get_retrans(msk);
if (!msk->sched->get_retrans)
return msk->sched->get_send(msk);
return msk->sched->get_retrans(msk);
}
17 changes: 3 additions & 14 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ void BPF_PROG(mptcp_sched_bkup_release, struct mptcp_sock *msk)
{
}

static int bpf_bkup_get_subflow(struct mptcp_sock *msk)
SEC("struct_ops")
int BPF_PROG(bpf_bkup_get_send, struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;

Expand All @@ -31,23 +32,11 @@ static int bpf_bkup_get_subflow(struct mptcp_sock *msk)
return 0;
}

SEC("struct_ops")
int BPF_PROG(bpf_bkup_get_send, struct mptcp_sock *msk)
{
return bpf_bkup_get_subflow(msk);
}

SEC("struct_ops")
int BPF_PROG(bpf_bkup_get_retrans, struct mptcp_sock *msk)
{
return bpf_bkup_get_subflow(msk);
}

SEC(".struct_ops.link")
struct mptcp_sched_ops bkup = {
.init = (void *)mptcp_sched_bkup_init,
.release = (void *)mptcp_sched_bkup_release,
.get_send = (void *)bpf_bkup_get_send,
.get_retrans = (void *)bpf_bkup_get_retrans,
//.get_retrans = (void *)bpf_bkup_get_send,
.name = "bpf_bkup",
};
17 changes: 3 additions & 14 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_first.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ void BPF_PROG(mptcp_sched_first_release, struct mptcp_sock *msk)
{
}

static int bpf_first_get_subflow(struct mptcp_sock *msk)
SEC("struct_ops")
int BPF_PROG(bpf_first_get_send, struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;

Expand All @@ -28,23 +29,11 @@ static int bpf_first_get_subflow(struct mptcp_sock *msk)
return 0;
}

SEC("struct_ops")
int BPF_PROG(bpf_first_get_send, struct mptcp_sock *msk)
{
return bpf_first_get_subflow(msk);
}

SEC("struct_ops")
int BPF_PROG(bpf_first_get_retrans, struct mptcp_sock *msk)
{
return bpf_first_get_subflow(msk);
}

SEC(".struct_ops.link")
struct mptcp_sched_ops first = {
.init = (void *)mptcp_sched_first_init,
.release = (void *)mptcp_sched_first_release,
.get_send = (void *)bpf_first_get_send,
.get_retrans = (void *)bpf_first_get_retrans,
//.get_retrans = (void *)bpf_first_get_send,
.name = "bpf_first",
};
17 changes: 3 additions & 14 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_red.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ void BPF_PROG(mptcp_sched_red_release, struct mptcp_sock *msk)
{
}

static int bpf_red_get_subflow(struct mptcp_sock *msk)
SEC("struct_ops")
int BPF_PROG(bpf_red_get_send, struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;

Expand All @@ -26,23 +27,11 @@ static int bpf_red_get_subflow(struct mptcp_sock *msk)
return 0;
}

SEC("struct_ops")
int BPF_PROG(bpf_red_get_send, struct mptcp_sock *msk)
{
return bpf_red_get_subflow(msk);
}

SEC("struct_ops")
int BPF_PROG(bpf_red_get_retrans, struct mptcp_sock *msk)
{
return bpf_red_get_subflow(msk);
}

SEC(".struct_ops.link")
struct mptcp_sched_ops red = {
.init = (void *)mptcp_sched_red_init,
.release = (void *)mptcp_sched_red_release,
.get_send = (void *)bpf_red_get_send,
.get_retrans = (void *)bpf_red_get_retrans,
//.get_retrans = (void *)bpf_red_get_send,
.name = "bpf_red",
};
17 changes: 3 additions & 14 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ void BPF_PROG(mptcp_sched_rr_release, struct mptcp_sock *msk)
bpf_sk_storage_delete(&mptcp_rr_map, msk);
}

static int bpf_rr_get_subflow(struct mptcp_sock *msk)
SEC("struct_ops")
int BPF_PROG(bpf_rr_get_send, struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow, *next;
struct mptcp_rr_storage *ptr;
Expand Down Expand Up @@ -65,23 +66,11 @@ static int bpf_rr_get_subflow(struct mptcp_sock *msk)
return 0;
}

SEC("struct_ops")
int BPF_PROG(bpf_rr_get_send, struct mptcp_sock *msk)
{
return bpf_rr_get_subflow(msk);
}

SEC("struct_ops")
int BPF_PROG(bpf_rr_get_retrans, struct mptcp_sock *msk)
{
return bpf_rr_get_subflow(msk);
}

SEC(".struct_ops.link")
struct mptcp_sched_ops rr = {
.init = (void *)mptcp_sched_rr_init,
.release = (void *)mptcp_sched_rr_release,
.get_send = (void *)bpf_rr_get_send,
.get_retrans = (void *)bpf_rr_get_retrans,
//.get_retrans = (void *)bpf_rr_get_send,
.name = "bpf_rr",
};
17 changes: 3 additions & 14 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_stale.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void BPF_PROG(mptcp_sched_stale_release, struct mptcp_sock *msk)
bpf_sk_storage_delete(&mptcp_stale_map, msk);
}

static int bpf_stale_get_subflow(struct mptcp_sock *msk)
SEC("struct_ops")
int BPF_PROG(bpf_stale_get_send, struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;
struct mptcp_stale_storage *storage;
Expand Down Expand Up @@ -139,23 +140,11 @@ static int bpf_stale_get_subflow(struct mptcp_sock *msk)
return 0;
}

SEC("struct_ops")
int BPF_PROG(bpf_stale_get_send, struct mptcp_sock *msk)
{
return bpf_stale_get_subflow(msk);
}

SEC("struct_ops")
int BPF_PROG(bpf_stale_get_retrans, struct mptcp_sock *msk)
{
return bpf_stale_get_subflow(msk);
}

SEC(".struct_ops.link")
struct mptcp_sched_ops stale = {
.init = (void *)mptcp_sched_stale_init,
.release = (void *)mptcp_sched_stale_release,
.get_send = (void *)bpf_stale_get_send,
.get_retrans = (void *)bpf_stale_get_retrans,
//.get_retrans = (void *)bpf_stale_get_send,
.name = "bpf_stale",
};

0 comments on commit 4ad7e2a

Please sign in to comment.