Lines Matching defs:map
73 * @brief **libbpf_bpf_map_type_str()** converts the provided map type value
75 * @param t The map type.
76 * @return Pointer to a static string identifying the map type. NULL is
122 /* parse map definitions non-strictly, allowing extra attributes/data */
239 * @brief **bpf_object__pin_maps()** pins each map contained within
245 * If `path` is NULL `bpf_map__pin` (which is being used on each map)
246 * will use the pin_path attribute of each map. In this case, maps that
252 * @brief **bpf_object__unpin_maps()** unpins each map contained within
258 * If `path` is NULL `bpf_map__unpin` (which is being used on each map)
259 * will use the pin_path attribute of each map. In this case, maps that
805 LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(const struct bpf_map *map);
806 LIBBPF_API int bpf_link__update_map(struct bpf_link *link, const struct bpf_map *map);
825 * @param type program type to set the BPF map to have
843 * @param type attach type to set the BPF map to have
874 * @param type attach type to set the BPF map to have
882 * @brief **bpf_object__find_map_by_name()** returns BPF map of
885 * @param name name of the BPF map
886 * @return BPF map instance, if such map exists within the BPF object;
896 bpf_object__next_map(const struct bpf_object *obj, const struct bpf_map *map);
905 bpf_object__prev_map(const struct bpf_object *obj, const struct bpf_map *map);
909 * BPF map during BPF object load phase.
910 * @param map the BPF map instance
911 * @param autocreate whether to create BPF map during BPF object load
915 * BPF map. By default, libbpf will attempt to create every single BPF map
917 * and fill in map FD in BPF instructions.
919 * This API allows to opt-out of this process for specific map instance. This
920 * can be useful if host kernel doesn't support such BPF map type or used
922 * a map in the first place. User is still responsible to make sure that their
923 * BPF-side code that expects to use such missing BPF map is recognized by BPF
926 LIBBPF_API int bpf_map__set_autocreate(struct bpf_map *map, bool autocreate);
927 LIBBPF_API bool bpf_map__autocreate(const struct bpf_map *map);
931 * BPF map
932 * @param map the BPF map instance
935 LIBBPF_API int bpf_map__fd(const struct bpf_map *map);
936 LIBBPF_API int bpf_map__reuse_fd(struct bpf_map *map, int fd);
937 /* get map name */
938 LIBBPF_API const char *bpf_map__name(const struct bpf_map *map);
939 /* get/set map type */
940 LIBBPF_API enum bpf_map_type bpf_map__type(const struct bpf_map *map);
941 LIBBPF_API int bpf_map__set_type(struct bpf_map *map, enum bpf_map_type type);
942 /* get/set map size (max_entries) */
943 LIBBPF_API __u32 bpf_map__max_entries(const struct bpf_map *map);
944 LIBBPF_API int bpf_map__set_max_entries(struct bpf_map *map, __u32 max_entries);
945 /* get/set map flags */
946 LIBBPF_API __u32 bpf_map__map_flags(const struct bpf_map *map);
947 LIBBPF_API int bpf_map__set_map_flags(struct bpf_map *map, __u32 flags);
948 /* get/set map NUMA node */
949 LIBBPF_API __u32 bpf_map__numa_node(const struct bpf_map *map);
950 LIBBPF_API int bpf_map__set_numa_node(struct bpf_map *map, __u32 numa_node);
951 /* get/set map key size */
952 LIBBPF_API __u32 bpf_map__key_size(const struct bpf_map *map);
953 LIBBPF_API int bpf_map__set_key_size(struct bpf_map *map, __u32 size);
954 /* get map value size */
955 LIBBPF_API __u32 bpf_map__value_size(const struct bpf_map *map);
957 * @brief **bpf_map__set_value_size()** sets map value size.
958 * @param map the BPF map instance
963 * on such a map, the mapped region is resized. Afterward, an attempt is made to
965 * succeed if the last variable of the data section map is an array. The array
970 LIBBPF_API int bpf_map__set_value_size(struct bpf_map *map, __u32 size);
971 /* get map key/value BTF type IDs */
972 LIBBPF_API __u32 bpf_map__btf_key_type_id(const struct bpf_map *map);
973 LIBBPF_API __u32 bpf_map__btf_value_type_id(const struct bpf_map *map);
974 /* get/set map if_index */
975 LIBBPF_API __u32 bpf_map__ifindex(const struct bpf_map *map);
976 LIBBPF_API int bpf_map__set_ifindex(struct bpf_map *map, __u32 ifindex);
977 /* get/set map map_extra flags */
978 LIBBPF_API __u64 bpf_map__map_extra(const struct bpf_map *map);
979 LIBBPF_API int bpf_map__set_map_extra(struct bpf_map *map, __u64 map_extra);
981 LIBBPF_API int bpf_map__set_initial_value(struct bpf_map *map,
983 LIBBPF_API void *bpf_map__initial_value(struct bpf_map *map, size_t *psize);
987 * passed map is a special map created by libbpf automatically for things like
989 * @param map the bpf_map
990 * @return true, if the map is an internal map; false, otherwise
992 LIBBPF_API bool bpf_map__is_internal(const struct bpf_map *map);
996 * BPF map should be pinned. This does not actually create the 'pin'.
997 * @param map The bpf_map
1001 LIBBPF_API int bpf_map__set_pin_path(struct bpf_map *map, const char *path);
1005 * BPF map should be pinned.
1006 * @param map The bpf_map
1009 LIBBPF_API const char *bpf_map__pin_path(const struct bpf_map *map);
1013 * passed map has been pinned via a 'pin' file.
1014 * @param map The bpf_map
1015 * @return true, if the map is pinned; false, otherwise
1017 LIBBPF_API bool bpf_map__is_pinned(const struct bpf_map *map);
1021 * for the BPF map. This increments the reference count on the
1022 * BPF map which will keep the BPF map loaded even after the
1024 * @param map The bpf_map to pin
1029 * also NULL, an error will be returned and the map will not be pinned.
1031 LIBBPF_API int bpf_map__pin(struct bpf_map *map, const char *path);
1035 * 'pin' for the BPF map.
1036 * @param map The bpf_map to unpin
1041 * map attribute is unpinned. If both the `path` parameter and
1042 * `pin_path` map attribute are set, they must be equal.
1044 LIBBPF_API int bpf_map__unpin(struct bpf_map *map, const char *path);
1046 LIBBPF_API int bpf_map__set_inner_map_fd(struct bpf_map *map, int fd);
1047 LIBBPF_API struct bpf_map *bpf_map__inner_map(struct bpf_map *map);
1050 * @brief **bpf_map__lookup_elem()** allows to lookup BPF map value
1052 * @param map BPF map to lookup element in
1054 * @param key_sz size in bytes of key data, needs to match BPF map definition's **key_size**
1056 * @param value_sz size in byte of value data memory; it has to match BPF map
1058 * a product of BPF map value size and number of possible CPUs in the system
1069 LIBBPF_API int bpf_map__lookup_elem(const struct bpf_map *map,
1075 * map that corresponds to provided key.
1076 * @param map BPF map to insert to or update element in
1078 * @param key_sz size in bytes of key data, needs to match BPF map definition's **key_size**
1080 * @param value_sz size in byte of value data memory; it has to match BPF map
1082 * a product of BPF map value size and number of possible CPUs in the system
1093 LIBBPF_API int bpf_map__update_elem(const struct bpf_map *map,
1098 * @brief **bpf_map__delete_elem()** allows to delete element in BPF map that
1100 * @param map BPF map to delete element from
1102 * @param key_sz size in bytes of key data, needs to match BPF map definition's **key_size**
1109 LIBBPF_API int bpf_map__delete_elem(const struct bpf_map *map,
1113 * @brief **bpf_map__lookup_and_delete_elem()** allows to lookup BPF map value
1115 * @param map BPF map to lookup element in
1117 * @param key_sz size in bytes of key data, needs to match BPF map definition's **key_size**
1119 * @param value_sz size in byte of value data memory; it has to match BPF map
1121 * a product of BPF map value size and number of possible CPUs in the system
1132 LIBBPF_API int bpf_map__lookup_and_delete_elem(const struct bpf_map *map,
1137 * @brief **bpf_map__get_next_key()** allows to iterate BPF map keys by
1139 * @param map BPF map to fetch next key from
1143 * @param key_sz size in bytes of key data, needs to match BPF map definition's **key_size**
1144 * @return 0, on success; -ENOENT if **cur_key** is the last key in BPF map;
1150 LIBBPF_API int bpf_map__get_next_key(const struct bpf_map *map,
1262 * @param map_fd A file descriptor to a BPF_MAP_TYPE_USER_RINGBUF map.
1381 * BPF_PERF_EVENT_ARRAY map
1382 * @param map_fd FD of BPF_PERF_EVENT_ARRAY BPF map that will be used by BPF
1413 * max_entries of given PERF_EVENT_ARRAY map)
1418 /* if cpu_cnt > 0, map_keys specify map keys to set per-CPU FDs for */
1492 * @param map_type BPF map type to detect kernel support for
1494 * @return 1, if given map type is supported; 0, if given map type is
1536 struct bpf_map **map;
1574 struct bpf_map **map;