What map def attributes must match to update an inner map value? #460
Answered
by
teknoraver
Dave Thaler (dthaler)
asked this question in
Q&A
|
bpf_map_update_elem can be used to store an inner map in a map of type BPF_MAP_TYPE_ARRAY_OF_MAPS or BPF_MAP_TYPE_HASH_OF_MAPS. Certainly the inner map's type must match that of the template (e.g., via inner_map_idx on older versions of Linux), but what other attributes also must match? |
Answered by
teknoraver
Sep 9, 2021
Replies: 2 comments 1 reply
|
Matteo Croce (@teknoraver) Quentin Monnet (@qmonnet) Can you help us answer this? |
0 replies
|
Hi all, when inserting a map into a map of maps, the newly inserted map is checked for equality against the first one inserted: bool bpf_map_meta_equal(const struct bpf_map *meta0,
const struct bpf_map *meta1)
{
/* No need to compare ops because it is covered by map_type */
return meta0->map_type == meta1->map_type &&
meta0->key_size == meta1->key_size &&
meta0->value_size == meta1->value_size &&
meta0->map_flags == meta1->map_flags;
}The call chain is: |
1 reply
Answer selected by
dthaler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
when inserting a map into a map of maps, the newly inserted map is checked for equality against the first one inserted:
The call chain is: