@@ -1232,9 +1232,9 @@ pointer type. The types of pointers describe their base, as follows:
1232
1232
Pointer to the value stored in a map element.
1233
1233
PTR_TO_MAP_VALUE_OR_NULL
1234
1234
Either a pointer to a map value, or NULL; map accesses
1235
- (see section 'eBPF maps', below ) return this type,
1236
- which becomes a PTR_TO_MAP_VALUE when checked != NULL.
1237
- Arithmetic on these pointers is forbidden.
1235
+ (see maps.rst ) return this type, which becomes a
1236
+ a PTR_TO_MAP_VALUE when checked != NULL. Arithmetic on
1237
+ these pointers is forbidden.
1238
1238
PTR_TO_STACK
1239
1239
Frame pointer.
1240
1240
PTR_TO_PACKET
@@ -1402,47 +1402,6 @@ using normal C code as::
1402
1402
which makes such programs easier to write comparing to LD_ABS insn
1403
1403
and significantly faster.
1404
1404
1405
- eBPF maps
1406
- ---------
1407
- 'maps' is a generic storage of different types for sharing data between kernel
1408
- and userspace.
1409
-
1410
- The maps are accessed from user space via BPF syscall, which has commands:
1411
-
1412
- - create a map with given type and attributes
1413
- ``map_fd = bpf(BPF_MAP_CREATE, union bpf_attr *attr, u32 size) ``
1414
- using attr->map_type, attr->key_size, attr->value_size, attr->max_entries
1415
- returns process-local file descriptor or negative error
1416
-
1417
- - lookup key in a given map
1418
- ``err = bpf(BPF_MAP_LOOKUP_ELEM, union bpf_attr *attr, u32 size) ``
1419
- using attr->map_fd, attr->key, attr->value
1420
- returns zero and stores found elem into value or negative error
1421
-
1422
- - create or update key/value pair in a given map
1423
- ``err = bpf(BPF_MAP_UPDATE_ELEM, union bpf_attr *attr, u32 size) ``
1424
- using attr->map_fd, attr->key, attr->value
1425
- returns zero or negative error
1426
-
1427
- - find and delete element by key in a given map
1428
- ``err = bpf(BPF_MAP_DELETE_ELEM, union bpf_attr *attr, u32 size) ``
1429
- using attr->map_fd, attr->key
1430
-
1431
- - to delete map: close(fd)
1432
- Exiting process will delete maps automatically
1433
-
1434
- userspace programs use this syscall to create/access maps that eBPF programs
1435
- are concurrently updating.
1436
-
1437
- maps can have different types: hash, array, bloom filter, radix-tree, etc.
1438
-
1439
- The map is defined by:
1440
-
1441
- - type
1442
- - max number of elements
1443
- - key size in bytes
1444
- - value size in bytes
1445
-
1446
1405
Pruning
1447
1406
-------
1448
1407
The verifier does not actually walk all possible paths through the program. For
0 commit comments