public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Cheng-Yang Chou <yphbchou0911@gmail.com>
To: Zhao Mengmeng <zhaomzhao@126.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
	 Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev,  linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	 Zhao Mengmeng <zhaomengmeng@kylinos.cn>,
	Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
	 Chia-Ping Tsai <chia7712@gmail.com>
Subject: Re: [PATCH] selftests/sched_ext: Include common.bpf.h to avoid build failure
Date: Thu, 23 Apr 2026 18:52:24 +0800	[thread overview]
Message-ID: <20260423184955.G2144@cchengyang.duckdns.org> (raw)
In-Reply-To: <20260423-b4-selftest-fix-v1-1-8c72287bde3d@kylinos.cn>

Hi Zhao,

On Thu, Apr 23, 2026 at 06:42:35PM +0800, Zhao Mengmeng wrote:
> From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
> 
> In scx-cid patchsets, sched_ext selftest failed to build with following
> error:
> 
> non_scx_kfunc_deny.bpf.c:17:6: error: conflicting types for 'scx_bpf_kick_cpu'
> 17 | void scx_bpf_kick_cpu(s32 cpu, u64 flags) __ksym;
> |      ^
> tools/testing/selftests/sched_ext/build/include/vmlinux.h:136300:13: note: previous declaration is here
> 136300 | extern void scx_bpf_kick_cpu(s32 cpu, u64 flags, const struct bpf_prog_aux *aux) __weak __ksym;
> |             ^
> non_scx_kfunc_deny.bpf.c:26:23: error: too few arguments to function call, expected 3, have 2
> 26 |         scx_bpf_kick_cpu(0, 0);
> |         ~~~~~~~~~~~~~~~~     ^
> tools/testing/selftests/sched_ext/build/include/vmlinux.h:136300:13: note: 'scx_bpf_kick_cpu' declared here
> 136300 | extern void scx_bpf_kick_cpu(s32 cpu, u64 flags, const struct bpf_prog_aux *aux) __weak __ksym;
> 
> The root cause is on scx core part, but we can avoid this by including
> common.bpf.h and remove scx_bpf_kick_cpu() to make it more robust, just
> like the usage in other xx.bpf.c.
> 
> Link: https://lore.kernel.org/sched-ext/20260421071945.3110084-1-tj@kernel.org/
> Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
> Tested-by: Cheng-Yang Chou <yphbchou0911@gmail.com>

Thanks for the fix, LGTM!

> ---
>  tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c b/tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c
> index 9f16d39255e7..0d6fcc8e5eb6 100644
> --- a/tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c
> +++ b/tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c
> @@ -9,12 +9,7 @@
>   * Copyright (C) 2026 Cheng-Yang Chou <yphbchou0911@gmail.com>
>   */
>  
> -#include <vmlinux.h>
> -#include <bpf/bpf_helpers.h>
> -#include <bpf/bpf_tracing.h>
> -
> -/* SCX kfunc from scx_kfunc_ids_any set */
> -void scx_bpf_kick_cpu(s32 cpu, u64 flags) __ksym;
> +#include <scx/common.bpf.h>
>  
>  SEC("struct_ops/ssthresh")
>  __u32 BPF_PROG(tcp_ca_ssthresh, struct sock *sk)
> 
> ---
> base-commit: eff158514a85c1b81966667a880dd8bcd29bbbd1
> change-id: 20260423-b4-selftest-fix-d87cdda6185e
> 
> Best regards,
> --  
> Zhao Mengmeng <zhaomengmeng@kylinos.cn>
> 

-- 
Cheers,
Cheng-Yang

  reply	other threads:[~2026-04-23 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 10:42 [PATCH] selftests/sched_ext: Include common.bpf.h to avoid build failure Zhao Mengmeng
2026-04-23 10:52 ` Cheng-Yang Chou [this message]
2026-04-23 16:40 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260423184955.G2144@cchengyang.duckdns.org \
    --to=yphbchou0911@gmail.com \
    --cc=arighi@nvidia.com \
    --cc=bpf@vger.kernel.org \
    --cc=changwoo@igalia.com \
    --cc=chia7712@gmail.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    --cc=zhaomengmeng@kylinos.cn \
    --cc=zhaomzhao@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox