netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Vedovati <marco.vedovati@crowdstrike.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: "bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"toke@redhat.com" <toke@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"kernel-team@fb.com" <kernel-team@fb.com>,
	Martin Kelly <martin.kelly@crowdstrike.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: Clarifications on linux/types.h used with libbpf
Date: Wed, 23 Feb 2022 20:18:09 +0000	[thread overview]
Message-ID: <35873e0695014029a290ceb8cc767a7d@crowdstrike.com> (raw)
In-Reply-To: <CAEf4BzbB6O=PRS7eDAszsVYEjxiTdR6g9XXSS4YDRh8e4Bgo0w@mail.gmail.com>

From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Sent: Thursday, February 17, 2022 11:08 PM
To: Marco Vedovati
Cc: bpf@vger.kernel.org; toke@redhat.com; netdev@vger.kernel.org; kernel-team@fb.com; Martin Kelly; ast@kernel.org; daniel@iogearbox.net; davem@davemloft.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@crowdstrike.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
    

  reply	other threads:[~2022-02-23 20:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 12:57 Clarifications on linux/types.h used with libbpf Marco Vedovati
2022-02-15 13:18 ` Marco Vedovati
2022-02-17 22:08 ` Andrii Nakryiko
2022-02-23 20:18   ` Marco Vedovati [this message]
2022-02-23 21:58     ` Andrii Nakryiko

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=35873e0695014029a290ceb8cc767a7d@crowdstrike.com \
    --to=marco.vedovati@crowdstrike.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=martin.kelly@crowdstrike.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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;
as well as URLs for NNTP newsgroup(s).