Lines Matching +full:key +full:- +full:code
1 .. SPDX-License-Identifier: GPL-2.0-only
9 - ``BPF_MAP_TYPE_CPUMAP`` was introduced in kernel version 4.15
11 .. kernel-doc:: kernel/bpf/cpumap.c
14 An example use-case for this map type is software based Receive Side Scaling (RSS).
16 The CPUMAP represents the CPUs in the system indexed as the map-key, and the
17 map-value is the config setting (per CPUMAP entry). Each CPUMAP entry has a dedicated
32 ----------
35 .. code-block:: c
37 long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
39 Redirect the packet to the endpoint referenced by ``map`` at index ``key``.
42 The lower two bits of ``flags`` are used as the return code if the map lookup
47 ----------
55 .. code-block:: c
57 int bpf_map_update_elem(int fd, const void *key, const void *value, __u64 flags);
63 .. code-block:: c
74 - BPF_ANY: Create a new element or update an existing element.
75 - BPF_NOEXIST: Create a new element only if it did not exist.
76 - BPF_EXIST: Update an existing element.
80 .. code-block:: c
82 int bpf_map_lookup_elem(int fd, const void *key, void *value);
89 .. code-block:: c
91 int bpf_map_delete_elem(int fd, const void *key);
100 ------
102 The following code snippet shows how to declare a ``BPF_MAP_TYPE_CPUMAP`` called
105 .. code-block:: c
109 __type(key, __u32);
116 __type(key, __u32);
123 __type(key, __u32);
131 __u32 key = 0;
136 cpu_iterator = bpf_map_lookup_elem(&cpus_iterator, &key);
157 ----------
159 The following code snippet shows how to dynamically set the max_entries for a
162 .. code-block:: c
169 return -1;
177 - https://developers.redhat.com/blog/2021/05/13/receive-side-scaling-rss-with-ebpf-and-cpumap#redir…