Lines Matching +full:cpu +full:- +full:map
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
12 :doc: cpu map
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
18 kernel thread bound to the given CPU to represent the remote CPU execution unit.
21 on the remote CPU. This allows an XDP program to split its processing across
22 multiple CPUs. For example, a scenario where the initial CPU (that sees/receives
23 the packets) needs to do minimal packet processing and the remote CPU (to which
25 initial CPU is where the XDP redirect program is executed. The remote CPU
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``.
40 For ``BPF_MAP_TYPE_CPUMAP`` this map contains references to CPUs.
42 The lower two bits of ``flags`` are used as the return code if the map lookup
47 ----------
55 .. code-block:: c
59 CPU entries can be added or updated using the ``bpf_map_update_elem()``
63 .. code-block:: c
66 __u32 qsize; /* queue size to remote target CPU */
68 int fd; /* prog fd on map write */
69 __u32 id; /* prog id on map read */
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
84 CPU entries can be retrieved using the ``bpf_map_lookup_elem()``
89 .. code-block:: c
93 CPU entries can be deleted using the ``bpf_map_delete_elem()``
100 ------
103 ``cpu_map`` and how to redirect packets to a remote CPU using a round robin scheme.
105 .. code-block:: c
157 ----------
162 .. code-block:: c
167 fprintf(stderr, "Failed to set max entries for cpu_map map: %s",
169 return -1;
177 - https://developers.redhat.com/blog/2021/05/13/receive-side-scaling-rss-with-ebpf-and-cpumap#redir…