From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@fb.com>, bpf <bpf@vger.kernel.org>,
Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH bpf-next] libbpf: Add bpf_object__rodata getter function
Date: Fri, 27 Mar 2020 19:39:44 +0100 [thread overview]
Message-ID: <875zepmykv.fsf@toke.dk> (raw)
In-Reply-To: <CAEf4BzbRpJsoXb3Bvx0_jKGj4gLk-dhXRqryfO23qMreG2B+Kg@mail.gmail.com>
Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:
>> > But basically, why can't you use BPF skeleton?
>>
>> Couple of reasons:
>>
>> - I don't need any of the other features of the skeleton
>> - I don't want to depend on bpftool in the build process
>> - I don't want to embed the BPF bytecode into the C object
>
> Just curious, how are you intending to use global variables. Are you
> restricting to a single global var (a struct probably), so it's easier
> to work with it? Or are you resolving all the variables' offsets
> manually? It's really inconvenient to work with global variables
> without skeleton, which is why I'm curious.
Yeah, there's a single:
static volatile const struct xdp_dispatcher_config conf = {};
in the BPF file. Which is defined as:
struct xdp_dispatcher_config {
__u8 num_progs_enabled;
__u32 chain_call_actions[MAX_DISPATCHER_ACTIONS];
};
>> > Also, application can already find that map by looking at name.
>>
>> Yes, it can find the map, but it can't access the data. But I guess I
>> could just add a getter for that. Just figured this was easier to
>> consume; but I can see why it might impose restrictions on future
>> changes, so I'll send a v2 with such a map-level getter instead.
>
> Sounds good, I'll go review v2 now.
Great, thanks!
-Toke
next prev parent reply other threads:[~2020-03-27 18:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 15:17 [PATCH bpf-next] libbpf: Add bpf_object__rodata getter function Toke Høiland-Jørgensen
2020-03-26 19:20 ` Andrii Nakryiko
2020-03-27 12:24 ` Toke Høiland-Jørgensen
2020-03-27 17:49 ` Andrii Nakryiko
2020-03-27 18:39 ` Toke Høiland-Jørgensen [this message]
2020-03-27 12:58 ` [PATCH bpf-next v2] libbpf: Add getter for pointer to data area for internal maps Toke Høiland-Jørgensen
2020-03-27 19:17 ` Andrii Nakryiko
2020-03-27 22:26 ` Toke Høiland-Jørgensen
2020-03-27 22:28 ` Alexei Starovoitov
2020-03-28 0:08 ` Toke Høiland-Jørgensen
2020-03-28 18:28 ` [PATCH v3 1/2] libbpf: Add setter for initial value " Toke Høiland-Jørgensen
2020-03-28 20:01 ` Andrii Nakryiko
2020-03-29 12:17 ` Toke Høiland-Jørgensen
2020-03-29 13:22 ` [PATCH v4 " Toke Høiland-Jørgensen
2020-03-29 20:06 ` Andrii Nakryiko
2020-03-29 23:46 ` Daniel Borkmann
2020-03-29 13:22 ` [PATCH v4 2/2] selftests: Add test for overriding global data value before load Toke Høiland-Jørgensen
2020-03-29 20:13 ` Andrii Nakryiko
2020-03-28 18:28 ` [PATCH v3 " Toke Høiland-Jørgensen
2020-03-28 20:06 ` Andrii Nakryiko
2020-03-29 13:10 ` Toke Høiland-Jørgensen
2020-03-29 20:08 ` 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=875zepmykv.fsf@toke.dk \
--to=toke@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--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.