Lines Matching +full:ease +full:- +full:of +full:- +full:use

1 .. SPDX-License-Identifier: GPL-2.0-only
9 - ``BPF_MAP_TYPE_ARRAY`` was introduced in kernel version 3.19
10 - ``BPF_MAP_TYPE_PERCPU_ARRAY`` was introduced in version 4.6
13 storage. The key type is an unsigned 32-bit integer (4 bytes) and the map is
14 of constant size. The size of the array is defined in ``max_entries`` at
15 creation time. All array elements are pre-allocated and zero initialized when
18 stored can be of any size, however, all array elements are aligned to 8
22 setting the flag ``BPF_F_MMAPABLE``. The map definition is page-aligned and
23 starts on the first page. Sufficient page-sized and page-aligned blocks of
25 which in some cases will result in over-allocation of memory. The benefit of
26 using this is increased performance and ease of use since userspace programs
27 would not be required to use helper functions to access and mutate data.
33 ----------
38 .. code-block:: c
44 with userspace reading the value, the user must use primitives like
45 ``__sync_fetch_and_add()`` when updating the value in-place.
50 .. code-block:: c
56 ``bpf_map_update_elem()`` returns 0 on success, or negative error in case of
59 Since the array is of constant size, ``bpf_map_delete_elem()`` is not supported.
60 To clear an array element, you may use ``bpf_map_update_elem()`` to insert a
64 -------------
67 across different CPUs. To restrict storage to a single CPU, you may use a
77 .. code-block:: c
86 -----------
92 ---------
104 ----------
108 .. code-block:: c
120 .. code-block:: c
134 __sync_fetch_and_add(value, skb->len);
140 ---------
148 .. code-block:: c
167 This snippet shows how to initialize the elements of an array.
169 .. code-block:: c
189 .. code-block:: c
201 /* use value here */
210 This snippet shows how to initialize the elements of a per CPU array.
212 .. code-block:: c
232 This snippet shows how to access the per CPU elements of an array value.
234 .. code-block:: c
248 /* Use per CPU value here */