Thread (22 messages) flat view 22 messages, 4 authors, 2020-03-29

Re: [PATCH bpf-next] libbpf: Add bpf_object__rodata getter function

From: Toke Høiland-Jørgensen <hidden>
Date: 2020-03-27 18:39:56
Also in: bpf

Andrii Nakryiko [off-list ref] writes:
quoted
quoted
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];
};
quoted
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help