From nobody Sun Feb 8 17:36:43 2026 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF87047DD5D for ; Tue, 20 Jan 2026 22:27:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768948076; cv=none; b=JpH5uVHu/MiD8vqAE3wcFNBmz/+nGoVxKncmRNycCg0AgU8qjsiQSJ9JCkZzNa3mxiRE7hwAphDHGJbEZDhBG2yhkCGD68p0YG9IrEptWMOsVRNJee7Thr2IWKjlfTJGMljxt3HaZMilyJrTjrA2DD7VruL7nqhYYhKhwA0wG+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768948076; c=relaxed/simple; bh=vBHjyw/hYj3zLonFk9pCUtMlB1Ka+QnD60kV7c0604Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=agJcsOKLhVqi1Lc1S/qFtXGCH+RJI3L4i3b3qLLmtwqUMfk/yXFpj8gNhXyUS0I7NKhkOCV7VEPe4dFKgExMJ67jM0XyCTWdn5lpdjCy6go49AGHHNnhIcidRkRgGYmL6FzsS+uJxdcl2tbZ8hSQ9pHM3iGv4JtoVkRWu3T8RN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=qxCGaklw; arc=none smtp.client-ip=95.215.58.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qxCGaklw" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768948065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xd1q0+5EcF59BHhz0hdJGHGQYrQFn/Df+WIN5kKXCbQ=; b=qxCGaklwgqhBh7FvOEQ5wUq3L2iuB2Z0wAC9N00AS62JTR1HOf5P3xiSiZCE7ue5S4mpMC scfjc8dq/k/CuLqEjGeHMOUBgZ7nVfB/PN7ep+4qwG0eiWHGkoubmZ7/2eekRxpF3Uwjzi DoI1tYPuwwLBOoahOsCFam9Am2WvxWM= From: Ihor Solodrai To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman Cc: Mykyta Yatsenko , Tejun Heo , Alan Maguire , Benjamin Tissoires , Jiri Kosina , Amery Hung , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, sched-ext@lists.linux.dev Subject: [PATCH bpf-next v3 11/13] selftests/bpf: Migrate struct_ops_assoc test to KF_IMPLICIT_ARGS Date: Tue, 20 Jan 2026 14:26:36 -0800 Message-ID: <20260120222638.3976562-12-ihor.solodrai@linux.dev> In-Reply-To: <20260120222638.3976562-1-ihor.solodrai@linux.dev> References: <20260120222638.3976562-1-ihor.solodrai@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" A test kfunc named bpf_kfunc_multi_st_ops_test_1_impl() is a user of __prog suffix. Subsequent patch removes __prog support in favor of KF_IMPLICIT_ARGS, so migrate this kfunc to use implicit argument. Signed-off-by: Ihor Solodrai --- tools/testing/selftests/bpf/progs/struct_ops_assoc.c | 8 ++++---- .../selftests/bpf/progs/struct_ops_assoc_in_timer.c | 4 ++-- .../testing/selftests/bpf/progs/struct_ops_assoc_reuse.c | 6 +++--- tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 9 ++++----- .../testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h | 6 ++++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/struct_ops_assoc.c b/tools/t= esting/selftests/bpf/progs/struct_ops_assoc.c index 8f1097903e22..68842e3f936b 100644 --- a/tools/testing/selftests/bpf/progs/struct_ops_assoc.c +++ b/tools/testing/selftests/bpf/progs/struct_ops_assoc.c @@ -32,7 +32,7 @@ int BPF_PROG(sys_enter_prog_a, struct pt_regs *regs, long= id) if (!test_pid || task->pid !=3D test_pid) return 0; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_A_MAGIC) test_err_a++; =20 @@ -45,7 +45,7 @@ int syscall_prog_a(void *ctx) struct st_ops_args args =3D {}; int ret; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_A_MAGIC) test_err_a++; =20 @@ -79,7 +79,7 @@ int BPF_PROG(sys_enter_prog_b, struct pt_regs *regs, long= id) if (!test_pid || task->pid !=3D test_pid) return 0; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_B_MAGIC) test_err_b++; =20 @@ -92,7 +92,7 @@ int syscall_prog_b(void *ctx) struct st_ops_args args =3D {}; int ret; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_B_MAGIC) test_err_b++; =20 diff --git a/tools/testing/selftests/bpf/progs/struct_ops_assoc_in_timer.c = b/tools/testing/selftests/bpf/progs/struct_ops_assoc_in_timer.c index d5a2ea934284..0bed49e9f217 100644 --- a/tools/testing/selftests/bpf/progs/struct_ops_assoc_in_timer.c +++ b/tools/testing/selftests/bpf/progs/struct_ops_assoc_in_timer.c @@ -31,7 +31,7 @@ __noinline static int timer_cb(void *map, int *key, struc= t bpf_timer *timer) struct st_ops_args args =3D {}; =20 recur++; - timer_test_1_ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + timer_test_1_ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); recur--; =20 timer_cb_run++; @@ -64,7 +64,7 @@ int syscall_prog(void *ctx) struct st_ops_args args =3D {}; int ret; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_MAGIC) test_err++; =20 diff --git a/tools/testing/selftests/bpf/progs/struct_ops_assoc_reuse.c b/t= ools/testing/selftests/bpf/progs/struct_ops_assoc_reuse.c index 5bb6ebf5eed4..396b3e58c729 100644 --- a/tools/testing/selftests/bpf/progs/struct_ops_assoc_reuse.c +++ b/tools/testing/selftests/bpf/progs/struct_ops_assoc_reuse.c @@ -23,7 +23,7 @@ int BPF_PROG(test_1_a, struct st_ops_args *args) =20 if (!recur) { recur++; - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(args); if (ret !=3D -1) test_err_a++; recur--; @@ -40,7 +40,7 @@ int syscall_prog_a(void *ctx) struct st_ops_args args =3D {}; int ret; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_A_MAGIC) test_err_a++; =20 @@ -62,7 +62,7 @@ int syscall_prog_b(void *ctx) struct st_ops_args args =3D {}; int ret; =20 - ret =3D bpf_kfunc_multi_st_ops_test_1_impl(&args, NULL); + ret =3D bpf_kfunc_multi_st_ops_test_1_assoc(&args); if (ret !=3D MAP_A_MAGIC) test_err_b++; =20 diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/t= esting/selftests/bpf/test_kmods/bpf_testmod.c index a996b816ecc4..0d542ba64365 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c @@ -1140,7 +1140,7 @@ __bpf_kfunc int bpf_kfunc_st_ops_inc10(struct st_ops_= args *args) } =20 __bpf_kfunc int bpf_kfunc_multi_st_ops_test_1(struct st_ops_args *args, u3= 2 id); -__bpf_kfunc int bpf_kfunc_multi_st_ops_test_1_impl(struct st_ops_args *arg= s, void *aux_prog); +__bpf_kfunc int bpf_kfunc_multi_st_ops_test_1_assoc(struct st_ops_args *ar= gs, struct bpf_prog_aux *aux); =20 __bpf_kfunc int bpf_kfunc_implicit_arg(int a, struct bpf_prog_aux *aux); __bpf_kfunc int bpf_kfunc_implicit_arg_legacy(int a, int b, struct bpf_pro= g_aux *aux); @@ -1187,7 +1187,7 @@ BTF_ID_FLAGS(func, bpf_kfunc_st_ops_test_epilogue, KF= _SLEEPABLE) BTF_ID_FLAGS(func, bpf_kfunc_st_ops_test_pro_epilogue, KF_SLEEPABLE) BTF_ID_FLAGS(func, bpf_kfunc_st_ops_inc10) BTF_ID_FLAGS(func, bpf_kfunc_multi_st_ops_test_1) -BTF_ID_FLAGS(func, bpf_kfunc_multi_st_ops_test_1_impl) +BTF_ID_FLAGS(func, bpf_kfunc_multi_st_ops_test_1_assoc, KF_IMPLICIT_ARGS) BTF_ID_FLAGS(func, bpf_kfunc_implicit_arg, KF_IMPLICIT_ARGS) BTF_ID_FLAGS(func, bpf_kfunc_implicit_arg_legacy, KF_IMPLICIT_ARGS) BTF_ID_FLAGS(func, bpf_kfunc_implicit_arg_legacy_impl) @@ -1669,13 +1669,12 @@ int bpf_kfunc_multi_st_ops_test_1(struct st_ops_arg= s *args, u32 id) } =20 /* Call test_1() of the associated struct_ops map */ -int bpf_kfunc_multi_st_ops_test_1_impl(struct st_ops_args *args, void *aux= __prog) +int bpf_kfunc_multi_st_ops_test_1_assoc(struct st_ops_args *args, struct b= pf_prog_aux *aux) { - struct bpf_prog_aux *prog_aux =3D (struct bpf_prog_aux *)aux__prog; struct bpf_testmod_multi_st_ops *st_ops; int ret =3D -1; =20 - st_ops =3D (struct bpf_testmod_multi_st_ops *)bpf_prog_get_assoc_struct_o= ps(prog_aux); + st_ops =3D (struct bpf_testmod_multi_st_ops *)bpf_prog_get_assoc_struct_o= ps(aux); if (st_ops) ret =3D st_ops->test_1(args); =20 diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h b/t= ools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h index 2357a0340ffe..225ea30c4e3d 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h @@ -161,7 +161,9 @@ void bpf_kfunc_rcu_task_test(struct task_struct *ptr) _= _ksym; struct task_struct *bpf_kfunc_ret_rcu_test(void) __ksym; int *bpf_kfunc_ret_rcu_test_nostruct(int rdonly_buf_size) __ksym; =20 -int bpf_kfunc_multi_st_ops_test_1(struct st_ops_args *args, u32 id) __ksym; -int bpf_kfunc_multi_st_ops_test_1_impl(struct st_ops_args *args, void *aux= __prog) __ksym; +#ifndef __KERNEL__ +extern int bpf_kfunc_multi_st_ops_test_1(struct st_ops_args *args, u32 id)= __weak __ksym; +extern int bpf_kfunc_multi_st_ops_test_1_assoc(struct st_ops_args *args) _= _weak __ksym; +#endif =20 #endif /* _BPF_TESTMOD_KFUNC_H */ --=20 2.52.0