libbpf: Add documentation for bpf_map batch operations
PATCH v3 1/1 libbpf: Add documentation for bpf_map batch operations
From: Grant Seltzer <[email protected]>
This adds documention for:
- bpf_map_delete_batch()
- bpf_map_lookup_batch()
- bpf_map_lookup_and_delete_batch()
- bpf_map_update_batch()
This also updates the public API for the keys parameter of bpf_map_delete_batch(), and both thekeys and values parameters of bpf_map_update_batch() to be constants.
--- tools/lib/bpf/bpf.c | 8 +-- tools/lib/bpf/bpf.h | 116 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 118 insertions(+), 6 deletions(-)
tools/lib/bpf/bpf.c +4 -4
@@ -691,11 +691,11 @@ static int bpf_map_batch_common(int cmd, int fd, void *in_batch,return libbpf_err_errno (ret); } -int bpf_map_delete_batch (int fd,void *keys,__u32 *count, +int bpf_map_delete_batch (int fd,const void *keys,__u32 *count,const struct bpf_map_batch_opts *opts) {return bpf_map_batch_common (BPF_MAP_DELETE_BATCH , fd,NULL , -NULL , keys,NULL , count, opts); +NULL , (void *)keys,NULL , count, opts); } int bpf_map_lookup_batch(int fd, void *in_batch, void *out_batch, void *keys,
@@ -715,11 +715,11 @@ int bpf_map_lookup_and_delete_batch(int fd, void *in_batch, void *out_batch, count, opts); } -int bpf_map_update_batch (int fd,void *keys,void *values,__u32 *count, +int bpf_map_update_batch (int fd,const void *keys,const void *values,__u32 *count,const struct bpf_map_batch_opts *opts) {return bpf_map_batch_common (BPF_MAP_UPDATE_BATCH , fd,NULL ,NULL , - keys, values, count, opts); + (void *)keys, (void *)values, count, opts); }int bpf_obj_pin (int fd,const char *pathname)
tools/lib/bpf/bpf.h +114 -2
134 lines not on this page · raw message
Signature · 1 line
2.33.1
Quoted 9 lines · grantseltzer
From: Grant Seltzer <[email protected]>
This adds documention for:
-
bpf_map_delete_batch()
-bpf_map_lookup_batch()
-bpf_map_lookup_and_delete_batch()
-bpf_map_update_batch()
Quoted 6 lines
This also updates the public API for the
keysparameter ofbpf_map_delete_batch(), and both thekeysandvaluesparameters ofbpf_map_update_batch()to be constants.Signed-off-by Grant Seltzer <[email protected]>
Andrii Nakryiko
AppliedQuoted 13 lines · Yonghong Song
Quoted 9 lines · grantseltzer
From: Grant Seltzer <[email protected]>
This adds documention for:
-
bpf_map_delete_batch()
-bpf_map_lookup_batch()
-bpf_map_lookup_and_delete_batch()
-bpf_map_update_batch()
Quoted 8 lines
Quoted 6 lines
This also updates the public API for the
keysparameter ofbpf_map_delete_batch(), and both thekeysandvaluesparameters ofbpf_map_update_batch()to be constants.Signed-off-by Grant Seltzer <[email protected]>Acked-by Yonghong Song <[email protected]>
Applied to bpf-next, thanks.