diff mbox series

[bpf-next,1/2] libbpf: Add missing per-arch include path

Message ID 20240927131355.350918-1-bjorn@kernel.org (mailing list archive)
State Accepted
Commit 710fbca820c721cdd60fa8c5bbe9deb4c0788aae
Delegated to: BPF
Headers show
Series [bpf-next,1/2] libbpf: Add missing per-arch include path | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR success PR summary
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for bpf-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/build_tools success Errors and warnings before: 4 this patch: 4
netdev/cc_maintainers fail 2 blamed authors not CCed: palmer@dabbelt.com parri.andrea@gmail.com; 14 maintainers not CCed: palmer@dabbelt.com aou@eecs.berkeley.edu parri.andrea@gmail.com sdf@fomichev.me paul.walmsley@sifive.com haoluo@google.com jolsa@kernel.org daniel@iogearbox.net song@kernel.org yonghong.song@linux.dev ast@kernel.org kpsingh@kernel.org martin.lau@linux.dev john.fastabend@gmail.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 11 this patch: 11
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-0 success Logs for Lint
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-3 success Logs for Validate matrix.py
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Unittests
bpf/vmtest-bpf-next-VM_Test-5 success Logs for aarch64-gcc / build-release
bpf/vmtest-bpf-next-VM_Test-4 success Logs for aarch64-gcc / build / build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for aarch64-gcc / test (test_verifier, false, 360) / test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-12 success Logs for s390x-gcc / build-release
bpf/vmtest-bpf-next-VM_Test-10 success Logs for aarch64-gcc / veristat
bpf/vmtest-bpf-next-VM_Test-11 success Logs for s390x-gcc / build / build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for aarch64-gcc / test (test_maps, false, 360) / test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for s390x-gcc / test (test_verifier, false, 360) / test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for s390x-gcc / veristat
bpf/vmtest-bpf-next-VM_Test-17 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-19 success Logs for x86_64-gcc / build-release
bpf/vmtest-bpf-next-VM_Test-18 success Logs for x86_64-gcc / build / build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-7 success Logs for aarch64-gcc / test (test_progs, false, 360) / test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for aarch64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-33 success Logs for x86_64-llvm-17 / veristat
bpf/vmtest-bpf-next-VM_Test-27 success Logs for x86_64-llvm-17 / build / build for x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-13 success Logs for s390x-gcc / test (test_progs, false, 360) / test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-14 success Logs for s390x-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for x86_64-llvm-17 / build-release / build for x86_64 with llvm-17-O2
bpf/vmtest-bpf-next-VM_Test-41 success Logs for x86_64-llvm-18 / veristat
bpf/vmtest-bpf-next-VM_Test-34 success Logs for x86_64-llvm-18 / build / build for x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-35 success Logs for x86_64-llvm-18 / build-release / build for x86_64 with llvm-18-O2
bpf/vmtest-bpf-next-VM_Test-20 success Logs for x86_64-gcc / test (test_maps, false, 360) / test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-25 success Logs for x86_64-gcc / test (test_verifier, false, 360) / test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for x86_64-gcc / test (test_progs_no_alu32_parallel, true, 30) / test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-26 success Logs for x86_64-gcc / veristat / veristat on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-24 success Logs for x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-29 success Logs for x86_64-llvm-17 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-32 success Logs for x86_64-llvm-17 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-22 success Logs for x86_64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-21 success Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-36 success Logs for x86_64-llvm-18 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-37 success Logs for x86_64-llvm-18 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-38 success Logs for x86_64-llvm-18 / test (test_progs_cpuv4, false, 360) / test_progs_cpuv4 on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-30 success Logs for x86_64-llvm-17 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-40 success Logs for x86_64-llvm-18 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-18
bpf/vmtest-bpf-next-VM_Test-31 success Logs for x86_64-llvm-17 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-39 success Logs for x86_64-llvm-18 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-18

Commit Message

Björn Töpel Sept. 27, 2024, 1:13 p.m. UTC
From: Björn Töpel <bjorn@rivosinc.com>

libbpf does not include the per-arch tools include path, e.g.
tools/arch/riscv/include. Some architectures depend those files to
build properly.

Include tools/arch/$(SUBARCH)/include in the libbpf build.

Fixes: 6d74d178fe6e ("tools: Add riscv barrier implementation")
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
 tools/lib/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


base-commit: db5ca265e3334b48c4e3fa07eef79e8bc578c430

Comments

Andrii Nakryiko Sept. 27, 2024, 8:50 p.m. UTC | #1
On Fri, Sep 27, 2024 at 6:14 AM Björn Töpel <bjorn@kernel.org> wrote:
>
> From: Björn Töpel <bjorn@rivosinc.com>
>
> libbpf does not include the per-arch tools include path, e.g.
> tools/arch/riscv/include. Some architectures depend those files to
> build properly.
>
> Include tools/arch/$(SUBARCH)/include in the libbpf build.
>
> Fixes: 6d74d178fe6e ("tools: Add riscv barrier implementation")
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> ---
>  tools/lib/bpf/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 1b22f0f37288..857a5f7b413d 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -61,7 +61,8 @@ ifndef VERBOSE
>  endif
>
>  INCLUDES = -I$(or $(OUTPUT),.) \
> -          -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
> +          -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi \
> +          -I$(srctree)/tools/arch/$(SRCARCH)/include
>
>  export prefix libdir src obj
>

