Add docs about BPF_HASH_OF_MAPS
authormasi19bw <masi19bw@gmail.com>
Tue, 22 Jun 2021 09:07:49 +0000 (09:07 +0000)
committeryonghong-song <ys114321@gmail.com>
Tue, 22 Jun 2021 15:44:41 +0000 (08:44 -0700)
docs/reference_guide.md

index 0c7ccfebf3440895fba2ad1e4ce4a7488d5b98cd..f280be5328aa7e4d617002171ea3f2e3866e4b16 100644 (file)
@@ -1165,7 +1165,7 @@ BPF_ARRAY_OF_MAPS(maps_array, "ex1", 10);
 
 ### 15. BPF_HASH_OF_MAPS
 
-Syntax: ```BPF_HASH_OF_MAPS(name, inner_map_name, size)```
+Syntax: ```BPF_HASH_OF_MAPS(name, key_type, inner_map_name, size)```
 
 This creates a hash map with a map-in-map type (BPF_MAP_TYPE_HASH_OF_MAPS) map named ```name``` with ```size``` entries. The inner map meta data is provided by map ```inner_map_name``` and can be most of array or hash maps except ```BPF_MAP_TYPE_PROG_ARRAY```, ```BPF_MAP_TYPE_CGROUP_STORAGE``` and ```BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE```.
 
@@ -1173,7 +1173,7 @@ For example:
 ```C
 BPF_ARRAY(ex1, int, 1024);
 BPF_ARRAY(ex2, int, 1024);
-BPF_HASH_OF_MAPS(maps_hash, "ex1", 10);
+BPF_HASH_OF_MAPS(maps_hash, struct custom_key, "ex1", 10);
 ```
 
 ### 16. BPF_STACK