bpf, docs: document BPF_MAP_TYPE_HASH and variants
authorDonald Hunter <donald.hunter@gmail.com>
Mon, 18 Jul 2022 12:58:47 +0000 (13:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 19 Jul 2022 17:38:03 +0000 (10:38 -0700)
commit979855d3026401ed6eecfd1935d19fd7b74df479
treec1ab2356e427112e4700d4ac9ec5b2448e383867
parente134601961fef4516df9413b270fb96ef6d034bc
bpf, docs: document BPF_MAP_TYPE_HASH and variants

Add documentation for BPF_MAP_TYPE_HASH including kernel version
introduced, usage and examples. Document BPF_MAP_TYPE_PERCPU_HASH,
BPF_MAP_TYPE_LRU_HASH and BPF_MAP_TYPE_LRU_PERCPU_HASH variations.

Note that this file is included in the BPF documentation by the glob in
Documentation/bpf/maps.rst

v3:
Fix typos reported by Stanislav Fomichev and Yonghong Song.
Add note about iteration and deletion as requested by Yonghong Song.

v2:
Describe memory allocation semantics as suggested by Stanislav Fomichev.
Fix u64 typo reported by Stanislav Fomichev.
Cut down usage examples to only show usage in context.
Updated patch description to follow style recommendation, reported by
Bagas Sanjaya.

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220718125847.1390-1-donald.hunter@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Documentation/bpf/map_hash.rst [new file with mode: 0644]