Skip to content

Commit daa0597

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
bpf: Register mptcp tracing kfunc set
Since the kfuncs mptcp_subflow_active() and mptcp_subflow_set_scheduled() are invoked in the mptcp_subflow bpf_iter test in a ftrace hook for mptcp_sched_get_send(), it's necessary to register them into a BPF_PROG_TYPE_TRACING type kfunc set together with the bpf_iter mptcp_subflow helpers bpf_iter_mptcp_subflow_new()/_next()/_destroy(). Signed-off-by: Geliang Tang <[email protected]>
1 parent 692d19c commit daa0597

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/mptcp/bpf.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,12 @@ __bpf_kfunc_end_defs();
275275
__diag_pop();
276276

277277
BTF_KFUNCS_START(bpf_mptcp_sched_kfunc_ids)
278+
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new)
279+
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_next)
280+
BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_destroy)
281+
BTF_ID_FLAGS(func, mptcp_subflow_active)
278282
BTF_ID_FLAGS(func, mptcp_subflow_set_scheduled)
279283
BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx_by_pos)
280-
BTF_ID_FLAGS(func, mptcp_subflow_active)
281284
BTF_ID_FLAGS(func, mptcp_set_timeout)
282285
BTF_ID_FLAGS(func, mptcp_wnd_end)
283286
BTF_ID_FLAGS(func, tcp_stream_memory_free)
@@ -295,6 +298,8 @@ static int __init bpf_mptcp_kfunc_init(void)
295298
int ret;
296299

297300
ret = register_btf_fmodret_id_set(&bpf_mptcp_fmodret_set);
301+
ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING,
302+
&bpf_mptcp_sched_kfunc_set);
298303
ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_STRUCT_OPS,
299304
&bpf_mptcp_sched_kfunc_set);
300305
#ifdef CONFIG_BPF_JIT

0 commit comments

Comments
 (0)