Do you know what exactly is used from tools/arch/$(SRCARCH)/include
for (I assume) RISC-V? I'm asking because we'd need to make sure that
Github version of libbpf Makefile and include directory has all the
necessary pieces as well (so I'd appreciate if you could take a look
at that as well, if you haven't already).

>
> base-commit: db5ca265e3334b48c4e3fa07eef79e8bc578c430
> --
> 2.43.0
>
Björn Töpel Sept. 28, 2024, 9:11 a.m. UTC | #2
Andrii,

On Fri, 27 Sept 2024 at 22:51, Andrii Nakryiko
<andrii.nakryiko@gmail.com> wrote:
>
> On Fri, Sep 27, 2024 at 6:14 AM Björn Töpel <bjorn@kernel.org> wrote:
> >
> > From: Björn Töpel <bjorn@rivosinc.com>
> >
> > libbpf does not include the per-arch tools include path, e.g.
> > tools/arch/riscv/include. Some architectures depend those files to
> > build properly.
> >
> > Include tools/arch/$(SUBARCH)/include in the libbpf build.
> >
> > Fixes: 6d74d178fe6e ("tools: Add riscv barrier implementation")
> > Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> > ---
> >  tools/lib/bpf/Makefile | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> > index 1b22f0f37288..857a5f7b413d 100644
> > --- a/tools/lib/bpf/Makefile
> > +++ b/tools/lib/bpf/Makefile
> > @@ -61,7 +61,8 @@ ifndef VERBOSE
> >  endif
> >
> >  INCLUDES = -I$(or $(OUTPUT),.) \
> > -          -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
> > +          -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi \
> > +          -I$(srctree)/tools/arch/$(SRCARCH)/include
> >
> >  export prefix libdir src obj
> >
>
> Do you know what exactly is used from tools/arch/$(SRCARCH)/include
> for (I assume) RISC-V? I'm asking because we'd need to make sure that
> Github version of libbpf Makefile and include directory has all the
> necessary pieces as well (so I'd appreciate if you could take a look
> at that as well, if you haven't already).

Ah, apologies for not stating that explicitly. It's
tools/arch/riscv/include/asm/{barrier.h,fence.h}

Cheers,
Björn
patchwork-bot+netdevbpf@kernel.org Oct. 8, 2024, 3:30 a.m. UTC | #3
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Fri, 27 Sep 2024 15:13:52 +0200 you wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
> 
> libbpf does not include the per-arch tools include path, e.g.
> tools/arch/riscv/include. Some architectures depend those files to
> build properly.
> 
> Include tools/arch/$(SUBARCH)/include in the libbpf build.
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/2] libbpf: Add missing per-arch include path
    https://git.kernel.org/bpf/bpf-next/c/710fbca820c7
  - [bpf-next,2/2] selftests: bpf: Add missing per-arch include path
    https://git.kernel.org/bpf/bpf-next/c/19090f0306f1

You are awesome, thank you!
Alexandre Ghiti Nov. 4, 2024, 10:04 a.m. UTC | #4
Hi Bjorn,

On 27/09/2024 15:13, Björn Töpel wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
>
> libbpf does not include the per-arch tools include path, e.g.
> tools/arch/riscv/include. Some architectures depend those files to
> build properly.
>
> Include tools/arch/$(SUBARCH)/include in the libbpf build.
>
> Fixes: 6d74d178fe6e ("tools: Add riscv barrier implementation")
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> ---
>   tools/lib/bpf/Makefile | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 1b22f0f37288..857a5f7b413d 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -61,7 +61,8 @@ ifndef VERBOSE
>   endif
>   
>   INCLUDES = -I$(or $(OUTPUT),.) \
> -	   -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
> +	   -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi \
> +	   -I$(srctree)/tools/arch/$(SRCARCH)/include
>   
>   export prefix libdir src obj
>   
>
> base-commit: db5ca265e3334b48c4e3fa07eef79e8bc578c430


You can add:

Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks,

Alex
Björn Töpel Nov. 4, 2024, 10:25 a.m. UTC | #5
patchwork-bot+netdevbpf@kernel.org writes:

> Hello:
>
> This series was applied to bpf/bpf-next.git (master)
> by Andrii Nakryiko <andrii@kernel.org>:
>
> On Fri, 27 Sep 2024 15:13:52 +0200 you wrote:
>> From: Björn Töpel <bjorn@rivosinc.com>
>> 
>> libbpf does not include the per-arch tools include path, e.g.
>> tools/arch/riscv/include. Some architectures depend those files to
>> build properly.
>> 
>> Include tools/arch/$(SUBARCH)/include in the libbpf build.
>> 
>> [...]
>
> Here is the summary with links:
>   - [bpf-next,1/2] libbpf: Add missing per-arch include path
>     https://git.kernel.org/bpf/bpf-next/c/710fbca820c7
>   - [bpf-next,2/2] selftests: bpf: Add missing per-arch include path
>     https://git.kernel.org/bpf/bpf-next/c/19090f0306f1

Andrii, I just noted that this landed into bpf-next, and not bpf
(fixes).

RISC-V libbpf/perf needs this fix in 6.12 to properly build. Would it be
possible to have it in the bpf tree, and have it land in 6.12-rc7?

Andreas that has a similar fix [1].


Björn

[1] https://lore.kernel.org/linux-riscv/mvm5xq44bqh.fsf@suse.de/
Kexy Biscuit Nov. 5, 2024, 11:46 a.m. UTC | #6
On 9/27/2024 9:13 PM, Björn Töpel wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
> 
> libbpf does not include the per-arch tools include path, e.g.
> tools/arch/riscv/include. Some architectures depend those files to
> build properly.
> 
> Include tools/arch/$(SUBARCH)/include in the libbpf build.
> 
> Fixes: 6d74d178fe6e ("tools: Add riscv barrier implementation")
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> ---
>   tools/lib/bpf/Makefile | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 1b22f0f37288..857a5f7b413d 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -61,7 +61,8 @@ ifndef VERBOSE
>   endif
>   
>   INCLUDES = -I$(or $(OUTPUT),.) \
> -	   -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
> +	   -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi \
> +	   -I$(srctree)/tools/arch/$(SRCARCH)/include
>   
>   export prefix libdir src obj
>   
> 
> base-commit: db5ca265e3334b48c4e3fa07eef79e8bc578c430

This fixes building of bpf tools, thanks! You can add the following tags...

Reported-by: Andreas Schwab <schwab@suse.de>
Closes: https://lore.kernel.org/all/mvmo74441tr.fsf@suse.de/
Tested-by: Kexy Biscuit <kexybiscuit@aosc.io>
Andrii Nakryiko Nov. 6, 2024, 10:04 p.m. UTC | #7
On Mon, Nov 4, 2024 at 2:26 AM Björn Töpel <bjorn@kernel.org> wrote:
>
> patchwork-bot+netdevbpf@kernel.org writes:
>
> > Hello:
> >
> > This series was applied to bpf/bpf-next.git (master)
> > by Andrii Nakryiko <andrii@kernel.org>:
> >
> > On Fri, 27 Sep 2024 15:13:52 +0200 you wrote:
> >> From: Björn Töpel <bjorn@rivosinc.com>
> >>
> >> libbpf does not include the per-arch tools include path, e.g.
> >> tools/arch/riscv/include. Some architectures depend those files to
> >> build properly.
> >>
> >> Include tools/arch/$(SUBARCH)/include in the libbpf build.
> >>
> >> [...]
> >
> > Here is the summary with links:
> >   - [bpf-next,1/2] libbpf: Add missing per-arch include path
> >     https://git.kernel.org/bpf/bpf-next/c/710fbca820c7
> >   - [bpf-next,2/2] selftests: bpf: Add missing per-arch include path
> >     https://git.kernel.org/bpf/bpf-next/c/19090f0306f1
>
> Andrii, I just noted that this landed into bpf-next, and not bpf
> (fixes).

Hi Bjorn,

Yes, libbpf and selftests fixes are generally applied through
bpf-next, unless the issue is pretty bad and immediate.

I'm sorry, but unfortunately it's too late now to move those patches
as it's now been more than a month since they landed. For the future,
please let us know ASAP if you think patches were misrouted. I think
we are stuck with the need to do a stable backport for these, sorry.

>
> RISC-V libbpf/perf needs this fix in 6.12 to properly build. Would it be
> possible to have it in the bpf tree, and have it land in 6.12-rc7?
>
> Andreas that has a similar fix [1].
>
>
> Björn
>
> [1] https://lore.kernel.org/linux-riscv/mvm5xq44bqh.fsf@suse.de/
Björn Töpel Nov. 7, 2024, 2:32 p.m. UTC | #8
On Wed, 6 Nov 2024 at 23:04, Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
> I'm sorry, but unfortunately it's too late now to move those patches
> as it's now been more than a month since they landed. For the future,
> please let us know ASAP if you think patches were misrouted. I think
> we are stuck with the need to do a stable backport for these, sorry.

Yeah, realize that it's really late. Thanks for getting back, and
noted for the future.

Cheers,
Björn
diff mbox series

Patch

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 1b22f0f37288..857a5f7b413d 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -61,7 +61,8 @@  ifndef VERBOSE
 endif
 
 INCLUDES = -I$(or $(OUTPUT),.) \
-	   -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
+	   -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi \
+	   -I$(srctree)/tools/arch/$(SRCARCH)/include
 
 export prefix libdir src obj