Skip to content

Commit ae752e4

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
Squash to "selftests/bpf: Add bpf_first scheduler & test"
Use the newly added bpf_for_each() helper to walk the conn_list. Drop bpf_mptcp_subflow_ctx_by_pos declaration. Signed-off-by: Geliang Tang <[email protected]>
1 parent 73f3c68 commit ae752e4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tools/testing/selftests/bpf/progs/mptcp_bpf.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,4 @@ bpf_mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow) __ksym;
5555
extern void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,
5656
bool scheduled) __ksym;
5757

58-
extern struct mptcp_subflow_context *
59-
bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos) __ksym;
60-
6158
#endif

tools/testing/selftests/bpf/progs/mptcp_bpf_first.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ SEC("struct_ops")
2020
int BPF_PROG(bpf_first_get_subflow, struct mptcp_sock *msk,
2121
struct mptcp_sched_data *data)
2222
{
23-
mptcp_subflow_set_scheduled(bpf_mptcp_subflow_ctx_by_pos(data, 0), true);
23+
struct mptcp_subflow_context *subflow;
24+
25+
subflow = bpf_mptcp_subflow_ctx(msk->first);
26+
if (!subflow)
27+
return -1;
28+
29+
mptcp_subflow_set_scheduled(subflow, true);
2430
return 0;
2531
}
2632

0 commit comments

Comments
 (0)