Skip to content

How to "best" communicate cpumasks from an iterator eBPF prog to user space? #1782

Answered by ti-mo
thediveo asked this question in Q&A
Discussion options

You must be logged in to vote

In my cases I will need to send other data also alongside the cpu mask as per iterator iteration, so I would like to do this in a single bpf_seq_write, not least due to error handling in case bpf_seq_write returns an error and I would need to retry the same iteration later.

I haven't used bpf_seq_write in anger, but my understanding is it works just like perf and ringbuf maps, so from my point of view, the same concepts apply. Push data from bpf to user space in whatever format you like. In practice, this often means you either send fixed-length messages using a shared struct definition between Go/C to keep the decoding operation simple. Or, you devise your own little TLV-based protocol,…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thediveo
Comment options

Answer selected by thediveo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants