forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/bpf: Include BPF map names during map creation
This commit passes the name of the map to the bpf() syscall on map creation. This allows bpftool via `bpftool map show` to show the map names along side the maps. There's a special case for kernel below 4.15, as they don't support map names for BPF_MAP_CREATE command. This commit handles both cases (map name field present and not) by doing a version check once upon CreateMap(). Before: ``` 8623: lpm_trie flags 0x1 key 24B value 12B max_entries 512000 memlock 20480000B ``` After: ``` 8417: lpm_trie name cilium_ipcache flags 0x1 key 24B value 12B max_entries 512000 memlock 20480000B ``` Signed-off-by: Chris Tarazi <chris@isovalent.com>
- Loading branch information
1 parent
56375af
commit a6c227a
Showing
1 changed file
with
90 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters