From: Daniel Borkmann <daniel@iogearbox.net>
To: Craig Gallek <kraigatgoog@gmail.com>
Cc: Alexei Starovoitov <ast@fb.com>,
"David S . Miller" <davem@davemloft.net>,
Chonggang Li <chonggangli@google.com>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] libbpf: use map_flags when creating maps
Date: Thu, 28 Sep 2017 23:44:58 +0200 [thread overview]
Message-ID: <59CD6D5A.8080201@iogearbox.net> (raw)
In-Reply-To: <CAEfhGiwai3fZsWPx--Axyc1n4+WRwxeFO+uLgQKbQ-8wiJqtAw@mail.gmail.com>
On 09/28/2017 07:33 PM, Craig Gallek wrote:
> On Wed, Sep 27, 2017 at 6:03 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>> On 09/27/2017 06:29 PM, Alexei Starovoitov wrote:
>>> On 9/27/17 7:04 AM, Craig Gallek wrote:
>>>> From: Craig Gallek <kraig@google.com>
[...]
>>>
>>> yes it will break loading of pre-compiled .o
>>> Instead of breaking, let's fix the loader to do it the way
>>> samples/bpf/bpf_load.c does.
>>> See commit 156450d9d964 ("samples/bpf: make bpf_load.c code compatible
>>> with ELF maps section changes")
>>
>> +1, iproute2 loader also does map spec fixup
>>
>> For libbpf it would be good also such that it reduces the diff
>> further between the libbpf and bpf_load so that it allows move
>> to libbpf for samples in future.
>
> Fair enough, I'll try to get this to work more dynamically. I did
> noticed that the fields of struct bpf_map_def in
> selftests/.../bpf_helpers.h and iproute2's struct bpf_elf_map have
> diverged. The flags field is the only thing missing from libbpf right
> now (and they are at the same offset for both), so it won't be an
> issue for this change, but it is going to make unifying all of these
> things under libbpf not trivial at some point...
Yes, iproute2 uses its own loader with own specifics related to
iproute2. With the above I rather meant that we can reduce the
gap between libbpf and bpf_load from the BPF samples, so that
it would allow us to migrate samples over entirely, there was
unfortunately never a follow-up on 156450d9d964 though, but given
there is need to extend libbpf (I guess mostly due to lpm map
handling ;)), we need to do a similar thing there as well to not
break existing obj files.
prev parent reply other threads:[~2017-09-28 21:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 14:04 [PATCH net-next] libbpf: use map_flags when creating maps Craig Gallek
2017-09-27 16:29 ` Alexei Starovoitov
2017-09-27 22:03 ` Daniel Borkmann
2017-09-28 17:33 ` Craig Gallek
2017-09-28 21:44 ` Daniel Borkmann [this message]
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=59CD6D5A.8080201@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=ast@fb.com \
--cc=chonggangli@google.com \
--cc=davem@davemloft.net \
--cc=kraigatgoog@gmail.com \
--cc=netdev@vger.kernel.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.