From: Donald Hunter <donald.hunter@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.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>
Subject: Re: [PATCH bpf-next v1] docs/bpf: Document BPF map types QUEUE and STACK
Date: Mon, 07 Nov 2022 09:17:29 +0000 [thread overview]
Message-ID: <m2v8nrrumu.fsf@gmail.com> (raw)
In-Reply-To: <CAEf4BzYpNd_oM6n4eW6UqF5n60xkvTarhbcyCgJSCDFtg1rm4g@mail.gmail.com> (Andrii Nakryiko's message of "Fri, 4 Nov 2022 16:00:59 -0700")
Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:
> On Fri, Nov 4, 2022 at 10:21 AM Donald Hunter <donald.hunter@gmail.com> wrote:
>>
>> +
>> +Userspace
>> +---------
>> +
>> +This snippet shows how to use libbpf to create a queue from userspace:
>
> I'd prefer "how to use libbpf's low-level API to create a queue".
> Because ideally people use the declarative way shown above, which is
> also "use libbpf to create", but is simpler and preserves all the BTF
> type information (if map supports it).
I'll incorporate this and also see if I can reword to highlight the
preferred declarative approach.
>> +
>> +.. code-block:: c
>> +
>> + int create_queue()
>> + {
>> + return bpf_map_create(BPF_MAP_TYPE_QUEUE,
>> + "sample_queue", /* name */
>> + 0, /* key size, must be zero */
>> + sizeof(__u32), /* value size */
>> + 10, /* max entries */
>> + 0); /* create options */
>
> NULL, it's a pointer
Good catch, thanks!
prev parent reply other threads:[~2022-11-07 12:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 17:21 [PATCH bpf-next v1] docs/bpf: Document BPF map types QUEUE and STACK Donald Hunter
2022-11-04 23:00 ` Andrii Nakryiko
2022-11-07 9:17 ` 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=m2v8nrrumu.fsf@gmail.com \
--to=donald.hunter@gmail.com \
--cc=andrii.nakryiko@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 \
/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).