From: Marco Vedovati <marco.vedovati@crowdstrike.com>
To: "bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"toke@redhat.com" <toke@redhat.com>
Cc: "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: Clarifications on linux/types.h used with libbpf
Date: Tue, 15 Feb 2022 13:18:01 +0000 [thread overview]
Message-ID: <7cc5e02742da482b9daf06ffe3218262@crowdstrike.com> (raw)
In-Reply-To: <7b2e447f6ae34022a56158fcbf8dc890@crowdstrike.com>
(resending as my first email was sent without ml subscription)
Hi,
I have few questions about the linux/types.h file used to build bpf
applications. This file gets included by both userspace applications using
libbpf and by bpf programs. E.g., in a userspace application:
foo.c
foo.skel.h
bpf/libbpf.h
linux/bpf.h
linux/types.h
Or in a bpf program:
foo.bpf.c
linux/bpf.h
linux/types.h
libbpf provides its own copy of this file in include/linux/types.h.
As I could understand from the Git history, it was initially copied from
linux include/linux/types.h, but it is now maintained separately.
Both linux bpftool and bpf selftests however are built using another
types.h from tools/include/uapi/linux/types.h.
Is there a reason why bpftool and selftests aren't built using the same
types.h distributed by libbpf?
I also see that the license of the three files differs:
- (libbpf) include/linux/types.h is "LGPL-2.1 OR BSD-2-Clause"
- (linux) include/linux/types.h is "GPL-2.0"
- (linux) tools/include/uapi/linux/types.h is "GPL-2.0"
Is there a reason why tools/include/uapi/linux/types.h isn't licensed as
"GPL-2.0 WITH Linux-syscall-note"?
Finally, would it make sense to also have libbpf use
tools/include/uapi/linux/types.h instead of its own copy?
The advantages would be:
- consistency with linux use
- the only architecture specific header included is "asm/bitsperlong.h",
instead of all the ones currently included.
Thanks,
Marco
next prev parent reply other threads:[~2022-02-15 13:47 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 [this message]
2022-02-17 22:08 ` Andrii Nakryiko
2022-02-23 20:18 ` Marco Vedovati
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=7cc5e02742da482b9daf06ffe3218262@crowdstrike.com \
--to=marco.vedovati@crowdstrike.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).