All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
	David Ahern <dsa@cumulusnetworks.com>,
	netdev@vger.kernel.org, stephen@networkplumber.org
Subject: Re: [iproute2 net-next 3/8] bpf: Add BPF_ macros
Date: Mon, 12 Dec 2016 12:48:52 +0100	[thread overview]
Message-ID: <584E8EA4.4030200@iogearbox.net> (raw)
In-Reply-To: <88e7eece-be2a-3b11-3dc1-3afa7a9bb14a@stressinduktion.org>

On 12/12/2016 12:28 PM, Hannes Frederic Sowa wrote:
> On 12.12.2016 01:53, David Ahern wrote:
>> Based on version in kernel repo, samples/bpf/libbpf.h
>>
>> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
>> ---
>>   include/bpf_util.h | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 179 insertions(+)
>>
>> diff --git a/include/bpf_util.h b/include/bpf_util.h
>> index 726e34777755..5361dab1933d 100644
>
> Maybe this was already discussed: why are those not part of uapi? They
> get used in the bpf manpage.

The reason why these macros haven't been exposed to uapi header was because
they are not strict part of kernel abi. So really only the very minimum that
had to go there (such as insn opcodes) were placed into the header. That way,
kernel is still free to, for example, change or rename the macros once new
insns would get added, and user space can just define what it really needs.
That way, both don't get into each others way long term. Often it's also not
really needed if you have an elf loader, f.e. iproute2 could live without
them (up to this point).

Just took a look at the man page example, we don't even define BPF_CALL_FUNC()
in the kernel, so it's also not exactly the same. Probably makes sense to
fix/complete that example and in general add a description there wrt opcodes.
Last time I spoke with Michael, he planned to make a bigger revision to the
man page to improve documentation.

Thanks,
Daniel

  reply	other threads:[~2016-12-12 11:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12  0:53 [iproute2 v3 net-next 0/8] Add support for vrf helper David Ahern
2016-12-12  0:53 ` [iproute2 net-next 1/8] lib bpf: Add support for BPF_PROG_ATTACH and BPF_PROG_DETACH David Ahern
2016-12-12  9:14   ` Daniel Borkmann
2016-12-12  0:53 ` [iproute2 net-next 2/8] bpf: export bpf_prog_load David Ahern
2016-12-12  9:14   ` Daniel Borkmann
2016-12-12  0:53 ` [iproute2 net-next 3/8] bpf: Add BPF_ macros David Ahern
2016-12-12  9:15   ` Daniel Borkmann
2016-12-12 11:28   ` Hannes Frederic Sowa
2016-12-12 11:48     ` Daniel Borkmann [this message]
2016-12-12  0:53 ` [iproute2 net-next 4/8] move cmd_exec to lib utils David Ahern
2016-12-12  0:53 ` [iproute2 net-next 5/8] Add filesystem APIs to lib David Ahern
2016-12-12  0:53 ` [iproute2 net-next 6/8] change name_is_vrf to return index David Ahern
2016-12-12  0:53 ` [iproute2 net-next 7/8] libnetlink: Add variant of rtnl_talk that does not display RTNETLINK answers error David Ahern
2016-12-12  0:53 ` [iproute2 net-next 8/8] Introduce ip vrf command David Ahern
2016-12-13 18:44 ` [iproute2 v3 net-next 0/8] Add support for vrf helper Stephen Hemminger

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=584E8EA4.4030200@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.