bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Repo for tips / tricks / common code?
@ 2023-07-18 16:15 Barret Rhoden
  2023-07-18 22:17 ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Barret Rhoden @ 2023-07-18 16:15 UTC (permalink / raw)
  To: bpf

Hi -

Is there any interest in a repo or something for reusable BPF code bits? 
  I've got some stuff that I do in my programs that might be useful to 
others, but not to the level of a full bpf helper.

For instance, one technique I've developed is to have list-like data 
structures for *mmappable* data that are e.g. per-cpu and per-task. 
Internally, it's an Array map, and each element is identified by its 
index in the array instead of by point.  And the linked-list is built 
with index integers instead of pointers.

Anyway, that's just an example, and I imagine other people have their 
own techniques.  I've got the code sitting in an open-source repo 
elsewhere, and had a couple people off-list ask me about it.  I could 
email it to the list, but it'd get lost in the noise.

If you're curious about specifics, the linked list code is here [1], and 
I briefly mentioned the data structures in my LPC 22 talk [2].  I've got 
an AVL tree that works with this stuff too.

Thanks,
Barret


[1] https://github.com/google/ghost-userspace/blob/main/lib/queue.bpf.h
[2] 
https://lpc.events/event/16/contributions/1365/attachments/986/1912/lpc22-ebpf-kernel-scheduling-with-ghost.pdf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-19 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 16:15 Repo for tips / tricks / common code? Barret Rhoden
2023-07-18 22:17 ` Alexei Starovoitov
2023-07-19  9:51   ` Donald Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).