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

Reply via email to