Re: [PATCH bpf-next v3] docs/bpf: document BPF ARRAY_OF_MAPS and HASH_OF_MAPS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yonghong Song <yhs@xxxxxxxx> writes:

> On 11/7/22 9:46 AM, Yonghong Song wrote:
>> On 11/7/22 5:48 AM, Donald Hunter wrote:
>>> +
>>> +The outer map supports element update and delete from user space using the
>>> +syscall API. A BPF program is only allowed to do element lookup in the outer
>>> +map.
>> The outer map supports element lookup, update and delete from user space using the syscall
>> API.
>> A BPF program can do element delete for array/hash_of_maps. Please double check.
>
> Okay, I double checked with verifier.c. You are right, only lookup
> is supported for bpf programs.

Thanks for checking. I do refer to verifier.c to see what helpers are
supported. I will add lookup for userspace.

>>> +
>>> +See ``progs/test_bpf_map_in_map.c`` in ``tools/testing/selftests/bpf`` for more
>> The file name test_bpf_map_in_map.c` does not exist.

Good catch, that's an unfortunate typo. It should be test_btf_map_in_map.c

>>> +examples of declarative initialisation of outer maps.
>>> +
>>> +User Space
>>> +----------
>>> +
>>> +This snippet shows how to create an array based outer map:
>>> +
>>> +.. code-block:: c
>>> +
>>> +    int create_outer_array(int inner_fd) {
>>> +            int fd;
>>> +
>>> +            LIBBPF_OPTS(bpf_map_create_opts, opts, .inner_map_fd = inner_fd);
>> This is declaration. Please put it adjacent to 'int fd'.

Will do. Looking at code in testing/selftests/bpf it seems the preferred style
is to put it above 'int fd;' ?




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux