[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <35873e0695014029a290ceb8cc767a7d@crowdstrike.com>
Date: Wed, 23 Feb 2022 20:18:09 +0000
From: Marco Vedovati <marco.vedovati@...wdstrike.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
CC: "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"toke@...hat.com" <toke@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"kernel-team@...com" <kernel-team@...com>,
Martin Kelly <martin.kelly@...wdstrike.com>,
"ast@...nel.org" <ast@...nel.org>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"davem@...emloft.net" <davem@...emloft.net>,
Andrii Nakryiko <andrii@...nel.org>
Subject: Re: Clarifications on linux/types.h used with libbpf
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
Sent: Thursday, February 17, 2022 11:08 PM
To: Marco Vedovati
Cc: bpf@...r.kernel.org; toke@...hat.com; netdev@...r.kernel.org; kernel-team@...com; Martin Kelly; ast@...nel.org; daniel@...earbox.net; davem@...emloft.net; Andrii Nakryiko
Subject: [External] Re: Clarifications on linux/types.h used with libbpf
> On Tue, Feb 15, 2022 at 4:58 AM Marco Vedovati
> <marco.vedovati@...wdstrike.com> wrote:
> >
> > Hi,
> >
> > I have few questions about the linux/types.h file used to build bpf
> [cut]
>
>
> include/uapi/linux/types.h (UAPI header) is different from
> include/linux/types.h (kernel-internal header). Libbpf has to
> reimplement minimum amount of declarations from kernel-internal
> include/linux/types.h to build outside of the kernel. But short answer
> is they are different headers, so I suspect that no, libbpf can't use
> just UAPI version.
Thank you for clarifying some of my confusions.
So if I understood correctly, the only use of libbpf:include/linux/types.h
is to allow building the library out of the kernel tree.
An ambiguity I have found is about what version of linux/types.h to use
use when building bpf source code (that includes <linux/bpf.h>).
I saw 2 options:
- do like libbpf-bootstrap C examples, that uses whatever linux/types.h
version available on the building host. This is however adding more
dependencies that are satisfied with extra "-idirafter" compiler options.
- do like bpftool's makefile, that builds bpf source code by including
tools/include/uapi/. This does not require the "-idirafter" trick.
Anyway, checking the history of "tools/include/uapi/linux/types.h", I
believe that this file is mistakenly licensed as "GPL-2.0" instead of
"GPL-2.0 WITH Linux-syscall-note". I may come up with a patch to fix it.
>
> Thanks,
> Marco
Powered by blists - more mailing lists