In order to take hover and bcc out of the picture I implemented a code
based on the examples in [1].
I changed the prototype of the bpf_map_update_elem function [2] to
'const void *' but results are still the same, the loop unrolling is not
performed by the compiler.
I used a kernel version 4.5 and both, clang v3.8 and master.
Am I missing something?
Should I also change the prototype in the kernel functions and recompile it?
Thanks,
[1] https://github.com/torvalds/linux/tree/master/samples/bpf
[2]
https://github.com/torvalds/linux/blob/master/samples/bpf/bpf_helpers.h#L13
On 12/13/2016 09:23 PM, Alexei Starovoitov wrote:
when you change the prototype to 'const void *' does it help compiler
to unroll it?
On Tue, Dec 13, 2016 at 12:06 PM, Mauricio Vasquez via iovisor-dev
<[email protected]> wrote:
Hello,
We are having some doubts about the use of the const qualifier for the key
argument in functions to access eBPF maps, both, from user space and within
eBPF programs.
According to our understanding the key is not modified when used to access
the maps, however we noticed that in the bpf_*_elem functions [1] and in
the array_map_*_elem functions [2] the const qualifier is not used. Is there
any particular reason for avoid using it?
An additional question: how is the prototype of the map.lookup function
provided by bcc generated?
We are asking it because we think that the lack of the const qualifier is
causing some problems in the loop unrolling procedure [3].
Thank you very much,
Mauricio
[1]
https://github.com/torvalds/linux/blob/master/samples/bpf/libbpf.h#L9-L11
[2] https://github.com/torvalds/linux/blob/master/kernel/bpf/arraymap.c#L110
[3]
https://lists.iovisor.org/pipermail/iovisor-dev/2016-December/000539.html
_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev
_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev