bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Is there a reason for no BPF_LRU_HASH macro?

Open pjsg opened this issue 6 years ago • 3 comments

There seem to be map type specific macros for most(?) of the other map types BPF_HASH, BPF_ARRAY, BPF_LPM_TRIE etc. But not for BPF_LRU_HASH. Is there a reason, or would you like a PR?

pjsg avatar Sep 20 '19 01:09 pjsg

Your PR is welcome. The only reason is BPF_LRU_HASH is less used and people have not submitted PR yet.

yonghong-song avatar Sep 20 '19 04:09 yonghong-song

Does BPF_LRU_HASH will support in the feature?

yzx-fish avatar Jun 12 '24 09:06 yzx-fish

BPF_HASH and the others are higher level wrappers that use BPF_TABLE. You can declare a BPF_LRU_HASH using:

BPF_TABLE("lru_hash", key_type, value_type, map_name, hash_size);

BPF_TABLE is documented in bcc's reference guide.

harjoc avatar Jun 14 '24 12:06 harjoc