linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Yonghong Song <yhs@meta.com>
Cc: bpf@vger.kernel.org, linux-doc@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Maryam Tahhan <mtahhan@redhat.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH bpf-next v3] docs/bpf: document BPF ARRAY_OF_MAPS and HASH_OF_MAPS
Date: Tue, 08 Nov 2022 10:00:19 +0000	[thread overview]
Message-ID: <m2a651sr4c.fsf@gmail.com> (raw)
In-Reply-To: <ad5e6435-30d6-afa3-ab4a-5cc6767a0f09@meta.com> (Yonghong Song's message of "Mon, 7 Nov 2022 11:41:09 -0800")

Yonghong Song <yhs@meta.com> 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;' ?

      reply	other threads:[~2022-11-08 10:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 13:48 [PATCH bpf-next v3] docs/bpf: document BPF ARRAY_OF_MAPS and HASH_OF_MAPS Donald Hunter
2022-11-07 17:46 ` Yonghong Song
2022-11-07 19:41   ` Yonghong Song
2022-11-08 10:00     ` Donald Hunter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2a651sr4c.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mtahhan@redhat.com \
    --cc=yhs@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).