Add support for unseeded integer hashing in hash-table #3801
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces changes to the eBPF runtime to add support for unseeded integer hashing in hash tables. The most important changes include adding new hash functions for integer keys, updating the hash table creation options, and modifying the hash table's bucket index computation to use the new hash functions.
Enhancements to Hash Table Functionality:
libs/runtime/ebpf_hash_table.c
: Added new functions_ebpf_integer_hash_function_32bit
and_ebpf_integer_hash_function_64bit
for hashing 32-bit and 64-bit integer keys, respectively. Updated_ebpf_hash_table_compute_bucket_index
to use these functions whenuse_integer_hashing
is enabled. [1] [2]libs/runtime/ebpf_hash_table.c
: Added a new fielduse_integer_hashing
to thestruct _ebpf_hash_table
to indicate whether integer hashing should be used.libs/runtime/ebpf_hash_table.c
: Modifiedebpf_hash_table_create
to initialize theuse_integer_hashing
field based on the creation options.Updates to Hash Table Creation Options:
libs/runtime/ebpf_hash_table.h
: Added a new fielduse_unseeded_integer_hashing
toebpf_hash_table_creation_options_t
to specify whether unseeded integer hashing should be used for the hash table.Application of New Hashing Option:
libs/runtime/ebpf_async.c
: Enableduse_unseeded_integer_hashing
in theebpf_async_initiate
function.libs/runtime/ebpf_object.c
: Enableduse_unseeded_integer_hashing
in theebpf_object_tracking_initiate
function.libs/runtime/ebpf_state.c
: Enableduse_unseeded_integer_hashing
in theebpf_state_initiate
function.Testing
CI/CD
Documentation
No.
Installation
No.