iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

BPF_TABLE_SHARED do not support edit flags for the BPF_TABLE_T behind it #5044

Open evilsp opened 3 months ago

evilsp commented 3 months ago

If possible, could I ask why BPF_TABLE_SHARED doesn't support custom table flags? Are there any design considerations behind this?

yonghong-song commented 3 months ago

What is your use case? If it is indeed necessary in your case, you can extend BPF_TABLE_SHARED with additional parameters similar to BPF_TABLE_PINNED.

evilsp commented 3 months ago

I encountered this issue when trying to add an lpm_trie bpf shared table. Although I have implemented this function in a similar way as you described, my question is, since implementing this function is not difficult, why not add a specialized macro instead of having a fixed flag?

yonghong-song commented 3 months ago

I would like to reuse the same macro name instead of adding a new macro. This has been the convention for bcc for a while.

evilsp commented 3 months ago

As you mentioned, since there is a preference for using repetitive Macros, why not provide the flag as a parameter in the BPF_TABLE_SHARED macro? This is one of the points I'm curious about as well.

yonghong-song commented 3 months ago

could you submit a pull request for that?

evilsp commented 3 months ago

Have submitted:https://github.com/iovisor/bcc/pull/5053